From 6f54b53f7adb9bdd3ccc7119c68f600526bf67e4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 17 Mar 2019 15:53:59 +0000 Subject: [PATCH] thanks for being useless PhpStorm these problems didn't show up in any inspections until I opened the fucking files... --- src/pocketmine/entity/Entity.php | 2 +- src/pocketmine/item/Item.php | 2 +- src/pocketmine/tile/Tile.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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; }