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