mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
block ticking changes(should not lag that much now), chamge back if any issues will start to appear
This commit is contained in:
parent
569f81c70c
commit
03059f7677
2 changed files with 8 additions and 3 deletions
|
|
@ -531,7 +531,8 @@ class BlockAPI{
|
||||||
$this->blockUpdateAround($block, $level);
|
$this->blockUpdateAround($block, $level);
|
||||||
$this->server->api->entity->updateRadius($pos, 1);
|
$this->server->api->entity->updateRadius($pos, 1);
|
||||||
}elseif($level === BLOCK_UPDATE_RANDOM){
|
}elseif($level === BLOCK_UPDATE_RANDOM){
|
||||||
$this->nextRandomUpdate($pos);
|
//$this->nextRandomUpdate($pos); old version, change back if any issues will start to happen with this one(please note that old version makes a lot of lag)
|
||||||
|
$this->scheduleBlockUpdate($pos, (mt_rand(25, 75) + Utils::getRandomUpdateTicks() * 0.05) / 0.05, BLOCK_UPDATE_RANDOM);
|
||||||
}
|
}
|
||||||
return $level;
|
return $level;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,11 @@ class PMFLevel extends PMF{
|
||||||
$this->locationTable[$index][0] |= 1 << $Y;
|
$this->locationTable[$index][0] |= 1 << $Y;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private function report(){
|
||||||
|
console("[ERROR] A weird error in PMFLevel just happeneed. Values: ");
|
||||||
|
var_dump(func_get_args());
|
||||||
|
console("[NOTICE] If you see this message, you should send the log with error to the devs.");
|
||||||
|
}
|
||||||
public function getBlockID($x, $y, $z){
|
public function getBlockID($x, $y, $z){
|
||||||
if($y > 127 or $y < 0 or $x < 0 or $z < 0 or $x > 255 or $z > 255){
|
if($y > 127 or $y < 0 or $x < 0 or $z < 0 or $x > 255 or $z > 255){
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -328,7 +332,7 @@ class PMFLevel extends PMF{
|
||||||
$aX = $x - ($X << 4);
|
$aX = $x - ($X << 4);
|
||||||
$aZ = $z - ($Z << 4);
|
$aZ = $z - ($Z << 4);
|
||||||
$aY = $y - ($Y << 4);
|
$aY = $y - ($Y << 4);
|
||||||
$b = ord($this->chunks[$index][$Y][(int) ($aY + ($aX << 5) + ($aZ << 9))]);
|
$b = ord($this->chunks[$index][$Y][(int) ($aY + ($aX << 5) + ($aZ << 9))]) or $this->report($index, $Y, ($aY + ($aX << 5) + ($aZ << 9)), $x, $y, $z);
|
||||||
return $b;
|
return $b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue