BubbleColumn 5.46.0
Extends Transparent
Implements Waterlogged
Bubble column (https://minecraft.wiki/w/Bubble_Column): fills the water sources above soul sand (pushes up) or a magma block (drags down, "whirlpool"). Like vanilla it holds a water source (kept in the liquid layer) and is created, extended and removed by BubbleColumn::updateColumn(): water sources over soul sand/magma run it when they are updated, column blocks run it 5 ticks after a neighbour change.
The bubbles and sounds are drawn by the client from the block; players are moved by their own client, other entities are pushed here with the vanilla velocities.
Constants
CHECK_DELAY
public const CHECK_DELAY = 5Ticks between a neighbour change and the column check (vanilla CHECK_PERIOD).
DRAG_DOWN_ACCELERATION
public const DRAG_DOWN_ACCELERATION = 0.03Velocity change per tick inside a whirlpool, and its cap (downwards).
DRAG_DOWN_MAX_SPEED
public const DRAG_DOWN_MAX_SPEED = 0.3PUSH_UP_ACCELERATION
public const PUSH_UP_ACCELERATION = 0.06Velocity change per tick inside an upward column, and its cap (blocks/tick).
PUSH_UP_MAX_SPEED
public const PUSH_UP_MAX_SPEED = 0.7SURFACE_DRAG_DOWN_MAX_SPEED
public const SURFACE_DRAG_DOWN_MAX_SPEED = 0.9SURFACE_PUSH_UP_ACCELERATION
public const SURFACE_PUSH_UP_ACCELERATION = 0.1Same for the topmost block of an upward column (nothing above it): entities are thrown out of the water.
SURFACE_PUSH_UP_MAX_SPEED
public const SURFACE_PUSH_UP_MAX_SPEED = 1.8Properties
$dragDown protected
protected bool $dragDownMethods
canBeReplaced()
public function canBeReplaced() : boolcanOccupy()
public static function canOccupy(\pocketmine\block\Block $block) : boolWhether a bubble column can take the place of this block: another column, or a water source (not one held by a waterlogged block, which stops the column like in vanilla).
describeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetColumnState()
public static function getColumnState(\pocketmine\block\Block $below, \pocketmine\block\Block $occupied) : \pocketmine\block\BlockWhat a column-capable block should be with the given block below it: the column continues the one below, soul sand starts an upward column, a magma block a whirlpool, and anything else turns a column back into still water.
getDropsForCompatibleTool()
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : arraygetPickedItem()
public function getPickedItem(bool $addUserData = false) : \pocketmine\item\ItemgetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypeisAffectedBySilkTouch()
public function isAffectedBySilkTouch() : boolisDragDown()
public function isDragDown() : boolWhether the column drags entities down (above a magma block) instead of pushing them up (above soul sand).
isSolid()
public function isSolid() : boolonColumnSourceRandomTick()
public static function onColumnSourceRandomTick(\pocketmine\block\Block $source) : voidonEntityInside()
public function onEntityInside(\pocketmine\entity\Entity $entity) : boolSame as water, plus the push of the column. Players are left to their client, which simulates the column itself (pushing them here as well would double the effect).
onNearbyBlockChange()
public function onNearbyBlockChange() : voidonScheduledUpdate()
public function onScheduledUpdate() : voidonWaterSourceUpdate()
public static function onWaterSourceUpdate(\pocketmine\block\Water $water) : voidCalled by water sources when they are updated: starts a column if one is over soul sand or a magma block.
pushedVerticalSpeed()
public static function pushedVerticalSpeed(float $speed, bool $dragDown, bool $surface) : floatVertical speed (blocks/tick) of an entity after one tick in a bubble column block. $surface is true for the top block of a column, which has nothing (no collision, no liquid) above it.
recalculateCollisionBoxes() protected
protected function recalculateCollisionBoxes() : arraysetDragDown()
public function setDragDown(bool $dragDown) : selfstartsColumn()
public static function startsColumn(\pocketmine\block\Block $block) : boolWhether this block below a water source starts a bubble column (soul sand or a magma block).
updateColumn()
public static function updateColumn(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, \pocketmine\block\Block $below) : voidVanilla's BubbleColumnBlock.updateColumn(): sets the block at $pos (if a column can be there) to what the block below calls for, and the same state in every column-capable block above it, up to the first one that is not. Creates, extends, flips and removes columns.
