Exemplo n.º 1
0
 private function writeChunk(Chunk $chunk)
 {
     $binary = $chunk->toBinary(true);
     $index = LevelDB::chunkIndex($chunk->getX(), $chunk->getZ());
     $this->db->put($index . self::ENTRY_TERRAIN, substr($binary, 8, -1));
     $this->db->put($index . self::ENTRY_FLAGS, substr($binary, -1));
     $this->db->put($index . self::ENTRY_VERSION, "");
 }
Exemplo n.º 2
0
 private function writeChunk(Chunk $chunk)
 {
     $binary = $chunk->toBinary(true);
     $index = LevelDB::chunkIndex($chunk->getX(), $chunk->getZ());
     $this->db->put($index . "0", substr($binary, 8, -1));
     $this->db->put($index . "f", substr($binary, -1));
     $this->db->put($index . "v", "");
 }