sand will be destroyed if it falls on torch/non solid block

This commit is contained in:
GameHerobrine 2023-12-11 05:56:29 +03:00
parent 38ee2f8b09
commit d005e69c1f

View file

@ -614,11 +614,20 @@ class Entity extends Position
} }
if($this->speedY != 0){ if($this->speedY != 0){
$ny = $this->y + $this->speedY; $ny = $this->y + $this->speedY;
if($this->class === ENTITY_FALLING && $support){ if($this->class === ENTITY_FALLING){
if($support){
$this->level->fastSetBlockUpdate($this->x, $this->y, $this->z, $this->data["Tile"], 0); $this->level->fastSetBlockUpdate($this->x, $this->y, $this->z, $this->data["Tile"], 0);
$this->close(); $this->close();
return; return;
} }
$id = $this->level->level->getBlockID($this->x, $this->y, $this->z);
if($id > 0 && !StaticBlock::getIsSolid($id) && !StaticBlock::getIsLiquid($id)){
$this->server->api->entity->drop($this, BlockAPI::getItem($this->data["Tile"], 0, 1));
$this->close();
return;
}
}
$this->y = $ny; $this->y = $ny;
$update = true; $update = true;