示例#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, "");
 }