mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
More use of Item->isNull()
This commit is contained in:
parent
c47f1f572c
commit
4b63a22f8c
@ -242,7 +242,7 @@ abstract class BaseInventory implements Inventory{
|
||||
/** @var Item[] $slots */
|
||||
$itemSlots = [];
|
||||
foreach($slots as $slot){
|
||||
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
||||
if(!$slot->isNull()){
|
||||
$itemSlots[] = clone $slot;
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ abstract class BaseInventory implements Inventory{
|
||||
/** @var Item[] $slots */
|
||||
$itemSlots = [];
|
||||
foreach($slots as $slot){
|
||||
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
||||
if(!$slot->isNull()){
|
||||
$itemSlots[] = clone $slot;
|
||||
}
|
||||
}
|
||||
|
@ -1519,7 +1519,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$itemTag = $item->nbtSerialize();
|
||||
$itemTag->setName("Item");
|
||||
|
||||
if($item->getId() > 0 and $item->getCount() > 0){
|
||||
if(!$item->isNull()){
|
||||
$itemEntity = Entity::createEntity("Item", $this, new CompoundTag("", [
|
||||
new ListTag("Pos", [
|
||||
new DoubleTag("", $source->getX()),
|
||||
@ -1682,7 +1682,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
if($player === null or $player->isSurvival()){
|
||||
foreach($drops as $drop){
|
||||
if($drop->getCount() > 0){
|
||||
if(!$drop->isNull()){
|
||||
$this->dropItem($vector->add(0.5, 0.5, 0.5), $drop);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user