summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityItem.patch
diff options
context:
space:
mode:
authorMorphan1 <morphanone@gmail.com>2015-06-26 05:55:33 -0400
committermd_5 <git@md-5.net>2015-07-12 19:57:38 +1000
commit2359f6fcb0190f8f4310e6174812df51743c2057 (patch)
treeb7585581e82c1b5621948261fae20a18b63d1832 /nms-patches/EntityItem.patch
parent8f9ff9f6fd494399022841ed9bd84101576d67b9 (diff)
downloadcraftbukkit-2359f6fcb0190f8f4310e6174812df51743c2057.tar
craftbukkit-2359f6fcb0190f8f4310e6174812df51743c2057.tar.gz
craftbukkit-2359f6fcb0190f8f4310e6174812df51743c2057.tar.lz
craftbukkit-2359f6fcb0190f8f4310e6174812df51743c2057.tar.xz
craftbukkit-2359f6fcb0190f8f4310e6174812df51743c2057.zip
Implement ItemMergeEvent
Diffstat (limited to 'nms-patches/EntityItem.patch')
-rw-r--r--nms-patches/EntityItem.patch14
1 files changed, 11 insertions, 3 deletions
diff --git a/nms-patches/EntityItem.patch b/nms-patches/EntityItem.patch
index bcc5bdca..dc984456 100644
--- a/nms-patches/EntityItem.patch
+++ b/nms-patches/EntityItem.patch
@@ -66,7 +66,15 @@
this.die();
}
-@@ -183,6 +202,11 @@
+@@ -137,6 +156,7 @@
+ } else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) {
+ return false;
+ } else {
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemMergeEvent(this, entityitem).isCancelled()) return false; // CraftBukkit
+ itemstack1.count += itemstack.count;
+ entityitem.pickupDelay = Math.max(entityitem.pickupDelay, this.pickupDelay);
+ entityitem.age = Math.min(entityitem.age, this.age);
+@@ -183,6 +203,11 @@
} else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) {
return false;
} else {
@@ -78,7 +86,7 @@
this.ac();
this.e = (int) ((float) this.e - f);
if (this.e <= 0) {
-@@ -228,7 +252,18 @@
+@@ -228,7 +253,18 @@
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
@@ -98,7 +106,7 @@
if (this.getItemStack() == null) {
this.die();
}
-@@ -240,6 +275,26 @@
+@@ -240,6 +276,26 @@
ItemStack itemstack = this.getItemStack();
int i = itemstack.count;