mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-21 16:09:21 +00:00
3.5.7
This commit is contained in:
@@ -8,7 +8,7 @@ plugins {
|
|||||||
allprojects {
|
allprojects {
|
||||||
|
|
||||||
project.group = "net.momirealms"
|
project.group = "net.momirealms"
|
||||||
project.version = "3.5.6"
|
project.version = "3.5.7"
|
||||||
|
|
||||||
apply<JavaPlugin>()
|
apply<JavaPlugin>()
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ dependencies {
|
|||||||
implementation("net.kyori:adventure-platform-bukkit:4.3.3")
|
implementation("net.kyori:adventure-platform-bukkit:4.3.3")
|
||||||
implementation("net.kyori:adventure-text-minimessage:4.17.0")
|
implementation("net.kyori:adventure-text-minimessage:4.17.0")
|
||||||
implementation("net.kyori:adventure-text-serializer-legacy: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.github.Xiao-MoMi:Sparrow-Heart:0.16")
|
||||||
implementation("com.flowpowered:flow-nbt:2.0.2")
|
implementation("com.flowpowered:flow-nbt:2.0.2")
|
||||||
implementation("com.saicone.rtag:rtag:1.5.4")
|
implementation("com.saicone.rtag:rtag:1.5.4")
|
||||||
|
|||||||
@@ -2660,6 +2660,9 @@ public class ItemManagerImpl implements ItemManager {
|
|||||||
Pot currentPot = getPotByBlock(block);
|
Pot currentPot = getPotByBlock(block);
|
||||||
if (currentPot != pot) {
|
if (currentPot != pot) {
|
||||||
plugin.getWorldManager().removePotAt(SimpleLocation.of(location));
|
plugin.getWorldManager().removePotAt(SimpleLocation.of(location));
|
||||||
|
if (currentPot != null) {
|
||||||
|
plugin.getWorldManager().addPotAt(new MemoryPot(SimpleLocation.of(location), currentPot.getKey()), SimpleLocation.of(location));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pot.isVanillaBlock()) {
|
if (pot.isVanillaBlock()) {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class ItemUtils {
|
|||||||
public static void increaseDurability(ItemStack itemStack, int amount) {
|
public static void increaseDurability(ItemStack itemStack, int amount) {
|
||||||
if (itemStack == null || itemStack.getType() == Material.AIR)
|
if (itemStack == null || itemStack.getType() == Material.AIR)
|
||||||
return;
|
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);
|
int damage = Math.max(item.damage().orElse(0) - amount, 0);
|
||||||
item.damage(damage);
|
item.damage(damage);
|
||||||
itemStack.setItemMeta(item.load().getItemMeta());
|
itemStack.setItemMeta(item.load().getItemMeta());
|
||||||
@@ -104,7 +104,7 @@ public class ItemUtils {
|
|||||||
if (Math.random() > (double) 1 / (unBreakingLevel + 1)) {
|
if (Math.random() > (double) 1 / (unBreakingLevel + 1)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Item<ItemStack> item = BukkitItemFactory.getInstance().wrap(itemStack);
|
Item<ItemStack> item = BukkitItemFactory.getInstance().wrap(itemStack.clone());
|
||||||
int damage = item.damage().orElse(0) + amount;
|
int damage = item.damage().orElse(0) + amount;
|
||||||
if (damage > item.maxDamage().orElse((int) itemStack.getType().getMaxDurability())) {
|
if (damage > item.maxDamage().orElse((int) itemStack.getType().getMaxDurability())) {
|
||||||
itemStack.setAmount(0);
|
itemStack.setAmount(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user