mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Use Item->isNull() more
This commit is contained in:
@ -45,7 +45,7 @@ class ItemFrame extends Spawnable{
|
||||
}
|
||||
|
||||
public function hasItem() : bool{
|
||||
return $this->getItem()->getId() !== Item::AIR;
|
||||
return !$this->getItem()->isNull();
|
||||
}
|
||||
|
||||
public function getItem() : Item{
|
||||
@ -57,7 +57,7 @@ class ItemFrame extends Spawnable{
|
||||
}
|
||||
|
||||
public function setItem(Item $item = null){
|
||||
if($item !== null and $item->getId() !== Item::AIR){
|
||||
if($item !== null and !$item->isNull()){
|
||||
$this->namedtag->Item = $item->nbtSerialize(-1, "Item");
|
||||
}else{
|
||||
unset($this->namedtag->Item);
|
||||
|
Reference in New Issue
Block a user