mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
creative & survival hotbar bugfix
This commit is contained in:
parent
4c7b172cbe
commit
0f04f4bc8a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user