Ejemplo n.º 1
0
 public function __construct(Level $level, FullChunk $chunk)
 {
     $this->state = true;
     $this->levelId = $level->getId();
     $this->chunk = $chunk->toFastBinary();
     $this->chunkClass = get_class($chunk);
 }
Ejemplo n.º 2
0
 public function __construct(Level $level, FullChunk $chunk)
 {
     $this->state = true;
     $this->levelId = $level->getId();
     $this->chunk = $chunk->toFastBinary();
     $this->chunkClass = get_class($chunk);
     for ($i = 0; $i < 9; ++$i) {
         if ($i === 4) {
             continue;
         }
         $xx = -1 + $i % 3;
         $zz = -1 + (int) ($i / 3);
         $ck = $level->getChunk($chunk->getX() + $xx, $chunk->getZ() + $zz, false);
         $this->{"chunk{$i}"} = $ck !== null ? $ck->toFastBinary() : null;
     }
 }