fixed blocks that have no physcis falling sometimes

This commit is contained in:
GameHerobrine 2025-05-20 17:15:40 +03:00
parent b0bad174e0
commit e45b99c7e9

View file

@ -58,17 +58,20 @@ class GenericBlock extends Block{
public static function onUpdate(Level $level, $x, $y, $z, $type){ public static function onUpdate(Level $level, $x, $y, $z, $type){
[$id, $meta] = $level->level->getBlock($x, $y, $z); [$id, $meta] = $level->level->getBlock($x, $y, $z);
$down = $level->level->getBlockID($x, $y - 1, $z); if(StaticBlock::getHasPhysics($id)){
if($down == AIR || StaticBlock::getIsLiquid($down)){ $down = $level->level->getBlockID($x, $y - 1, $z);
$data = array(
"x" => $x + 0.5, if($down == AIR || StaticBlock::getIsLiquid($down)){
"y" => $y, $data = array(
"z" => $z + 0.5, "x" => $x + 0.5,
"Tile" => $id, "y" => $y,
); "z" => $z + 0.5,
$server = ServerAPI::request(); "Tile" => $id,
$e = $server->api->entity->add($level, ENTITY_FALLING, FALLING_SAND, $data); );
$server->api->entity->spawnToAll($e); $server = ServerAPI::request();
$e = $server->api->entity->add($level, ENTITY_FALLING, FALLING_SAND, $data);
$server->api->entity->spawnToAll($e);
}
} }
} }