mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Use Item->isNull() more
This commit is contained in:
@ -226,7 +226,7 @@ abstract class BaseInventory implements Inventory{
|
||||
if(($diff = $slot->getMaxStackSize() - $slot->getCount()) > 0){
|
||||
$item->setCount($item->getCount() - $diff);
|
||||
}
|
||||
}elseif($slot->getId() === Item::AIR){
|
||||
}elseif($slot->isNull()){
|
||||
$item->setCount($item->getCount() - $this->getMaxStackSize());
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ abstract class BaseInventory implements Inventory{
|
||||
|
||||
for($i = 0; $i < $this->getSize(); ++$i){
|
||||
$item = $this->getItem($i);
|
||||
if($item->getId() === Item::AIR or $item->getCount() <= 0){
|
||||
if($item->isNull()){
|
||||
$emptySlots[] = $i;
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ abstract class BaseInventory implements Inventory{
|
||||
|
||||
for($i = 0; $i < $this->getSize(); ++$i){
|
||||
$item = $this->getItem($i);
|
||||
if($item->getId() === Item::AIR or $item->getCount() <= 0){
|
||||
if($item->isNull()){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user