removed advanced cache

This commit is contained in:
GameHerobrine 2024-01-09 05:28:24 +03:00
parent 1bbe5c7582
commit 80d78faecd
5 changed files with 3 additions and 63 deletions

View file

@ -292,9 +292,6 @@ class Level{
}
$block->position($pos);
$i = ($pos->x >> 4) . ":" . ($pos->y >> 4) . ":" . ($pos->z >> 4);
if(ADVANCED_CACHE == true){
Cache::remove("world:{$this->name}:" . ($pos->x >> 4) . ":" . ($pos->z >> 4));
}
if(!isset($this->changedBlocks[$i])){
$this->changedBlocks[$i] = [];
$this->changedCount[$i] = 0;
@ -451,9 +448,6 @@ class Level{
$this->changedBlocks[$i] = [];
$this->changedCount[$i] = 0;
}
if(ADVANCED_CACHE == true){
Cache::remove("world:{$this->name}:" . ($pos->x >> 4) . ":" . ($pos->z >> 4));
}
$this->changedBlocks[$i][] = [$block->x, $block->y, $block->z, $block->id, $block->getMetadata()];
++$this->changedCount[$i];
}
@ -482,9 +476,6 @@ class Level{
return false;
}
$this->changedCount[$X . ":" . $Y . ":" . $Z] = 4096;
if(ADVANCED_CACHE == true){
Cache::remove("world:{$this->name}:$X:$Z");
}
return $this->level->setMiniChunk($X, $Z, $Y, $data);
}
@ -503,7 +494,6 @@ class Level{
if($force !== true and $this->isSpawnChunk($X, $Z)){
return false;
}
Cache::remove("world:{$this->name}:$X:$Z");
return $this->level->unloadChunk($X, $Z, $this->server->saveEnabled);
}
@ -511,13 +501,6 @@ class Level{
if(!isset($this->level)){
return false;
}
if(ADVANCED_CACHE == true and $Yndex == 0xff){
$identifier = "world:{$this->name}:$X:$Z";
if(($cache = Cache::get($identifier)) !== false){
return $cache;
}
}
$raw = [];
for($Y = 0; $Y < 8; ++$Y){
@ -534,9 +517,6 @@ class Level{
$ordered .= substr($mini, $j << 5, 24); //16 + 8
}
}
if(ADVANCED_CACHE == true and $Yndex == 0xff){
Cache::add($identifier, $ordered, 60);
}
return $ordered;
}