示例#1
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if ($chunk === null or $chunk->getProvider() === null) {
         throw new ChunkException("Invalid garbage Chunk given to Tile");
     }
     $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);
 }