From 2dc3cf81621cc427279716fd0e99a48b67f14e75 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 31 May 2020 20:10:29 +0100 Subject: [PATCH] InventoryTransaction: sync inventories before throwing validation exception to caller fixes #3226 really the transaction shouldn't be handling inventory sync at all, but that's a job for another commit. --- .../inventory/transaction/InventoryTransaction.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/inventory/transaction/InventoryTransaction.php b/src/pocketmine/inventory/transaction/InventoryTransaction.php index 75a37aced..76c536021 100644 --- a/src/pocketmine/inventory/transaction/InventoryTransaction.php +++ b/src/pocketmine/inventory/transaction/InventoryTransaction.php @@ -293,7 +293,12 @@ class InventoryTransaction{ $this->shuffleActions(); - $this->validate(); + try{ + $this->validate(); + }catch(TransactionValidationException $e){ + $this->sendInventories(); + throw $e; + } if(!$this->callExecuteEvent()){ $this->sendInventories();