summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-01-26 14:08:04 +1100
committermd_5 <git@md-5.net>2017-01-26 14:08:04 +1100
commit16b5116c7c528a99a4270324fa05133852ff6bf4 (patch)
tree06836a9e0acf157c514fc51e7e4de9ba74592178
parentdbf4ecf30f92708c124aadd08461a4b8a88c7e2f (diff)
downloadcraftbukkit-16b5116c7c528a99a4270324fa05133852ff6bf4.tar
craftbukkit-16b5116c7c528a99a4270324fa05133852ff6bf4.tar.gz
craftbukkit-16b5116c7c528a99a4270324fa05133852ff6bf4.tar.lz
craftbukkit-16b5116c7c528a99a4270324fa05133852ff6bf4.tar.xz
craftbukkit-16b5116c7c528a99a4270324fa05133852ff6bf4.zip
SPIGOT-3033: Alter behaviour of cancelled hopper transfers (reverted from commit 334aa07e2fcadf347afa38196fd3ab09ca4dc3a7)
-rw-r--r--nms-patches/TileEntityHopper.patch9
1 files changed, 5 insertions, 4 deletions
diff --git a/nms-patches/TileEntityHopper.patch b/nms-patches/TileEntityHopper.patch
index 2925a495..9393ad7a 100644
--- a/nms-patches/TileEntityHopper.patch
+++ b/nms-patches/TileEntityHopper.patch
@@ -56,7 +56,7 @@
}
public void F_() {
-@@ -163,10 +197,34 @@
+@@ -163,10 +197,35 @@
for (int i = 0; i < this.getSize(); ++i) {
if (!this.getItem(i).isEmpty()) {
ItemStack itemstack = this.getItem(i).cloneItemStack();
@@ -78,7 +78,8 @@
+ this.getWorld().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ this.setItem(i, itemstack);
-+ continue;
++ this.setCooldown(8); // Delay hopper checks
++ return false;
+ }
+ ItemStack itemstack1 = addItem(this, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection);
@@ -93,7 +94,7 @@
return true;
}
-@@ -288,10 +346,41 @@
+@@ -288,10 +347,41 @@
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -137,7 +138,7 @@
return true;
}
-@@ -307,6 +396,13 @@
+@@ -307,6 +397,13 @@
if (entityitem == null) {
return false;
} else {