diff --git a/build.gradle.kts b/build.gradle.kts index f0b4b13..dcbef25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { } group = "net.azisaba" -version = "1.20.2+6.16.6a" +version = "1.20.2+6.16.7" java { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) diff --git a/src/main/java/com/github/mori01231/lifecore/command/TownServerCommand.kt b/src/main/java/com/github/mori01231/lifecore/command/TownServerCommand.kt index b551d0d..019173b 100644 --- a/src/main/java/com/github/mori01231/lifecore/command/TownServerCommand.kt +++ b/src/main/java/com/github/mori01231/lifecore/command/TownServerCommand.kt @@ -11,11 +11,16 @@ class TownServerCommand(private val plugin: LifeCore) : TransferCommand(plugin, override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array): Boolean { val player = sender as? Player ?: return false if (plugin.config.getBoolean("enable-backup-item-tag", true)) { - val size = player.inventory.size - for (i in 0.. { @@ -61,10 +65,14 @@ public void onPlayerJoin(PlayerJoinEvent e) { // restore item tags if (plugin.getConfig().getBoolean("enable-backup-item-tag", true)) { - int size = player.getInventory().getSize(); - for (int i = 0; i < size; i++) { + int inventorySize = player.getInventory().getSize(); + for (int i = 0; i < inventorySize; i++) { player.getInventory().setItem(i, ItemUtil.restoreTag(player.getInventory().getItem(i))); } + int enderSize = player.getEnderChest().getSize(); + for (int i = 0; i < enderSize; i++) { + player.getEnderChest().setItem(i, ItemUtil.restoreTag(player.getEnderChest().getItem(i))); + } } }, 20 * 10); // 10 seconds }