From b2fd1fcbe13885c43c4120c42e01ec2dc994a8e8 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 10 Jan 2020 09:50:39 +1100 Subject: [PATCH] SPIGOT-5504: cancelling InventoryMoveItemEvent on composter doesn't properly cancel By: md_5 --- paper-server/nms-patches/BlockComposter.patch | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/paper-server/nms-patches/BlockComposter.patch b/paper-server/nms-patches/BlockComposter.patch index 40a299aef3..b5fc538b14 100644 --- a/paper-server/nms-patches/BlockComposter.patch +++ b/paper-server/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 {