From e66197036dd9cf2e7712dad1af8fa578f2830862 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 25 Jan 2020 18:10:37 +0000 Subject: [PATCH] InGamePacketHandler: drop transactions with 0 actions without trying to execute them often we throw out actions that have no value, which can lead to an empty transaction and re-syncing the inventory. This happens every time we interact with the creative inventory in 1.13+, which causes items to appear to vanish when taking them from the creative menu. The correct fix for this is to resend only the slots affected by SlotChangeActions, but this fix will suffice for now without rewriting everything. --- src/network/mcpe/handler/InGamePacketHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index ca443c2895..e3632fd66b 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -260,6 +260,11 @@ class InGamePacketHandler extends PacketHandler{ return false; } + if(count($actions) === 0){ + //TODO: 1.13+ often sends transactions with nothing but useless crap in them, no need for the debug noise + return true; + } + $transaction = new InventoryTransaction($this->player, $actions); try{ $transaction->execute();