getX() public method

public getX ( ) : integer
return integer
 public function writeChunk(FullChunk $chunk)
 {
     $this->lastUsed = \time();
     $chunkData = $chunk->toBinary();
     if ($chunkData !== \false) {
         $this->saveChunk($chunk->getX() - $this->getX() * 32, $chunk->getZ() - $this->getZ() * 32, $chunkData);
     }
 }
Beispiel #2
0
 public function onChunkChanged(FullChunk $chunk)
 {
     $this->loadQueue[Level::chunkHash($chunk->getX(), $chunk->getZ())] = abs(($this->x >> 4) - $chunk->getX()) + abs(($this->z >> 4) - $chunk->getZ());
 }
 protected function receiveChunk($levelID, FullChunk $chunk)
 {
     if ($this->needsChunk[$levelID] !== null) {
         if ($this->needsChunk[$levelID][0] === $chunk->getX() and $this->needsChunk[$levelID][1] === $chunk->getZ()) {
             $this->needsChunk[$levelID] = $chunk;
         }
     }
     //TODO: set new received chunks
 }
Beispiel #4
0
 public function writeChunk(FullChunk $chunk)
 {
     $this->saveChunk($chunk->getX() - $this->getX() * 32, $chunk->getZ() - $this->getZ() * 32, $chunk->toBinary());
 }
Beispiel #5
0
 public function onChunkChanged(FullChunk $chunk)
 {
     $this->loadQueue[\PHP_INT_SIZE === 8 ? ($chunk->getX() & 4294967295.0) << 32 | $chunk->getZ() & 4294967295.0 : $chunk->getX() . ":" . $chunk->getZ()] = \abs(($this->x >> 4) - $chunk->getX()) + \abs(($this->z >> 4) - $chunk->getZ());
 }
 public function onChunkChanged(FullChunk $chunk)
 {
     $this->loadQueue[$chunk->getX() . ":" . $chunk->getZ()] = \abs(($this->x >> 4) - $chunk->getX()) + \abs(($this->z >> 4) - $chunk->getZ());
 }
 public function onChunkChanged(FullChunk $chunk)
 {
     $this->loadQueue[($chunk->getX() & 0xffffffff) << 32 | $chunk->getZ() & 0xffffffff] = \abs(($this->x >> 4) - $chunk->getX()) + \abs(($this->z >> 4) - $chunk->getZ());
 }