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,10 +614,19 @@ class Entity extends Position
}
if($this->speedY != 0){
$ny = $this->y + $this->speedY;
if($this->class === ENTITY_FALLING && $support){
$this->level->fastSetBlockUpdate($this->x, $this->y, $this->z, $this->data["Tile"], 0);
$this->close();
return;
if($this->class === ENTITY_FALLING){
if($support){
$this->level->fastSetBlockUpdate($this->x, $this->y, $this->z, $this->data["Tile"], 0);
$this->close();
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;