mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
fix stupid bug in PlayerInventory
This commit is contained in:
parent
846e3b6f1e
commit
31e2c1d26c
@ -112,9 +112,9 @@ class PlayerInventory extends BaseInventory{
|
|||||||
*/
|
*/
|
||||||
public function setHotbarSlotIndex($hotbarSlot, $inventorySlot){
|
public function setHotbarSlotIndex($hotbarSlot, $inventorySlot){
|
||||||
if($hotbarSlot < 0 or $hotbarSlot >= $this->getHotbarSize()){
|
if($hotbarSlot < 0 or $hotbarSlot >= $this->getHotbarSize()){
|
||||||
throw new \InvalidArgumentException("Hotbar slot index \"$index\" is out of range");
|
throw new \InvalidArgumentException("Hotbar slot index \"$hotbarSlot\" is out of range");
|
||||||
}elseif($inventorySlot < -1 or $inventorySlot >= $this->getSize()){
|
}elseif($inventorySlot < -1 or $inventorySlot >= $this->getSize()){
|
||||||
throw new \InvalidArgumentException("Inventory slot index \"$index\" is out of range");
|
throw new \InvalidArgumentException("Inventory slot index \"$inventorySlot\" is out of range");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($inventorySlot !== -1 and ($alreadyEquippedIndex = array_search($inventorySlot, $this->hotbar)) !== false){
|
if($inventorySlot !== -1 and ($alreadyEquippedIndex = array_search($inventorySlot, $this->hotbar)) !== false){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user