mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
InGamePacketHandler: added an extra check
This commit is contained in:
parent
b744e09352
commit
47f0119660
@ -869,8 +869,12 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
public function handleBookEdit(BookEditPacket $packet) : bool{
|
||||
$inventory = $this->player->getInventory();
|
||||
if(!$inventory->slotExists($packet->inventorySlot)){
|
||||
return false;
|
||||
}
|
||||
//TODO: break this up into book API things
|
||||
$oldBook = $this->player->getInventory()->getItem($packet->inventorySlot);
|
||||
$oldBook = $inventory->getItem($packet->inventorySlot);
|
||||
if(!($oldBook instanceof WritableBook)){
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user