From 7fdfe947b074d39d1806772987c1c2a43e6bb609 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 2 Dec 2019 20:15:22 +0000 Subject: [PATCH] inventory: fix some transactions being rejected for no good reason since 1.13, transactions such as interacting with creative inventory cause a spoof windowID 124 slot 50 action to appear which changes air -> air. This currently gets rejected because only cursor is mapped to ID 124, and it only has a single slot. It is not clear what the purpose of 124:50 is, but this fix filters out any actions which do not change anything, since they won't affect transaction balance anyway. --- .../network/mcpe/protocol/types/NetworkInventoryAction.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pocketmine/network/mcpe/protocol/types/NetworkInventoryAction.php b/src/pocketmine/network/mcpe/protocol/types/NetworkInventoryAction.php index abe15d8b8..ecd9eff5d 100644 --- a/src/pocketmine/network/mcpe/protocol/types/NetworkInventoryAction.php +++ b/src/pocketmine/network/mcpe/protocol/types/NetworkInventoryAction.php @@ -167,6 +167,10 @@ class NetworkInventoryAction{ * @throws \UnexpectedValueException */ public function createInventoryAction(Player $player){ + if($this->oldItem->equalsExact($this->newItem)){ + //filter out useless noise in 1.13 + return null; + } switch($this->sourceType){ case self::SOURCE_CONTAINER: $window = $player->getWindow($this->windowId);