From b5469dede222e33cbfa3371eace28d0f9058f7b8 Mon Sep 17 00:00:00 2001 From: ipad54 <63200545+ipad54@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:10:43 +0300 Subject: [PATCH] Flowable blocks now can't be placed inside liquid (#5392) --- src/block/Flowable.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/block/Flowable.php b/src/block/Flowable.php index 795fe27561a..0328bcd745e 100644 --- a/src/block/Flowable.php +++ b/src/block/Flowable.php @@ -25,6 +25,7 @@ use pocketmine\block\utils\SupportType; use pocketmine\math\AxisAlignedBB; +use pocketmine\math\Vector3; /** * "Flowable" blocks are destroyed if water flows into the same space as the block. These blocks usually don't have any @@ -40,6 +41,11 @@ public function isSolid() : bool{ return false; } + public function canBePlacedAt(Block $blockReplace, Vector3 $clickVector, int $face, bool $isClickedBlock) : bool{ + return (!$this->canBeFlowedInto() || !$blockReplace instanceof Liquid) && + parent::canBePlacedAt($blockReplace, $clickVector, $face, $isClickedBlock); + } + /** * @return AxisAlignedBB[] */