thanks for being useless PhpStorm

these problems didn't show up in any inspections until I opened the fucking files...
This commit is contained in:
Dylan K. Taylor 2019-03-17 15:53:59 +00:00
parent 87928038e6
commit 6f54b53f7a
3 changed files with 4 additions and 4 deletions

View File

@ -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)));

View File

@ -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(""));
}
/**

View File

@ -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;
}