diff options
Diffstat (limited to 'patches/server/0869-Expand-PlayerItemMendEvent.patch')
-rw-r--r-- | patches/server/0869-Expand-PlayerItemMendEvent.patch | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/patches/server/0869-Expand-PlayerItemMendEvent.patch b/patches/server/0869-Expand-PlayerItemMendEvent.patch index e603155464..013c1be8fd 100644 --- a/patches/server/0869-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0869-Expand-PlayerItemMendEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand PlayerItemMendEvent diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index 36d5d1736bf826f3abc756277de431c94cabb744..e814b2ef2577f032d6760de2f798d4fe18c67d0c 100644 +index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704956c91b2 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -337,7 +337,7 @@ public class ExperienceOrb extends Entity { +@@ -338,7 +338,7 @@ public class ExperienceOrb extends Entity { ItemStack itemstack = (ItemStack) entry.getValue(); int j = Math.min(this.xpToDurability(amount), itemstack.getDamageValue()); // CraftBukkit start @@ -17,7 +17,7 @@ index 36d5d1736bf826f3abc756277de431c94cabb744..e814b2ef2577f032d6760de2f798d4fe j = event.getRepairAmount(); if (event.isCancelled()) { return amount; -@@ -345,8 +345,13 @@ public class ExperienceOrb extends Entity { +@@ -346,8 +346,13 @@ public class ExperienceOrb extends Entity { // CraftBukkit end itemstack.setDamageValue(itemstack.getDamageValue() - j); @@ -33,7 +33,7 @@ index 36d5d1736bf826f3abc756277de431c94cabb744..e814b2ef2577f032d6760de2f798d4fe return k > 0 ? this.repairPlayerItems(player, k) : 0; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 04e5be79348733f5a6a8b1968b6887379fa65027..c7e0aa94a8c1f821f723f323b69bacfd2d2d8aa3 100644 +index 4996776287c58039507ad2eda9d59e3fd13c08a8..e111017c3de7b374c702fed20a5e98557011ea06 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1757,11 +1757,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -43,7 +43,7 @@ index 04e5be79348733f5a6a8b1968b6887379fa65027..c7e0aa94a8c1f821f723f323b69bacfd - org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.getKey(), i); + org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.getKey(), i, orb::durabilityToXp); // Paper - Expand PlayerItemMendEvent i = event.getRepairAmount(); - orb.discard(); + orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); if (!event.isCancelled()) { - amount -= orb.durabilityToXp(i); + amount -= event.getDurabilityToXpOperation().applyAsInt(i); // Paper - Expand PlayerItemMendEvent @@ -51,10 +51,10 @@ index 04e5be79348733f5a6a8b1968b6887379fa65027..c7e0aa94a8c1f821f723f323b69bacfd } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e1d19207ba70e1ecc85af2ca4cfd6ed8c4d4a9e7..7934eea4ede9db90ad2a45a2a5ac64b264b2f91a 100644 +index 6c5908eecaaf2f2b41bc0074e183a2259fe4a9b2..52c1d39f494ba441bc93382d895679bcd15fcbde 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1270,10 +1270,10 @@ public class CraftEventFactory { +@@ -1271,10 +1271,10 @@ public class CraftEventFactory { return event; } |