WaterloggedHelper 5.46.0
Shared behaviour of Waterlogged blocks.
Methods
flow()
php
public static function flow(\pocketmine\block\Block $block) : voidLets 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\LiquidReturns 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) : boolReturns 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) : voidReplaces a broken waterlogged block with the water it held.
scheduleFlow()
php
public static function scheduleFlow(\pocketmine\block\Block $block) : voidSchedules the water held by the block to spread into its neighbours, like a water source would.
