diff --git a/LICENSE b/LICENSE index f288702d2..e912fcc53 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,16 @@ + Shynixn Plugin Distribution LICENCE + +All terms and conditions of the GNU GENERAL PUBLIC LICENSE Version 3.0 below apply. The Shynixn Plugin Distribution LICENCE +further restricts what you are allowed to do. Even if certain points are allowed under the GNU GENERAL PUBLIC LICENSE Version 3.0, +the Shynixn Plugin Distribution LICENCE overrules them. + +You are not allowed to redistribute the PetBlocks binary files under any circumstances. +The plugin binary files are PetBlocks.jar, PetBlocks-Legacy.jar and PetBlocks-Premium.jar. + +Commercial usage of this plugin is only allowed by obtaining a licence of a particular version of the PetBlocks-Legacy.jar or PetBlocks-Premium.jar plugin. +e.g. being an actively paying subscribed member of the Patreon https://www.patreon.com/Shynixn at the time this particular version was available. +You do not have any rights on any potential future released versions. You need to obtain a new licence for each individual version. + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/build.gradle.kts b/build.gradle.kts index 58856554b..e1bacea35 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "com.github.shynixn" -version = "9.12.0" +version = "9.13.0" repositories { mavenCentral() @@ -46,9 +46,9 @@ dependencies { // Custom dependencies implementation("com.github.shynixn.shygui:shygui:1.0.0") - implementation("com.github.shynixn.mcutils:common:2024.21") + implementation("com.github.shynixn.mcutils:common:2024.23") implementation("com.github.shynixn.mcutils:packet:2024.33") - implementation("com.github.shynixn.mcutils:database:2024.2") + implementation("com.github.shynixn.mcutils:database:2024.3") implementation("com.github.shynixn.mcutils:pathfinder:2024.3") implementation("com.github.shynixn.mcutils:guice:2024.2") diff --git a/docs/wiki/docs/particleexample.md b/docs/wiki/docs/particleexample.md new file mode 100644 index 000000000..12e739a96 --- /dev/null +++ b/docs/wiki/docs/particleexample.md @@ -0,0 +1,45 @@ +# Selectable particle effects + +This is a tutorial to get into building selectable parts for pets. It can also be used +to define selectable sounds, potion effects, etc. + +## 1. Edit the pet template + +Add a basic vanilla particle command as action to one of the loops. In this case the ``idle`` loop. + +* Instead of absolute coordinates we use the pet coordinate placeholders. +* The placeholder ``%petblocks_js_mypart%`` is a custom placeholder defined by you, which stores the **currently selected particle**. You can also name it ``%petblocks_js_mysound%`` to store sound names for example. +* The condition checks if the placeholder can actually be resolved e.g. a particle has been set. + +```yaml +loops: + idle: + actions: + - name: "Play particle effect" + condition: + type: STRING_NOT_CONTAINS + left: "%petblocks_js_mypart%" + right: "petblocks_js_mypart" + type: "COMMAND" + level: "SERVER" + run: + - "/particle %petblocks_js_mypart% %petblocks_pet_locationX% %petblocks_pet_locationY% %petblocks_pet_locationZ%" +``` + +## 2. Adjust vanilla command settings + +A vanilla command may automatically log to the console and to the chat of every op player. You can disable the output for op players using vanilla game rules such as ``gamerule sendCommandFeedback false``, ``/gamerule logAdminCommands false``, ``/gamerule commandBlockOutput false``. If you want to hide the output in your console, you need to install a LogFilter plugin. + +## 3. Check if it works ingame + +Execute the following commands and take a look if the pet displays heart particles. + +``` +/petblocks reload +/petblocks variable pet mypart heart +``` + +## 4. GUI buttons + +Open the GUI of petblocks or your favourite GUI plugin and add a button where the command ``/petblocks variable pet mypart heart %petblocks_owner_name%`` is executed with server level permissions. +You can add more particles by creating new buttons with new commands e.g. ``/petblocks variable pet mypart angry_villager %petblocks_owner_name%`` diff --git a/docs/wiki/docs/permission.md b/docs/wiki/docs/permission.md index 9c71aaad5..ebbd2cdd2 100644 --- a/docs/wiki/docs/permission.md +++ b/docs/wiki/docs/permission.md @@ -7,7 +7,7 @@ The following permissions are available in PetBlocks. * User: A permission all players can have. * Admin/User: Depending on your server, you may give this permission to your players. If you are not sure, try to build your server around **not giving this permission** to your players. -* Admin: A permission only Admins should have. +* Admin: A permission only admins should have. ### Minimum Required Permissions diff --git a/docs/wiki/docs/receivingpets.md b/docs/wiki/docs/receivingpets.md index 3defecaf3..b2519ab93 100644 --- a/docs/wiki/docs/receivingpets.md +++ b/docs/wiki/docs/receivingpets.md @@ -3,20 +3,14 @@ Once you have setup the permission, join your server. The PetBlocks default configuration creates a pet with template ``classic`` for you and makes it spawn in front of you. If you cannot see the pet, try executing ``/petblocks call pet`` or review your permissions again. - -**Make sure your players have this permission to see their pet:** -``` -petblocks.pet.spawn -petblocks.pet.amount.1 -``` - The next step is to decide, how you want your players to receive a pet. There are multiple options below. ## Receiving a pet on first join -This is enabled per default and can be changed in the ``config.yml`` under ``pet/receivePetsOnJoin``. This creates a new database entry for each joining player, regardless if he has the spawn permission or not. -The player requires the minimum ``petblocks.pet.spawn`` to see their pet. +!!! note "Important" + Make sure you have given your players the minimum required permissions before you continue. +This is enabled per default and can be changed in the ``config.yml`` under ``pet/receivePetsOnJoin``. This creates a new database entry for each joining player, regardless if he has the spawn permission or not. If you want to receive no pets on join and unlock pets later own (e.g. for shops or VIP perks), change this to: ``` @@ -38,7 +32,6 @@ pet: In order to configure, if the pet should automatically spawn in front of the player on creation, open the template ``plugins/PetBlocks/pets/pet_classic.yml``. Set ``pet/spawned`` to ``true`` or ``false``. - ## Receiving pets using a shop There are many ways how you can handle it. These are just examples below: diff --git a/docs/wiki/docs/template.md b/docs/wiki/docs/template.md index 350ea5c98..a52b6e96a 100644 --- a/docs/wiki/docs/template.md +++ b/docs/wiki/docs/template.md @@ -170,6 +170,8 @@ Actions can optionally have conditions, which support the following types: * ``STRING_EQUALS`` * ``STRING_NOT_EQUALS`` +* ``STRING_CONTAINS`` +* ``STRING_NOT_CONTAINS`` * ``STRING_EQUALS_IGNORE_CASE`` * ``STRING_NOT_EQUALS_IGNORE_CASE`` * ``NUMBER_GREATER_THAN`` diff --git a/docs/wiki/mkdocs.yml b/docs/wiki/mkdocs.yml index d51f149c7..40572f105 100644 --- a/docs/wiki/mkdocs.yml +++ b/docs/wiki/mkdocs.yml @@ -5,12 +5,13 @@ nav: - 'PetBlocks Wiki': - Introduction: README.md - Permission: permission.md + - Giving pets to players: receivingpets.md - Commands: commands.md - - Giving Pets to Players: receivingpets.md - Templates: template.md - GUI: gui.md - PlaceHolders: placeholders.md - Custom Models: custommodels.md + - Selectable particle effects: particleexample.md - Developer Api: api.md - 'FAQ': faq.md theme: diff --git a/src/main/java/com/github/shynixn/petblocks/PetBlocksDependencyInjectionModule.kt b/src/main/java/com/github/shynixn/petblocks/PetBlocksDependencyInjectionModule.kt index ee48d2524..9fc152be1 100644 --- a/src/main/java/com/github/shynixn/petblocks/PetBlocksDependencyInjectionModule.kt +++ b/src/main/java/com/github/shynixn/petblocks/PetBlocksDependencyInjectionModule.kt @@ -1,6 +1,7 @@ package com.github.shynixn.petblocks import com.fasterxml.jackson.core.type.TypeReference +import com.github.shynixn.mccoroutine.bukkit.minecraftDispatcher import com.github.shynixn.mcutils.common.ConfigurationService import com.github.shynixn.mcutils.common.ConfigurationServiceImpl import com.github.shynixn.mcutils.common.chat.ChatMessageService @@ -69,7 +70,8 @@ class PetBlocksDependencyInjectionModule( val configSelectedRepository = ConfigSelectedRepositoryImpl(plugin, "PetBlocks", plugin.dataFolder.toPath().resolve("PetBlocks.sqlite"), - object : TypeReference() {}) + object : TypeReference() {}, plugin.minecraftDispatcher + ) val playerDataRepository = AutoSavePlayerDataRepositoryImpl( 1000 * 60L * autoSaveMinutes, CachePlayerDataRepositoryImpl(configSelectedRepository, plugin), plugin ) diff --git a/src/main/java/com/github/shynixn/petblocks/PetBlocksLanguage.kt b/src/main/java/com/github/shynixn/petblocks/PetBlocksLanguage.kt index 3a9f8b3b6..e24a4e2b9 100644 --- a/src/main/java/com/github/shynixn/petblocks/PetBlocksLanguage.kt +++ b/src/main/java/com/github/shynixn/petblocks/PetBlocksLanguage.kt @@ -28,8 +28,8 @@ object PetBlocksLanguage { /** Toggles the pet spawn state. **/ var toggleCommandHint : String = "Toggles the pet spawn state." - /** [&9PetBlocks&f] Started riding pet %1$1s. **/ - var petRideMessage : String = "[&9PetBlocks&f] Started riding pet %1$1s." + /** [&9PetBlocks&f] Started riding pet. **/ + var petRideMessage : String = "[&9PetBlocks&f] Started riding pet." /** Makes the pet walk to a given location. **/ var moveToCommandHint : String = "Makes the pet walk to a given location." @@ -82,8 +82,8 @@ object PetBlocksLanguage { /** Despawns the pet if it has not already despawned. **/ var deSpawnCommandHint : String = "Despawns the pet if it has not already despawned." - /** [&9PetBlocks&f] The skin of pet %1$1s has been changed. **/ - var petSkinNbtChanged : String = "[&9PetBlocks&f] The skin of pet %1$1s has been changed." + /** [&9PetBlocks&f] The skin of pet has been changed. **/ + var petSkinNbtChanged : String = "[&9PetBlocks&f] The skin of pet has been changed." /** [&9PetBlocks&f] The pet has been rotated. **/ var rotationRelMessage : String = "[&9PetBlocks&f] The pet has been rotated." @@ -103,8 +103,8 @@ object PetBlocksLanguage { /** [&9PetBlocks&f] &cWorld %1$1s not found. **/ var worldNotFoundMessage : String = "[&9PetBlocks&f] &cWorld %1$1s not found." - /** [&9PetBlocks&f] The name of pet %1$1s has been changed to %2$1s. **/ - var petNameChangeMessage : String = "[&9PetBlocks&f] The name of pet %1$1s has been changed to %2$1s." + /** [&9PetBlocks&f] The name of the pet has been changed to %1$1s. **/ + var petNameChangeMessage : String = "[&9PetBlocks&f] The name of the pet has been changed to %1$1s." /** [&9PetBlocks&f] &cOnly the direction types %1$1s are supported. **/ var petRotationTypeNotFound : String = "[&9PetBlocks&f] &cOnly the direction types %1$1s are supported." @@ -130,14 +130,14 @@ object PetBlocksLanguage { /** [&9PetBlocks&f] &cPet with name %1$1s not found. **/ var petNotFoundMessage : String = "[&9PetBlocks&f] &cPet with name %1$1s not found." - /** [&9PetBlocks&f] Changed pet %1$1s to loop %2$1s. **/ - var petLoopChangedMessage : String = "[&9PetBlocks&f] Changed pet %1$1s to loop %2$1s." + /** [&9PetBlocks&f] Changed pet to loop %2$1s. **/ + var petLoopChangedMessage : String = "[&9PetBlocks&f] Changed pet to loop %2$1s." /** Makes the owner wear the pet. **/ var hatCommandHint : String = "Makes the owner wear the pet." - /** [&9PetBlocks&f] The visibility of pet %1$1s has been changed to %2$1s. **/ - var visibilityChangedMessage : String = "[&9PetBlocks&f] The visibility of pet %1$1s has been changed to %2$1s." + /** [&9PetBlocks&f] The visibility of pet has been changed to %1$1s. **/ + var visibilityChangedMessage : String = "[&9PetBlocks&f] The visibility of pet has been changed to %1$1s." /** [&9PetBlocks&f] &cYou do not have permission to edit the pets of other players. **/ var manipulateOtherMessage : String = "[&9PetBlocks&f] &cYou do not have permission to edit the pets of other players." @@ -196,8 +196,8 @@ object PetBlocksLanguage { /** [&9PetBlocks&f] Pet has been moved. **/ var petVelocityAppliedMessage : String = "[&9PetBlocks&f] Pet has been moved." - /** [&9PetBlocks&f] Started hat pet %1$1s. **/ - var petHatMessage : String = "[&9PetBlocks&f] Started hat pet %1$1s." + /** [&9PetBlocks&f] Started hat pet. **/ + var petHatMessage : String = "[&9PetBlocks&f] Started hat pet." /** Changes which loop from the template is being executed by the pet. An example loop is idle. **/ var loopCommandHint : String = "Changes which loop from the template is being executed by the pet. An example loop is idle." @@ -229,8 +229,8 @@ object PetBlocksLanguage { /** Makes the owner select one of his pets as primary pet. This is only helpful if a single player has got multiple pets in PetBlocks-Premium. **/ var selectCommandHint : String = "Makes the owner select one of his pets as primary pet. This is only helpful if a single player has got multiple pets in PetBlocks-Premium." - /** [&9PetBlocks&f] Changed pet %1$1s to template %2$1s. **/ - var petTemplateChangeMessage : String = "[&9PetBlocks&f] Changed pet %1$1s to template %2$1s." + /** [&9PetBlocks&f] Changed pet to template %2$1s. **/ + var petTemplateChangeMessage : String = "[&9PetBlocks&f] Changed pet to template %2$1s." /** Opens the GUI menu with the given name. **/ var openCommandHint : String = "Opens the GUI menu with the given name." @@ -253,8 +253,8 @@ object PetBlocksLanguage { /** [&9PetBlocks&f] &cThe plugin HeadDatabase is not loaded. **/ var headDatabasePluginNotLoaded : String = "[&9PetBlocks&f] &cThe plugin HeadDatabase is not loaded." - /** [&9PetBlocks&f] The skinType of pet %1$1s has been changed. **/ - var petSkinTypeChangedMessage : String = "[&9PetBlocks&f] The skinType of pet %1$1s has been changed." + /** [&9PetBlocks&f] The skinType of pet has been changed. **/ + var petSkinTypeChangedMessage : String = "[&9PetBlocks&f] The skinType of pet has been changed." /** [&9PetBlocks&f] Count: %1$1d Names: %2$1s **/ var petListMessage : String = "[&9PetBlocks&f] Count: %1$1d Names: %2$1s" @@ -292,8 +292,8 @@ object PetBlocksLanguage { /** [&9PetBlocks&f] PetBlocks has been reloaded. **/ var reloadMessage : String = "[&9PetBlocks&f] PetBlocks has been reloaded." - /** [&9PetBlocks&f] Stopped mounting pet %1$1s. **/ - var petUnmountMessage : String = "[&9PetBlocks&f] Stopped mounting pet %1$1s." + /** [&9PetBlocks&f] Stopped mounting pet. **/ + var petUnmountMessage : String = "[&9PetBlocks&f] Stopped mounting pet." /** [&9PetBlocks&f] &cCannot parse nbt %1$1s. **/ var cannotParseNbtMessage : String = "[&9PetBlocks&f] &cCannot parse nbt %1$1s." diff --git a/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt b/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt index 6730a7f18..886fb3bdb 100644 --- a/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt +++ b/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt @@ -39,6 +39,9 @@ import java.util.logging.Level * Author Shynixn */ class PetBlocksPlugin : JavaPlugin() { + companion object { + var languageFiles = arrayOf("en_us", "es_es") + } private val prefix: String = ChatColor.BLUE.toString() + "[PetBlocks] " + ChatColor.WHITE private lateinit var mainModule: PetBlocksDependencyInjectionModule private lateinit var shyGuiModule: ShyGUIDependencyInjectionModule @@ -96,7 +99,7 @@ class PetBlocksPlugin : JavaPlugin() { // Register Language val language = config.getString("language")!! - reloadTranslation(language, PetBlocksLanguage::class.java, "en_us") + reloadTranslation(language, PetBlocksLanguage::class.java, *languageFiles) logger.log(Level.INFO, "Loaded language file $language.properties.") // ShyGUI Module diff --git a/src/main/java/com/github/shynixn/petblocks/enumeration/PetActionConditionType.kt b/src/main/java/com/github/shynixn/petblocks/enumeration/PetActionConditionType.kt index d0fb63144..1bf898855 100644 --- a/src/main/java/com/github/shynixn/petblocks/enumeration/PetActionConditionType.kt +++ b/src/main/java/com/github/shynixn/petblocks/enumeration/PetActionConditionType.kt @@ -3,6 +3,8 @@ package com.github.shynixn.petblocks.enumeration enum class PetActionConditionType { NONE, STRING_EQUALS, + STRING_CONTAINS, + STRING_NOT_CONTAINS, STRING_NOT_EQUALS, STRING_EQUALS_IGNORE_CASE, STRING_NOT_EQUALS_IGNORE_CASE, diff --git a/src/main/java/com/github/shynixn/petblocks/impl/PetEntityImpl.kt b/src/main/java/com/github/shynixn/petblocks/impl/PetEntityImpl.kt index a93544d03..1d9d6a835 100644 --- a/src/main/java/com/github/shynixn/petblocks/impl/PetEntityImpl.kt +++ b/src/main/java/com/github/shynixn/petblocks/impl/PetEntityImpl.kt @@ -190,7 +190,12 @@ class PetEntityImpl( lastClickTimeStamp = currentDateTime - val rightClickEvent = pet.template.events["rightClick"] + val key = if (player.isSneaking) { + "rightClickSneak" + } else { + "rightClick" + } + val rightClickEvent = pet.template.events[key] if (rightClickEvent != null) { plugin.launch(plugin.minecraftDispatcher + object : CoroutineTimings() {}) { petActionExecutionService.executeAction(player, pet, rightClickEvent, CancellationToken()) @@ -211,7 +216,12 @@ class PetEntityImpl( lastClickTimeStamp = currentDateTime - val leftClickEvent = pet.template.events["leftClick"] + val key = if (player.isSneaking) { + "leftClickSneak" + } else { + "leftClick" + } + val leftClickEvent = pet.template.events[key] if (leftClickEvent != null) { plugin.launch(plugin.minecraftDispatcher + object : CoroutineTimings() {}) { petActionExecutionService.executeAction(player, pet, leftClickEvent, CancellationToken()) diff --git a/src/main/java/com/github/shynixn/petblocks/impl/commandexecutor/PetBlocksCommandExecutor.kt b/src/main/java/com/github/shynixn/petblocks/impl/commandexecutor/PetBlocksCommandExecutor.kt index 7acdabf23..665d51a1e 100644 --- a/src/main/java/com/github/shynixn/petblocks/impl/commandexecutor/PetBlocksCommandExecutor.kt +++ b/src/main/java/com/github/shynixn/petblocks/impl/commandexecutor/PetBlocksCommandExecutor.kt @@ -10,6 +10,7 @@ import com.github.shynixn.mcutils.common.repository.CacheRepository import com.github.shynixn.mcutils.database.api.CachePlayerRepository import com.github.shynixn.petblocks.PetBlocksDependencyInjectionModule import com.github.shynixn.petblocks.PetBlocksLanguage +import com.github.shynixn.petblocks.PetBlocksPlugin.Companion.languageFiles import com.github.shynixn.petblocks.contract.DependencyHeadDatabaseService import com.github.shynixn.petblocks.contract.Pet import com.github.shynixn.petblocks.contract.PetService @@ -764,7 +765,24 @@ class PetBlocksCommandExecutor @Inject constructor( templateRepository.clearCache() plugin.saveDefaultConfig() plugin.reloadConfig() - configurationService.reload() + val language = plugin.config.getString("language")!! + plugin.reloadTranslation(language, PetBlocksLanguage::class.java, *languageFiles) + val templates = templateRepository.getAll() + + // Updates the templates. + for (player in petService.getCache().keys) { + val pets = petService.getCache()[player] + + if (pets != null) { + for (pet in pets) { + val newTemplate = templates.firstOrNull { e -> e.name == pet.template.name } + if (newTemplate != null) { + pet.template = newTemplate + } + } + } + } + Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "petblocksgui reload") sender.sendMessage(PetBlocksLanguage.reloadMessage) } @@ -965,7 +983,7 @@ class PetBlocksCommandExecutor @Inject constructor( sender: CommandSender, pet: Pet, visibility: PetVisibility ) { pet.visibility = visibility - sender.sendPluginMessage(String.format(PetBlocksLanguage.visibilityChangedMessage, pet.name, visibility)) + sender.sendPluginMessage(String.format(PetBlocksLanguage.visibilityChangedMessage, visibility)) } private fun setPetLoop(sender: CommandSender, pet: Pet, loop: String) { diff --git a/src/main/java/com/github/shynixn/petblocks/impl/service/PetActionExecutionServiceImpl.kt b/src/main/java/com/github/shynixn/petblocks/impl/service/PetActionExecutionServiceImpl.kt index a65672a71..882ab0366 100644 --- a/src/main/java/com/github/shynixn/petblocks/impl/service/PetActionExecutionServiceImpl.kt +++ b/src/main/java/com/github/shynixn/petblocks/impl/service/PetActionExecutionServiceImpl.kt @@ -177,7 +177,32 @@ class PetActionExecutionServiceImpl @Inject constructor( } return conditionResult - } else { + } + else if (conditionType == PetActionConditionType.STRING_CONTAINS) { + val conditionResult = leftEscaped.contains(rightEscaped) + + if (action.debug) { + plugin.logger.log( + Level.INFO, + "End evaluating condition, $leftEscaped contains $rightEscaped -> ${conditionResult}." + ) + } + + return conditionResult + } + else if (conditionType == PetActionConditionType.STRING_NOT_CONTAINS) { + val conditionResult = !leftEscaped.contains(rightEscaped) + + if (action.debug) { + plugin.logger.log( + Level.INFO, + "End evaluating condition, $leftEscaped not contains $rightEscaped -> ${conditionResult}." + ) + } + + return conditionResult + } + else { val leftNumber = leftEscaped.toDoubleOrNull() if (leftNumber == null) { diff --git a/src/main/java/com/github/shynixn/petblocks/impl/service/PetServiceImpl.kt b/src/main/java/com/github/shynixn/petblocks/impl/service/PetServiceImpl.kt index ddd6209e6..747d382ff 100644 --- a/src/main/java/com/github/shynixn/petblocks/impl/service/PetServiceImpl.kt +++ b/src/main/java/com/github/shynixn/petblocks/impl/service/PetServiceImpl.kt @@ -175,7 +175,7 @@ class PetServiceImpl @Inject constructor( val petMeta = PetMeta() petMeta.name = name petMeta.template = templateId - petMeta.displayName = placeHolderService.resolvePlaceHolder(player, template.pet.displayName, emptyMap()) + petMeta.displayName = template.pet.displayName // PlaceHolders are resolved later. petMeta.isSpawned = template.pet.spawned petMeta.visibility = template.pet.visibility petMeta.ridingState = template.pet.ridingState diff --git a/src/main/resources/lang/en_us.properties b/src/main/resources/lang/en_us.properties index eee0bde3e..334161478 100644 --- a/src/main/resources/lang/en_us.properties +++ b/src/main/resources/lang/en_us.properties @@ -4,19 +4,19 @@ petNotFoundMessage=[&9PetBlocks&f] &cPet with name %1$1s not found. petNameExistsMessage=[&9PetBlocks&f] &cPet with name %1$1s already exists. petCreatedMessage=[&9PetBlocks&f] Pet with name %1$1s has been created. petDeletedMessage=[&9PetBlocks&f] Pet with name %1$1s has been deleted. -petNameChangeMessage=[&9PetBlocks&f] The name of pet %1$1s has been changed to %2$1s. +petNameChangeMessage=[&9PetBlocks&f] The name of the pet has been changed to %1$1s. petCalledMessage=[&9PetBlocks&f] Pet with name %1$1s has been called. petSpawnedMessage=[&9PetBlocks&f] Pet with name %1$1s has been spawned. petDespawnedMessage=[&9PetBlocks&f] Pet with name %1$1s has been removed. visibilityTypeNotFoundMessage=[&9PetBlocks&f] &cOnly the visibility types %1$1s are supported. -visibilityChangedMessage=[&9PetBlocks&f] The visibility of pet %1$1s has been changed to %2$1s. -petSkinTypeChangedMessage=[&9PetBlocks&f] The skinType of pet %1$1s has been changed. -petSkinNbtChanged=[&9PetBlocks&f] The skin of pet %1$1s has been changed. +visibilityChangedMessage=[&9PetBlocks&f] The visibility of the pet has been changed to %1$1s. +petSkinTypeChangedMessage=[&9PetBlocks&f] The skinType of the pet has been changed. +petSkinNbtChanged=[&9PetBlocks&f] The skin of the pet has been changed. petSkinTypeNotFound=[&9PetBlocks&f] &cMaterial %1$1s not found. petListMessage=[&9PetBlocks&f] Count: %1$1d Names: %2$1s -petRideMessage=[&9PetBlocks&f] Started riding pet %1$1s. -petUnmountMessage=[&9PetBlocks&f] Stopped mounting pet %1$1s. -petHatMessage=[&9PetBlocks&f] Started hat pet %1$1s. +petRideMessage=[&9PetBlocks&f] Started riding pet. +petUnmountMessage=[&9PetBlocks&f] Stopped mounting pet. +petHatMessage=[&9PetBlocks&f] Started hat pet. worldNotFoundMessage=[&9PetBlocks&f] &cWorld %1$1s not found. petLookAtMessage=[&9PetBlocks&f] Pet is looking at a location. petWalkToLocationMessage=[&9PetBlocks&f] Pet is walking to location. @@ -29,8 +29,8 @@ petCharacterNotAllowed=[&9PetBlocks&f] &cThis pet name is not allowed. reloadMessage=[&9PetBlocks&f] PetBlocks has been reloaded. petLoopNotFound=[&9PetBlocks&f] &cLoop %1$1s not found. premiumMultiplePets=[&9PetBlocks&f] &cPetBlocks-Premium is required to spawn multiple pets per player. -petLoopChangedMessage=[&9PetBlocks&f] Changed pet %1$1s to loop %2$1s. -petTemplateChangeMessage=[&9PetBlocks&f] Changed pet %1$1s to template %2$1s. +petLoopChangedMessage=[&9PetBlocks&f] Changed pet to loop %2$1s. +petTemplateChangeMessage=[&9PetBlocks&f] Changed pet to template %2$1s. petAmountNotAllowed=[&9PetBlocks&f] &cYou do not have permission to have %1$1s pet(s). petSelectedMessage= templateNotAllowed=[&9PetBlocks&f] &cYou do not have permission for template %1$1s. diff --git a/src/main/resources/lang/es_es.properties b/src/main/resources/lang/es_es.properties new file mode 100644 index 000000000..8e49da6e3 --- /dev/null +++ b/src/main/resources/lang/es_es.properties @@ -0,0 +1,103 @@ +playerNotFoundMessage=[&9PetBlocks&f] &cJugador %1$1s no encontrado. +templateNotFoundMessage=[&9PetBlocks&f] &cPlantilla %1$1s no encontrada. +petNotFoundMessage=[&9PetBlocks&f] &cMascota con el nombre %1$1s no encontrada. +petNameExistsMessage=[&9PetBlocks&f] &cMascota con el nombre %1$1s ya existe. +petCreatedMessage=[&9PetBlocks&f] Mascota con el nombre %1$1s ha sido creada. +petDeletedMessage=[&9PetBlocks&f] Mascota con el nombre %1$1s ha sido eliminada. +petNameChangeMessage=[&9PetBlocks&f] El nombre de la mascota %1$1s ha sido cambiado a %2$1s. +petCalledMessage=[&9PetBlocks&f] Mascota con el nombre %1$1s ha sido llamada. +petSpawnedMessage=[&9PetBlocks&f] Mascota con el nombre %1$1s ha sido invocada. +petDespawnedMessage=[&9PetBlocks&f] Mascota con el nombre %1$1s ha sido eliminada. +visibilityTypeNotFoundMessage=[&9PetBlocks&f] &cSolo se admiten los tipos de visibilidad %1$1s. +visibilityChangedMessage=[&9PetBlocks&f] La visibilidad de la mascota %1$1s ha sido cambiada a %2$1s. +petSkinTypeChangedMessage=[&9PetBlocks&f] El tipo de piel de la mascota %1$1s ha sido cambiado. +petSkinNbtChanged=[&9PetBlocks&f] La piel de la mascota %1$1s ha sido cambiada. +petSkinTypeNotFound=[&9PetBlocks&f] &cMaterial %1$1s no encontrado. +petListMessage=[&9PetBlocks&f] Cantidad: %1$1d Nombres: %2$1s +petRideMessage=[&9PetBlocks&f] Comenzaste a montar la mascota %1$1s. +petUnmountMessage=[&9PetBlocks&f] Dejaste de montar la mascota %1$1s. +petHatMessage=[&9PetBlocks&f] Comenzaste a llevar la mascota %1$1s como sombrero. +worldNotFoundMessage=[&9PetBlocks&f] &cMundo %1$1s no encontrado. +petLookAtMessage=[&9PetBlocks&f] La mascota está mirando una ubicación. +petWalkToLocationMessage=[&9PetBlocks&f] La mascota está caminando hacia la ubicación. +cannotParseNumberMessage=[&9PetBlocks&f] &cNo se puede analizar el número %1$1s. +cannotParseNbtMessage=[&9PetBlocks&f] &cNo se puede analizar el NBT %1$1s. +placeHolderPetNotFound=No hay mascota. +petTeleportedMessage=[&9PetBlocks&f] La mascota ha sido teletransportada. +petVelocityAppliedMessage=[&9PetBlocks&f] La mascota ha sido movida. +petCharacterNotAllowed=[&9PetBlocks&f] &cEste nombre de mascota no está permitido. +reloadMessage=[&9PetBlocks&f] PetBlocks ha sido recargado. +petLoopNotFound=[&9PetBlocks&f] &cBucle %1$1s no encontrado. +premiumMultiplePets=[&9PetBlocks&f] &cSe requiere PetBlocks-Premium para invocar múltiples mascotas por jugador. +petLoopChangedMessage=[&9PetBlocks&f] Cambiado el bucle de la mascota %1$1s a %2$1s. +petTemplateChangeMessage=[&9PetBlocks&f] Cambiada la plantilla de la mascota %1$1s a %2$1s. +petAmountNotAllowed=[&9PetBlocks&f] &cNo tienes permiso para tener %1$1s mascota(s). +petSelectedMessage= +templateNotAllowed=[&9PetBlocks&f] &cNo tienes permiso para la plantilla %1$1s. +speedCannotBeParsed=[&9PetBlocks&f] &cEl valor de velocidad %1$1s no se puede analizar. +headDatabasePluginNotLoaded=[&9PetBlocks&f] &cEl plugin HeadDatabase no está cargado. +errorLoadingTemplatesMessage=[&9PetBlocks&f] &cNo se puede analizar el archivo de plantilla. Consulta el registro de la consola para más detalles. +dropTypeNotFound=[&9PetBlocks&f] &cSolo se admiten los tipos de caída %1$1s. +cancelMessage=[&9PetBlocks&f] Acción cancelada. +snapMessage=[&9PetBlocks&f] La mascota ha sido ajustada a un eje de coordenadas. +petMoveForwardMessage=[&9PetBlocks&f] La mascota está avanzando. +petRotationTypeNotFound=[&9PetBlocks&f] &cSolo se admiten los tipos de dirección %1$1s. +rotationRelMessage=[&9PetBlocks&f] La mascota ha sido rotada. +entityTypeChangeMessage=[&9PetBlocks&f] El tipo de entidad de la mascota ha sido cambiado a %1$1s. +entityVisibilityChangedMessage=[&9PetBlocks&f] La visibilidad de la entidad de la mascota ha sido cambiada a %1$1s. +groundOffsetChangedMessage=[&9PetBlocks&f] El desplazamiento al suelo de la mascota ha sido cambiado. +groundOffsetCannotBeParsed=[&9PetBlocks&f] &cEl valor de desplazamiento al suelo %1$1s no se puede analizar. +cannotParseDataComponentMessage=[&9PetBlocks&f] &cNo se puede analizar el componente de datos %1$1s. +maxLength20Characters=[&9PetBlocks&f] La longitud del texto debe ser menor a 20 caracteres. +noPermissionCommand=[&9PetBlocks&f] &cNo tienes permiso para ejecutar este comando. +commandUsage=[&9PetBlocks&f] Usa /petblocks help para ver más información sobre el plugin. +commandDescription=[&9PetBlocks&f] Todos los comandos para el plugin PetBlocks. +commandSenderHasToBePlayer=[&9PetBlocks&f] El remitente del comando tiene que ser un jugador si no se especifica el argumento opcional de jugador. +cannotParseBoolean=[&9PetBlocks&f] &cNo se puede analizar el booleano %1$1s. +createCommandHint=Crea una nueva mascota para el jugador con la plantilla dada. +deleteCommandHint=Elimina la mascota del jugador. +listCommandHint=Lista todas las mascotas de un jugador. +callCommandHint=Invoca y teletransporta la mascota frente al dueño. +lookAtCommandHint=Hace que la mascota mire la ubicación dada. +lookAtOwnerCommandHint=Hace que la mascota mire al dueño. +moveToCommandHint=Hace que la mascota camine hacia una ubicación dada. +moveToOwnerCommandHint=Hace que la mascota camine hacia el dueño. +hatCommandHint=Hace que el dueño use la mascota como sombrero. +rideCommandHint=Hace que el dueño monte la mascota. +unmountCommandHint=Hace que el dueño deje de montar (deje de usar como sombrero) la mascota. +teleportCommandHint=Teletransporta la mascota a la ubicación dada. +velocityCommandHint=Lanza la mascota en la dirección dada. +skinTypeCommandHint=Cambia el material usado como cabeza. +skinNbtCommandHint=Cambia las etiquetas NBT del ítem de cabeza. Funciona en versiones de Minecraft anteriores a la 1.20.5. Usa el comando /petblocks skincomponent para Minecraft >= 1.20.5. +skinComponentCommandHint=Cambia las etiquetas del Componente de Datos del ítem de cabeza. Los Componentes de Datos reemplazan las etiquetas NBT desde el lanzamiento de Minecraft 1.20.5. +skinBase64CommandHint=Cambia el material de la cabeza a player_head y establece la URL de la textura codificada en base64. +skinHeadDatabaseCommandHint=Cambia el material de la cabeza a player_head y establece la URL de la textura desde una piel cargada por el plugin HeadDatabase. +renameCommandHint=Cambia el nombre visible de la mascota. No acepta espacios. Los guiones bajos '_' son reemplazados automáticamente por espacios. +visibilityCommandHint=Cambia quién puede ver la mascota. +loopCommandHint=Cambia qué bucle de la plantilla está siendo ejecutado por la mascota. Un ejemplo de bucle es idle. +templateCommandHint=Cambia la plantilla de una mascota sin recrear la mascota. +spawnCommandHint=Invoca la mascota si no ha sido ya invocada. +deSpawnCommandHint=Elimina la mascota si no ha sido ya eliminada. +toggleCommandHint=Alterna el estado de invocación de la mascota. +selectCommandHint=Hace que el dueño seleccione una de sus mascotas como mascota principal. Esto solo es útil si un jugador tiene múltiples mascotas en PetBlocks-Premium. +openHeadDatabaseCommandHint=Abre el inventario de HeadDatabase con un gancho especial, que aplica el siguiente ítem que selecciones en la interfaz de headdatabse a la mascota. +breakBlockCommandHint=Rompe el bloque que la mascota está mirando. Hay un marcador de posición que contiene el nombre del tipo de bloque. Romper un bloque se cancela automáticamente en ciertas acciones, por ejemplo, una mascota mira a un jugador, una mascota comienza a moverse. +cancelCommandHint=Cancela cualquier acción de larga duración como romper un bloque. +snapCommandHint=Rota la mascota hasta la línea exacta del eje x o z más cercano. +moveForwardCommandHint=Deja que la mascota avance en su dirección actual. Ejecutar el comando snap antes de ejecutar este es útil para moverse en línea recta. Si la mascota llega a un precipicio (diferencia de 1 bloque), avanzar se detiene. +rotateRelCommandHint=Rota la mascota en relación a su rotación actual. +entityTypeCommandHint=Cambia el tipo de entidad de la mascota. El tipo predeterminado es minecraft:armor_stand +entityVisibleCommandHint=Cambia si el cuerpo de una entidad es visible. Para soportes de armadura esto es falso, para la mayoría de las otras entidades esto debería ser verdadero. +groundOffSetCommandHint=Cambia el desplazamiento del cuerpo de la entidad al suelo. Útil al configurar diferentes tipos de entidades. +manipulateOtherMessage=[&9PetBlocks&f] &cNo tienes permiso para editar las mascotas de otros jugadores. +reloadCommandHint=Recarga todas las mascotas, menús y configuración. +closeCommandHint=Cierra el menú GUI. +backCommandHint=Retrocede una página del GUI. +openCommandHint=Abre el menú GUI con el nombre dado. +nextCommandHint=Abre la siguiente página del GUI. +messageCommandHint=Envía un mensaje de chat. +guiMenuNotFoundMessage=[&9PetBlocks&f] &cMenú %1$1s no encontrado. +guiMenuNoPermissionMessage=[&9PetBlocks&f] &cNo tienes permiso para el menú %1$1s. +variableCommandHint=Establece el valor de la variable con la clave dada. Esto es útil para almacenar datos arbitrarios en la mascota, por ejemplo, salud. +variableChangedMessage=[&9PetBlocks&f] La variable de memoria de la mascota %1$1s ha sido establecida en %2$1s. +velocityRelCommandHint=Lanza la mascota en la dirección actual con los multiplicadores dados. diff --git a/src/main/resources/pets/pet_classic.yml b/src/main/resources/pets/pet_classic.yml index 376566445..c26f65161 100644 --- a/src/main/resources/pets/pet_classic.yml +++ b/src/main/resources/pets/pet_classic.yml @@ -97,7 +97,30 @@ events: level: "SERVER" run: - "/petblocks velocity %petblocks_pet_name% %petblocks_js_jsonKnockback_x% 0.2 %petblocks_js_jsonKnockback_z% %petblocks_eventPlayer_name%" + leftClickSneak: + actions: # You can add/remove actions as you want here. + - name: "Open the pet GUI" + condition: + type: STRING_EQUALS + left: "%petblocks_eventPlayer_name%" + right: "%petblocks_owner_name%" + type: "COMMAND" + level: "PLAYER" + run: + - "/petblocks select %petblocks_pet_name%" + - "/petblock" rightClick: + actions: # You can add/remove actions as you want here. + - name: "Start riding pet" + condition: + type: STRING_EQUALS + left: "%petblocks_eventPlayer_name%" + right: "%petblocks_owner_name%" + type: "COMMAND" + level: "PLAYER" + run: + - "/petblocks ride %petblocks_pet_name%" + rightClickSneak: actions: # You can add/remove actions as you want here. - name: "Open the pet GUI" condition: diff --git a/src/main/resources/pets/pet_flying_dolphin.yml b/src/main/resources/pets/pet_flying_dolphin.yml index 83f450109..87615c1ee 100644 --- a/src/main/resources/pets/pet_flying_dolphin.yml +++ b/src/main/resources/pets/pet_flying_dolphin.yml @@ -97,7 +97,30 @@ events: level: "SERVER" run: - "/petblocks velocity %petblocks_pet_name% %petblocks_js_jsonKnockback_x% 0.2 %petblocks_js_jsonKnockback_z% %petblocks_eventPlayer_name%" + leftClickSneak: + actions: # You can add/remove actions as you want here. + - name: "Open the pet GUI" + condition: + type: STRING_EQUALS + left: "%petblocks_eventPlayer_name%" + right: "%petblocks_owner_name%" + type: "COMMAND" + level: "PLAYER" + run: + - "/petblocks select %petblocks_pet_name%" + - "/petblock" rightClick: + actions: # You can add/remove actions as you want here. + - name: "Start riding pet" + condition: + type: STRING_EQUALS + left: "%petblocks_eventPlayer_name%" + right: "%petblocks_owner_name%" + type: "COMMAND" + level: "PLAYER" + run: + - "/petblocks ride %petblocks_pet_name%" + rightClickSneak: actions: # You can add/remove actions as you want here. - name: "Open the pet GUI" condition: diff --git a/src/main/resources/plugin-legacy.yml b/src/main/resources/plugin-legacy.yml index 2e77eda17..3bce8cb63 100644 --- a/src/main/resources/plugin-legacy.yml +++ b/src/main/resources/plugin-legacy.yml @@ -1,5 +1,5 @@ name: PetBlocks -version: 9.12.0 +version: 9.13.0 author: Shynixn main: com.github.shynixn.petblocks.PetBlocksPlugin softdepend: [ PlaceholderAPI, HeadDatabase] diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 6877c1cf4..cebf1c17e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: PetBlocks -version: 9.12.0 +version: 9.13.0 author: Shynixn main: com.github.shynixn.petblocks.PetBlocksPlugin softdepend: [ PlaceholderAPI, HeadDatabase]