From 2ba8eac27f13f92daf3ac3822f7fe26795877386 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 16 Aug 2019 17:27:41 +0100 Subject: [PATCH] FallingBlock: fix endless falling on top of fences this is a shitty fix, but I don't think there's a better way to do it on 3.x. This also fixes dropping on cactus. close #2449, close #2895 --- src/pocketmine/entity/object/FallingBlock.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/entity/object/FallingBlock.php b/src/pocketmine/entity/object/FallingBlock.php index 7d7d6cb1c..7c47612e2 100644 --- a/src/pocketmine/entity/object/FallingBlock.php +++ b/src/pocketmine/entity/object/FallingBlock.php @@ -33,6 +33,8 @@ use pocketmine\item\ItemFactory; use pocketmine\level\Position; use pocketmine\nbt\tag\ByteTag; use pocketmine\nbt\tag\IntTag; +use function abs; +use function floor; use function get_class; class FallingBlock extends Entity{ @@ -110,7 +112,7 @@ class FallingBlock extends Entity{ $this->flagForDespawn(); $block = $this->level->getBlock($pos); - if($block->isTransparent() and !$block->canBeReplaced()){ + if(($block->isTransparent() and !$block->canBeReplaced()) or abs($this->y - $this->getFloorY()) > 0.001){ //FIXME: anvils are supposed to destroy torches $this->getLevel()->dropItem($this, ItemFactory::get($this->getBlock(), $this->getDamage())); }else{