mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Check inventory slot is in range in SlotChangeAction
This commit is contained in:
parent
88318d740a
commit
98ac6fc7be
@ -75,8 +75,11 @@ class SlotChangeAction extends InventoryAction{
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isValid(Player $source) : bool{
|
public function isValid(Player $source) : bool{
|
||||||
$check = $this->inventory->getItem($this->inventorySlot);
|
return (
|
||||||
return $check->equalsExact($this->sourceItem);
|
$this->inventorySlot >= 0 and
|
||||||
|
$this->inventorySlot < $this->inventory->getSize() and
|
||||||
|
$this->inventory->getItem($this->inventorySlot)->equalsExact($this->sourceItem)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user