summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityExperienceOrb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityExperienceOrb.patch')
-rw-r--r--nms-patches/EntityExperienceOrb.patch20
1 files changed, 17 insertions, 3 deletions
diff --git a/nms-patches/EntityExperienceOrb.patch b/nms-patches/EntityExperienceOrb.patch
index 24aa1aba..bd249662 100644
--- a/nms-patches/EntityExperienceOrb.patch
+++ b/nms-patches/EntityExperienceOrb.patch
@@ -46,8 +46,22 @@
}
this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ);
-@@ -153,7 +172,7 @@
- }
+@@ -148,12 +167,18 @@
+ if (!itemstack.isEmpty() && itemstack.h()) {
+ int i = Math.min(this.d(this.value), itemstack.i());
+
+- this.value -= this.c(i);
+- itemstack.setData(itemstack.i() - i);
+- }
++ // CraftBukkit start
++ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(entityhuman, this, itemstack, i);
++ i = event.getRepairAmount();
++ if (!event.isCancelled()) {
++ this.value -= this.c(i);
++ itemstack.setData(itemstack.i() - i);
++ }
++ // CraftBukkit end
++ }
if (this.value > 0) {
- entityhuman.giveExp(this.value);
@@ -55,7 +69,7 @@
}
this.die();
-@@ -175,6 +194,24 @@
+@@ -175,6 +200,24 @@
}
public static int getOrbValue(int i) {