mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
ItemEntity: disable saving if the contained item is air or has a zero count
This commit is contained in:
@ -186,6 +186,10 @@ class ItemEntity extends Entity{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function canSaveWithChunk() : bool{
|
||||||
|
return !$this->item->isNull();
|
||||||
|
}
|
||||||
|
|
||||||
public function saveNBT() : CompoundTag{
|
public function saveNBT() : CompoundTag{
|
||||||
$nbt = parent::saveNBT();
|
$nbt = parent::saveNBT();
|
||||||
$nbt->setTag("Item", $this->item->nbtSerialize());
|
$nbt->setTag("Item", $this->item->nbtSerialize());
|
||||||
|
Reference in New Issue
Block a user