mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed blocks that have no physcis falling sometimes
This commit is contained in:
parent
b0bad174e0
commit
e45b99c7e9
1 changed files with 14 additions and 11 deletions
|
|
@ -58,17 +58,20 @@ class GenericBlock extends Block{
|
|||
|
||||
public static function onUpdate(Level $level, $x, $y, $z, $type){
|
||||
[$id, $meta] = $level->level->getBlock($x, $y, $z);
|
||||
$down = $level->level->getBlockID($x, $y - 1, $z);
|
||||
if($down == AIR || StaticBlock::getIsLiquid($down)){
|
||||
$data = array(
|
||||
"x" => $x + 0.5,
|
||||
"y" => $y,
|
||||
"z" => $z + 0.5,
|
||||
"Tile" => $id,
|
||||
);
|
||||
$server = ServerAPI::request();
|
||||
$e = $server->api->entity->add($level, ENTITY_FALLING, FALLING_SAND, $data);
|
||||
$server->api->entity->spawnToAll($e);
|
||||
if(StaticBlock::getHasPhysics($id)){
|
||||
$down = $level->level->getBlockID($x, $y - 1, $z);
|
||||
|
||||
if($down == AIR || StaticBlock::getIsLiquid($down)){
|
||||
$data = array(
|
||||
"x" => $x + 0.5,
|
||||
"y" => $y,
|
||||
"z" => $z + 0.5,
|
||||
"Tile" => $id,
|
||||
);
|
||||
$server = ServerAPI::request();
|
||||
$e = $server->api->entity->add($level, ENTITY_FALLING, FALLING_SAND, $data);
|
||||
$server->api->entity->spawnToAll($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue