From a7f1e7efd564a20dc22704024a20f6f54012151d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 24 Jul 2014 22:29:15 -0500 Subject: [PATCH] Fix PlayerItemDamageEvent Hopefully a temporary patch as I've already submitted it to SpigotMC But I kinda wanna use the event now so... Here we are --- .../0031-Fix-PlayerItemDamageEvent.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch diff --git a/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch b/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch new file mode 100644 index 000000000..8de0124dc --- /dev/null +++ b/Spigot-Server-Patches/0031-Fix-PlayerItemDamageEvent.patch @@ -0,0 +1,23 @@ +From b8f93f43ea39ca1be0f96207995bee00ead425eb Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Thu, 24 Jul 2014 22:23:38 -0500 +Subject: [PATCH] Fix PlayerItemDamageEvent + +Taken from SpigotMC/Spigot PR#202 + +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index 2723ccb..569b2e3 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -328,7 +328,7 @@ public final class ItemStack { + public void damage(int i, EntityLiving entityliving) { + if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) { + if (this.g()) { +- if (this.isDamaged(i, entityliving.aI())) { ++ if (this.isDamaged(i, entityliving.aI(), entityliving)) { + entityliving.a(this); + --this.count; + if (entityliving instanceof EntityHuman) { +-- +1.9.1 +