Tile: call parent constructor instead of duping code

This commit is contained in:
Dylan K. Taylor 2018-05-18 16:49:14 +01:00
parent d8dc89e7c8
commit febba6e3a6

View File

@ -157,13 +157,10 @@ abstract class Tile extends Position{
$this->namedtag = $nbt;
$this->server = $level->getServer();
$this->setLevel($level);
$this->name = "";
$this->id = Tile::$tileCount++;
$this->x = $this->namedtag->getInt(self::TAG_X);
$this->y = $this->namedtag->getInt(self::TAG_Y);
$this->z = $this->namedtag->getInt(self::TAG_Z);
parent::__construct($this->namedtag->getInt(self::TAG_X), $this->namedtag->getInt(self::TAG_Y), $this->namedtag->getInt(self::TAG_Z), $level);
$this->getLevel()->addTile($this);
}