Region: Change chunk offset calculation in regions to use bitmasks

I don't know why it wasn't done like this to start with. However this has not been tested yet, so this goes on a different branch for now to test.
This commit is contained in:
Dylan K. Taylor
2017-12-30 19:41:58 +00:00
parent 54b23968e7
commit 4db7a7e57f
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ class RegionLoader{
$this->lastUsed = time();
$chunkData = $this->levelProvider->nbtSerialize($chunk);
if($chunkData !== false){
$this->saveChunk($chunk->getX() - ($this->getX() * 32), $chunk->getZ() - ($this->getZ() * 32), $chunkData);
$this->saveChunk($chunk->getX() & 0x1f, $chunk->getZ() & 0x1f, $chunkData);
}
}