From 334aa07e2fcadf347afa38196fd3ab09ca4dc3a7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 26 Jan 2017 11:13:00 +1100 Subject: [PATCH] SPIGOT-3033: Alter behaviour of cancelled hopper transfers --- nms-patches/TileEntityHopper.patch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nms-patches/TileEntityHopper.patch b/nms-patches/TileEntityHopper.patch index 9393ad7afa..2925a4957b 100644 --- a/nms-patches/TileEntityHopper.patch +++ b/nms-patches/TileEntityHopper.patch @@ -56,7 +56,7 @@ } public void F_() { -@@ -163,10 +197,35 @@ +@@ -163,10 +197,34 @@ for (int i = 0; i < this.getSize(); ++i) { if (!this.getItem(i).isEmpty()) { ItemStack itemstack = this.getItem(i).cloneItemStack(); @@ -78,8 +78,7 @@ + this.getWorld().getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setItem(i, itemstack); -+ this.setCooldown(8); // Delay hopper checks -+ return false; ++ continue; + } + ItemStack itemstack1 = addItem(this, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection); @@ -94,7 +93,7 @@ return true; } -@@ -288,10 +347,41 @@ +@@ -288,10 +346,41 @@ if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) { ItemStack itemstack1 = itemstack.cloneItemStack(); @@ -138,7 +137,7 @@ return true; } -@@ -307,6 +397,13 @@ +@@ -307,6 +396,13 @@ if (entityitem == null) { return false; } else {