Tile: make saveNBT() return a CompoundTag

I don't know why I made it take a parameter for this...
This commit is contained in:
Dylan K. Taylor
2018-06-16 17:59:41 +01:00
parent 9f7f62e9e5
commit f315aca4c3
4 changed files with 7 additions and 7 deletions

View File

@ -181,12 +181,15 @@ abstract class Tile extends Position{
*/
abstract protected function writeSaveData(CompoundTag $nbt) : void;
public function saveNBT(CompoundTag $nbt) : void{
public function saveNBT() : CompoundTag{
$nbt = new CompoundTag();
$nbt->setString(self::TAG_ID, static::getSaveId());
$nbt->setInt(self::TAG_X, $this->x);
$nbt->setInt(self::TAG_Y, $this->y);
$nbt->setInt(self::TAG_Z, $this->z);
$this->writeSaveData($nbt);
return $nbt;
}
public function getCleanedNBT() : ?CompoundTag{