From d005e69c1ffa3edc560ecb42264d0460ebb74db7 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 11 Dec 2023 05:56:29 +0300 Subject: [PATCH] sand will be destroyed if it falls on torch/non solid block --- src/entity/Entity.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 5dcca5fb..16abc10c 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -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;