9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-19 15:09:25 +00:00
This commit is contained in:
XiaoMoMi
2024-07-09 23:27:17 +08:00
parent f79948ecae
commit 64e49dbdeb
4 changed files with 7 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ plugins {
allprojects {
project.group = "net.momirealms"
project.version = "3.5.6"
project.version = "3.5.7"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -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")

View File

@@ -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()) {

View File

@@ -85,7 +85,7 @@ public class ItemUtils {
public static void increaseDurability(ItemStack itemStack, int amount) {
if (itemStack == null || itemStack.getType() == Material.AIR)
return;
Item<ItemStack> item = BukkitItemFactory.getInstance().wrap(itemStack);
Item<ItemStack> 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<ItemStack> item = BukkitItemFactory.getInstance().wrap(itemStack);
Item<ItemStack> 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);