public function __construct(FullChunk $chunk, Compound $nbt)
{
if ($chunk === null or $chunk->getProvider() === null) {
throw new \Exception("Invalid garbage Chunk given to Tile");
}
$this->server = $chunk->getProvider()->getLevel()->getServer();
$this->chunk = $chunk;
$this->setLevel($chunk->getProvider()->getLevel());
$this->namedtag = $nbt;
$this->closed = false;
$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);
}