diff --git a/README.MD b/README.MD index cb338176b..8a47ca8e2 100644 --- a/README.MD +++ b/README.MD @@ -15,7 +15,7 @@ PetBlocks is a spigot plugin to use blocks and custom heads as pets in Minecraft * Use blocks as pets in minecraft * The GUI and pets are completely customizable -* Version support 1.8.R1 - 1.20.R4 +* Version support 1.8.R1 - 1.21.R1 * Check out the [PetBlocks-Spigot-Page](https://www.spigotmc.org/resources/12056/) to get more information. ## Installation diff --git a/build.gradle.kts b/build.gradle.kts index bf02ae99f..6c44cb38f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "com.github.shynixn" -version = "9.8.0" +version = "9.9.0" repositories { mavenCentral() @@ -46,8 +46,8 @@ dependencies { // Custom dependencies implementation("com.github.shynixn.shygui:shygui:1.0.0") - implementation("com.github.shynixn.mcutils:common:2024.16") - implementation("com.github.shynixn.mcutils:packet:2024.25") + implementation("com.github.shynixn.mcutils:common:2024.19") + implementation("com.github.shynixn.mcutils:packet:2024.30") implementation("com.github.shynixn.mcutils:database:2024.2") implementation("com.github.shynixn.mcutils:pathfinder:2024.3") implementation("com.github.shynixn.mcutils:guice:2024.2") @@ -135,6 +135,7 @@ tasks.register("pluginJarLatest", com.github.jengelman.gradle.plugins.shadow.tas exclude("com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_20_R1/**") exclude("com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_20_R2/**") exclude("com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_20_R3/**") + exclude("com/github/shynixn/petblocks/lib/com/github/shynixn/mcutils/packet/nms/v1_20_R4/**") exclude("com/github/shynixn/mcutils/**") exclude("com/github/shynixn/shygui/**") exclude("com/github/shynixn/mccoroutine/**") diff --git a/docs/wiki/docs/placeholders.md b/docs/wiki/docs/placeholders.md index b0c4492ab..b00e1dc07 100644 --- a/docs/wiki/docs/placeholders.md +++ b/docs/wiki/docs/placeholders.md @@ -55,3 +55,21 @@ The following placeholders are available in PetBlocks and can also be used via P | %petblocks_eventPlayer_locationYaw% | Yaw rotation of the event trigger player. | | %petblocks_eventPlayer_locationPitch% | Yaw rotation of the event trigger player. | | %petblocks_eventPlayer_itemMainHand_type% | Name of the item type in the players's main hand | + + +| GUI PlaceHolders | Description | +|-------------------------------------------|------------------------------------------------------------| +| %petblocks_player_name% | Player name of the player clicking in the current inventory. | +| %petblocks_player_displayName% | Player displayName of the player session in the current inventory. | +| %petblocks_gui_name% | Name of the current inventory. | +| %petblocks_gui_backName% | Name of the previous inventory (if you have multiple sub pages) | +| %petblocks_gui_param1% | A GUI can have up to 9 parameters. This placeholders access number 1. | +| %petblocks_gui_param2% | A GUI can have up to 9 parameters. This placeholders access number 2. | +| %petblocks_gui_param3% | A GUI can have up to 9 parameters. This placeholders access number 3. | +| %petblocks_gui_param4% | A GUI can have up to 9 parameters. This placeholders access number 4. | +| %petblocks_gui_param5% | A GUI can have up to 9 parameters. This placeholders access number 5. | +| %petblocks_gui_param6% | A GUI can have up to 9 parameters. This placeholders access number 6. | +| %petblocks_gui_param7% | A GUI can have up to 9 parameters. This placeholders access number 7. | +| %petblocks_gui_param8% | A GUI can have up to 9 parameters. This placeholders access number 8. | +| %petblocks_gui_param9% | A GUI can have up to 9 parameters. This placeholders access number 9. | + diff --git a/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt b/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt index e385f3016..6730a7f18 100644 --- a/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt +++ b/src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt @@ -74,9 +74,10 @@ class PetBlocksPlugin : JavaPlugin() { Version.VERSION_1_20_R2, Version.VERSION_1_20_R3, Version.VERSION_1_20_R4, + Version.VERSION_1_21_R1, ) } else { - listOf(Version.VERSION_1_20_R4) + listOf(Version.VERSION_1_21_R1) } if (!Version.serverVersion.isCompatible(*versions.toTypedArray())) { diff --git a/src/main/java/com/github/shynixn/petblocks/impl/listener/PetListener.kt b/src/main/java/com/github/shynixn/petblocks/impl/listener/PetListener.kt index 5fa19da09..9cc1e86e0 100644 --- a/src/main/java/com/github/shynixn/petblocks/impl/listener/PetListener.kt +++ b/src/main/java/com/github/shynixn/petblocks/impl/listener/PetListener.kt @@ -45,7 +45,7 @@ class PetListener @Inject constructor( val pets = petService.getPetsFromPlayer(player) if (pets.isNotEmpty()) { - plugin.logger.log(Level.FINE,"Loaded [${pets.size}] pets for player ${player.name}.") + plugin.logger.log(Level.FINE, "Loaded [${pets.size}] pets for player ${player.name}.") } val petsToReceive = configurationService.findValue>>(petsToReceiveOnJoinKey) @@ -108,11 +108,12 @@ class PetListener @Inject constructor( if (packet is PacketInInteractEntity) { plugin.launch { - val physicObject = physicObjectService.findPhysicObjectById(packet.entityId) as PetEntityImpl? ?: return@launch + val physicObject = + physicObjectService.findPhysicObjectById(packet.entityId) as PetEntityImpl? ?: return@launch - if (packet.actionType == InteractionType.LEFT_CLICK) { + if (packet.actionType == InteractionType.ATTACK) { physicObject.leftClick(event.player) - } else if (packet.actionType == InteractionType.OTHER) { + } else { physicObject.rightClick(event.player) } } diff --git a/src/main/resources/gui/petblocks_main_menu.yml b/src/main/resources/gui/petblocks_main_menu.yml index b2dbffbc4..8c549a62d 100644 --- a/src/main/resources/gui/petblocks_main_menu.yml +++ b/src/main/resources/gui/petblocks_main_menu.yml @@ -176,7 +176,7 @@ items: - type: "PER_PLAYER" command: "/petblocksgui close" - type: "SERVER_PER_PLAYER" - command: '/tellraw Shynixn {"text":"","extra":[{"text":"[&9PetBlocks&f] &e<> &fto rename your pet.","clickEvent":{"action":"suggest_command","value":"/petblocks rename %petblocks_pet_name_selected% "}}]}' + command: '/tellraw %petblocks_player_name% {"text":"","extra":[{"text":"[&9PetBlocks&f] &e<> &fto rename your pet.","clickEvent":{"action":"suggest_command","value":"/petblocks rename %petblocks_pet_name_selected% "}}]}' - row: 2 col: 2 item: diff --git a/src/main/resources/gui/petblocks_skins_plushieskins_menu.yml b/src/main/resources/gui/petblocks_skins_plushieskins_menu.yml index 3e5df1b25..6bc79dc3a 100644 --- a/src/main/resources/gui/petblocks_skins_plushieskins_menu.yml +++ b/src/main/resources/gui/petblocks_skins_plushieskins_menu.yml @@ -56,7 +56,7 @@ items: displayName: "&eSteve Plushie 1" commands: - type: "SERVER_PER_PLAYER" - command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgzNWRhMjY4NWY3YWQzZjE5MTlhMDE4OTc2YWQ1NjgyNjY5MWUyNjc1OGEzYTU1YTE5MThmN2YxN2FkOTM4In19fQ= %petblocks_owner_name%" + command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzgzNWRhMjY4NWY3YWQzZjE5MTlhMDE4OTc2YWQ1NjgyNjY5MWUyNjc1OGEzYTU1YTE5MThmN2YxN2FkOTM4In19fQ== %petblocks_owner_name%" - row: 2 col: 2 item: @@ -66,7 +66,7 @@ items: displayName: "&eAlex Plushie 1" commands: - type: "SERVER_PER_PLAYER" - command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzFjZDI3NjJhY2I0YjQyNzhjZjExMTc2YTVmODc3OTlmOTNhMWQ5MTE2Y2IzY2I1N2VlNGQxZTYwMTM0NTg4In19fQ= %petblocks_owner_name%" + command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzFjZDI3NjJhY2I0YjQyNzhjZjExMTc2YTVmODc3OTlmOTNhMWQ5MTE2Y2IzY2I1N2VlNGQxZTYwMTM0NTg4In19fQ== %petblocks_owner_name%" - row: 2 col: 3 item: @@ -96,7 +96,7 @@ items: displayName: "&5Baby Doll (purple)" commands: - type: "SERVER_PER_PLAYER" - command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTJhYjYyNmRiYjc2NTg0NTk3YjU5MDZlZTY5OWVhOTNlNTFkMTc0ZWM2YTIxZWQ5ZjRjMTlmNWU3ZWJmOTM2In19fQ= %petblocks_owner_name%" + command: "/petblocks skinbase64 %petblocks_pet_name_selected% eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTJhYjYyNmRiYjc2NTg0NTk3YjU5MDZlZTY5OWVhOTNlNTFkMTc0ZWM2YTIxZWQ5ZjRjMTlmNWU3ZWJmOTM2In19fQ== %petblocks_owner_name%" - row: 2 col: 6 item: diff --git a/src/main/resources/plugin-legacy.yml b/src/main/resources/plugin-legacy.yml index 53d18f2d3..3fe017b7b 100644 --- a/src/main/resources/plugin-legacy.yml +++ b/src/main/resources/plugin-legacy.yml @@ -1,5 +1,5 @@ name: PetBlocks -version: 9.8.0 +version: 9.9.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 5931bce57..fe3dfc91d 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: PetBlocks -version: 9.8.0 +version: 9.9.0 author: Shynixn main: com.github.shynixn.petblocks.PetBlocksPlugin softdepend: [ PlaceholderAPI, HeadDatabase]