Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flowable blocks now can't be placed inside liquid #5392

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/block/Flowable.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
namespace pocketmine\block;

use pocketmine\block\utils\SupportType;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;

/**
* "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 +44,13 @@ public function isSolid() : bool{
return false;
}

public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
ipad54 marked this conversation as resolved.
Show resolved Hide resolved
if(!$blockReplace instanceof Liquid){
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
return false;
}

/**
* @return AxisAlignedBB[]
*/
Expand Down