mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fixed PlayerInventory->setItem() with null items
This commit is contained in:
parent
d63a82de0a
commit
fd954ce708
@ -202,8 +202,8 @@ class PlayerInventory extends BaseInventory{
|
||||
public function setItem($index, Item $item, $source = null){
|
||||
if($index < 0 or $index >= $this->size){
|
||||
return false;
|
||||
}elseif($item->getID() === 0){
|
||||
$this->clear($index, $source);
|
||||
}elseif($item->getID() === 0 or $item->getCount() <= 0){
|
||||
return $this->clear($index, $source);
|
||||
}
|
||||
|
||||
if($index >= $this->getSize()){ //Armor change
|
||||
|
Loading…
x
Reference in New Issue
Block a user