bonemeal on sugarcane tweaks, using block send queue to send UpdateBlockPackets

This commit is contained in:
GameHerobrine 2023-12-31 17:42:59 +03:00
parent 7ecfcacec6
commit 229a563ff5
8 changed files with 84 additions and 70 deletions

View file

@ -536,15 +536,13 @@ class BlockAPI{
if($block === false){
return false;
}
if($type === BLOCK_UPDATE_RANDOM) return false; //I HATE U NO
$level = $block->onUpdate($type);
if($level === BLOCK_UPDATE_NORMAL){
$this->blockUpdateAround($block, $level);
$this->server->api->entity->updateRadius($pos, 1);
}elseif($level === BLOCK_UPDATE_RANDOM){
//$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)
//NO $this->scheduleBlockUpdate($pos, (mt_rand(25, 75) + Utils::getRandomUpdateTicks() * 0.05) / 0.05, BLOCK_UPDATE_RANDOM);
}
return $level;
}
public function blockUpdateAround(Position $pos, $type = BLOCK_UPDATE_NORMAL, $delay = false){