vanilla(or close to vanila) liquid physics

This commit is contained in:
GameHerobrine 2024-05-24 06:45:34 +03:00
parent 589bc9f1c0
commit 9c21a984cd
5 changed files with 12 additions and 26 deletions

View file

@ -569,18 +569,15 @@ class BlockAPI{
}
public function scheduleBlockUpdateXYZ(Level $level, $x, $y, $z, $type = BLOCK_UPDATE_SCHEDULED, $delay = false){
$type = (int) $type;
ConsoleAPI::debug($delay);
if($delay < 0){
return false;
}
$index = $x . "." . $y . "." . $z . "." . $level->getName() . "." . $type;
$delay = microtime(true) + $delay * 0.05;
ConsoleAPI::debug($index);
if(!isset($this->scheduledUpdates[$index])){
$this->scheduledUpdates[$index] = new Position($x, $y, $z, $level); //TODO dont create a position
$this->server->query("INSERT INTO blockUpdates (x, y, z, level, type, delay) VALUES ($x, $y, $z, '{$level->getName()}', $type, $delay);");
ConsoleAPI::debug("added block update $x $y $z $type");
return true;
}
return false;