Skip to content

Commit

Permalink
Flowable blocks now can't be placed inside liquid (pmmp#5392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipad54 authored Nov 15, 2024
1 parent 09bf203 commit b5469de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/block/Flowable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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[]
*/
Expand Down

0 comments on commit b5469de

Please sign in to comment.