Skip to content

WaterloggedHelper 5.46.0 ​

final class · pocketmine\block\utils\WaterloggedHelper · source

Shared behaviour of Waterlogged blocks.

Methods ​

flow() ​

php
public static function flow(\pocketmine\block\Block $block) : void

Lets the water held by the block flow out of it, as if a water source stood in its place.

getHeldLiquid() ​

php
public static function getHeldLiquid(\pocketmine\block\Block $block, \pocketmine\block\Liquid $liquidType) : ?\pocketmine\block\Liquid

Returns the water that a waterlogged block holds, as a block of the given liquid type, or null if it holds none. Used by liquids to treat waterlogged neighbours as sources.

isWaterSource() ​

php
public static function isWaterSource(\pocketmine\block\Block $block) : bool

Returns whether the block is a still water source, the only thing underwater plants can be placed into.

leaveWater() ​

php
public static function leaveWater(\pocketmine\block\Block $block) : void

Replaces a broken waterlogged block with the water it held.

scheduleFlow() ​

php
public static function scheduleFlow(\pocketmine\block\Block $block) : void

Schedules the water held by the block to spread into its neighbours, like a water source would.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.