From 44f1dedbf866f0f200d68a3789e3672c430150dc Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 6 Aug 2017 21:16:08 +0100 Subject: [PATCH] Give creative players carte blanche Close #879, close #431 This will be solved properly in 1.2 when creative transactions are actually trackable. For now... HACK! --- .../inventory/SimpleTransactionGroup.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/pocketmine/inventory/SimpleTransactionGroup.php b/src/pocketmine/inventory/SimpleTransactionGroup.php index fd7a4d221..f2947b7ad 100644 --- a/src/pocketmine/inventory/SimpleTransactionGroup.php +++ b/src/pocketmine/inventory/SimpleTransactionGroup.php @@ -139,21 +139,7 @@ class SimpleTransactionGroup implements TransactionGroup{ $haveItems = []; $needItems = []; - if($this->matchItems($needItems, $haveItems) and count($this->transactions) > 0){ - if(count($haveItems) === 0 and count($needItems) === 0){ - return true; - }elseif($this->source->isCreative(true) and count($needItems) > 0){ //Added items from creative inventory - foreach($needItems as $item){ - if(Item::getCreativeItemIndex($item) === -1 and $item->getId() !== Item::AIR){ - return false; - } - } - - return true; - } - } - - return false; + return $this->matchItems($needItems, $haveItems) and count($this->transactions) > 0 and ((count($haveItems) === 0 and count($needItems) === 0) or $this->source->isCreative(true)); } /**