public function __construct(FullChunk $chunk, CompoundTag $nbt) { assert($chunk !== null and $chunk->getProvider() !== null); $this->timings = Timings::getTileEntityTimings($this); $this->server = $chunk->getProvider()->getLevel()->getServer(); $this->chunk = $chunk; $this->setLevel($chunk->getProvider()->getLevel()); $this->namedtag = $nbt; $this->name = ""; $this->lastUpdate = microtime(true); $this->id = Tile::$tileCount++; $this->x = (int) $this->namedtag["x"]; $this->y = (int) $this->namedtag["y"]; $this->z = (int) $this->namedtag["z"]; $this->chunk->addTile($this); $this->getLevel()->addTile($this); $this->tickTimer = Timings::getTileEntityTimings($this); }