From 0f04f4bc8a278a0c61b7c41d33b5a29068e07aaa Mon Sep 17 00:00:00 2001 From: Yosshi999 Date: Sun, 17 Aug 2014 21:55:31 +0900 Subject: [PATCH] creative & survival hotbar bugfix --- src/pocketmine/Player.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index e649e0048..210c967b7 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1891,7 +1891,15 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ if($packet->slot > $this->inventory->getSize()){ break; } - $this->inventory->setHeldItemSlot($packet->slot); + if(($this->gamemode & 0x01) === Player::CREATIVE){ + if($this->getCreativeBlock($packet->item) !== -1){ + $this->inventory->setItem($packet->slot,$packet->item); + $this->inventory->setHotbarSlotIndex($packet->slot,$packet->slot); //links $hotbar[$packet->slot] to $slots[$packet->slot] + } + } + else{ + $this->inventory->setHeldItemSlot($packet->slot); + } $transaction = new BaseTransaction($this->inventory, $packet->slot, $this->inventory->getItem($packet->slot), $packet->item); }elseif(isset($this->windowIndex[$packet->windowid])){ $this->craftingType = 0;