Level optimization, added new chunk/block hashes

This commit is contained in:
Shoghi Cervantes
2014-12-09 14:36:16 +01:00
parent ddfc9d9ce1
commit 04ecbd1a76
6 changed files with 76 additions and 54 deletions

View File

@ -76,9 +76,7 @@ class Anvil extends McRegion{
* @return RegionLoader
*/
protected function getRegion($x, $z){
$index = $x . ":" . $z;
return isset($this->regions[$index]) ? $this->regions[$index] : null;
return isset($this->regions[$index = Level::chunkHash($x, $z)]) ? $this->regions[$index] : null;
}
/**
@ -126,8 +124,7 @@ class Anvil extends McRegion{
}
protected function loadRegion($x, $z){
$index = $x . ":" . $z;
if(isset($this->regions[$index])){
if(isset($this->regions[$index = Level::chunkHash($x, $z)])){
return true;
}