diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 49014c463..7e62b59fd 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -715,7 +715,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } public function saveNBT() : CompoundTag{ - $nbt = new CompoundTag(); + $nbt = new CompoundTag(""); if(!($this instanceof Player)){ $nbt->setString("id", EntityFactory::getSaveId(get_class($this))); diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index eeb7a92a3..ea17e6978 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -518,7 +518,7 @@ class Item implements ItemIds, \JsonSerializable{ * @return CompoundTag */ public function getNamedTag() : CompoundTag{ - return $this->nbt ?? ($this->nbt = new CompoundTag()); + return $this->nbt ?? ($this->nbt = new CompoundTag("")); } /** diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/tile/Tile.php index 963129dfb..4cadd2b51 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/tile/Tile.php @@ -72,7 +72,7 @@ abstract class Tile extends Position{ abstract protected function writeSaveData(CompoundTag $nbt) : void; public function saveNBT() : CompoundTag{ - $nbt = new CompoundTag(); + $nbt = new CompoundTag(""); $nbt->setString(self::TAG_ID, TileFactory::getSaveId(get_class($this))); $nbt->setInt(self::TAG_X, $this->x); $nbt->setInt(self::TAG_Y, $this->y); @@ -83,7 +83,7 @@ abstract class Tile extends Position{ } public function getCleanedNBT() : ?CompoundTag{ - $this->writeSaveData($tag = new CompoundTag()); + $this->writeSaveData($tag = new CompoundTag("")); return $tag->getCount() > 0 ? $tag : null; }