diff --git a/build.gradle.kts b/build.gradle.kts index 2237f13..0b14283 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { allprojects { project.group = "net.momirealms" - project.version = "3.5.6" + project.version = "3.5.7" apply() apply(plugin = "java") diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 82cca66..dcfe4ed 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -57,7 +57,7 @@ dependencies { implementation("net.kyori:adventure-platform-bukkit:4.3.3") implementation("net.kyori:adventure-text-minimessage:4.17.0") implementation("net.kyori:adventure-text-serializer-legacy:4.17.0") - implementation("com.github.Xiao-MoMi:AntiGriefLib:0.11") + implementation("com.github.Xiao-MoMi:AntiGriefLib:0.12") // implementation("com.github.Xiao-MoMi:Sparrow-Heart:0.16") implementation("com.flowpowered:flow-nbt:2.0.2") implementation("com.saicone.rtag:rtag:1.5.4") diff --git a/plugin/src/main/java/net/momirealms/customcrops/mechanic/item/ItemManagerImpl.java b/plugin/src/main/java/net/momirealms/customcrops/mechanic/item/ItemManagerImpl.java index 5ff8b4f..0472a93 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/mechanic/item/ItemManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customcrops/mechanic/item/ItemManagerImpl.java @@ -2660,6 +2660,9 @@ public class ItemManagerImpl implements ItemManager { Pot currentPot = getPotByBlock(block); if (currentPot != pot) { plugin.getWorldManager().removePotAt(SimpleLocation.of(location)); + if (currentPot != null) { + plugin.getWorldManager().addPotAt(new MemoryPot(SimpleLocation.of(location), currentPot.getKey()), SimpleLocation.of(location)); + } return; } if (pot.isVanillaBlock()) { diff --git a/plugin/src/main/java/net/momirealms/customcrops/util/ItemUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/ItemUtils.java index 89cfed4..eb8e504 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/util/ItemUtils.java +++ b/plugin/src/main/java/net/momirealms/customcrops/util/ItemUtils.java @@ -85,7 +85,7 @@ public class ItemUtils { public static void increaseDurability(ItemStack itemStack, int amount) { if (itemStack == null || itemStack.getType() == Material.AIR) return; - Item item = BukkitItemFactory.getInstance().wrap(itemStack); + Item item = BukkitItemFactory.getInstance().wrap(itemStack.clone()); int damage = Math.max(item.damage().orElse(0) - amount, 0); item.damage(damage); itemStack.setItemMeta(item.load().getItemMeta()); @@ -104,7 +104,7 @@ public class ItemUtils { if (Math.random() > (double) 1 / (unBreakingLevel + 1)) { return; } - Item item = BukkitItemFactory.getInstance().wrap(itemStack); + Item item = BukkitItemFactory.getInstance().wrap(itemStack.clone()); int damage = item.damage().orElse(0) + amount; if (damage > item.maxDamage().orElse((int) itemStack.getType().getMaxDurability())) { itemStack.setAmount(0);