From 99cf10e4c72361f8687a51516f0e5e66797f7bb9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Jan 2020 09:50:39 +1100 Subject: [PATCH] SPIGOT-5504: cancelling InventoryMoveItemEvent on composter doesn't properly cancel --- nms-patches/BlockComposter.patch | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nms-patches/BlockComposter.patch b/nms-patches/BlockComposter.patch index 40a299aef3..b5fc538b14 100644 --- a/nms-patches/BlockComposter.patch +++ b/nms-patches/BlockComposter.patch @@ -42,7 +42,23 @@ } @Override -@@ -313,8 +317,9 @@ +@@ -306,15 +310,23 @@ + + @Override + public void update() { +- BlockComposter.d(this.a, this.b, this.c); +- this.d = true; ++ // CraftBukkit start - allow putting items back (eg cancelled InventoryMoveItemEvent) ++ if (this.isNotEmpty()) { ++ BlockComposter.d(this.a, this.b, this.c); ++ this.d = true; ++ } else { ++ this.b.setTypeAndData(this.c, this.a, 3); ++ this.d = false; ++ } ++ // CraftBukkit end + } + } static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {