Class SpeleothemBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.SpeleothemBlock
- All Implemented Interfaces:
FeatureElement, BucketPickup, Fallable, LiquidBlockContainer, SimpleWaterloggedBlock, ItemLike, IBlockExtension, IBucketPickupExtension, IFallableExtension
- Direct Known Subclasses:
PointedDripstoneBlock, SulfurSpikeBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class Block
Block.UpdateFlagsNested classes/interfaces inherited from class BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.PostProcess, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatprotected final BlockStateprivate static final intprivate static final floatprivate static final intprivate static final floatprivate static final intprivate static final intprivate static final doubleprivate static final VoxelShapeprivate static final VoxelShapeprivate static final VoxelShapeprotected static final VoxelShapeprivate static final VoxelShapeprivate static final VoxelShapeprivate static final floatprivate static final intstatic final EnumProperty<SpeleothemThickness> static final EnumProperty<Direction> static final BooleanPropertyFields inherited from class Block
BLOCK_STATE_REGISTRY, CODEC, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class BlockBehaviour
bounceRestitution, descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionSpeleothemBlock(BlockState blockToGrowOn, BlockBehaviour.Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanblocksStalagmiteScan(LevelReader level, BlockPos pos, BlockState state) private SpeleothemThicknesscalculateSpeleothemThickness(LevelReader level, BlockPos pos, Direction tipDirection, boolean mergeOpposingTips) calculateTipDirection(LevelReader level, BlockPos pos, Direction defaultTipDirection) protected booleancanGrow(LevelReader level, BlockPos pos) protected booleancanSurvive(BlockState state, LevelReader level, BlockPos pos) private booleancanTipGrow(BlockState tipState, ServerLevel level, BlockPos tipPos) abstract com.mojang.serialization.MapCodec<? extends SpeleothemBlock> codec()protected voidprivate voidcreateMergedTips(BlockState tipState, LevelAccessor level, BlockPos tipPos) private voidcreateSpeleothem(LevelAccessor level, BlockPos pos, Direction direction, SpeleothemThickness thickness) findBlockVertical(LevelAccessor level, BlockPos pos, Direction.AxisDirection axisDirection, BiPredicate<BlockPos, BlockState> pathPredicate, Predicate<BlockState> targetPredicate, int maxSteps) findTip(BlockState speleothemState, LevelAccessor level, BlockPos speleothemPos, int maxSearchLength, boolean includeMergedTip) getFallDamageSource(Entity entity) protected FluidStategetFluidState(BlockState state) protected intprotected floatprotected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) protected abstract intgetStateForPlacement(BlockPlaceContext context) private voidgrow(ServerLevel level, BlockPos growFromPos, Direction growToDirection) voidgrowStalactiteOrStalagmiteIfPossible(BlockState stalactiteStartState, ServerLevel level, BlockPos stalactiteStartPos, RandomSource random) private voidgrowStalagmiteBelow(ServerLevel level, BlockPos posAboveStalagmite) protected booleanisCollisionShapeFullBlock(BlockState state, BlockGetter level, BlockPos pos) protected static booleanprotected booleanisPathfindable(BlockState state, PathComputationType type) private static booleanisSpeleothemWithDirection(BlockState blockState, Direction tipDirection) protected static booleanisStalactite(BlockState state) protected static booleanisStalactiteStartPos(BlockState state, LevelReader level, BlockPos pos) private static booleanisStalagmite(BlockState state) private static booleanisTip(BlockState state, boolean includeMergedTip) private booleanisUnmergedTipWithDirection(BlockState state, Direction tipDirection) private booleanisValidSpeleothemPlacement(LevelReader level, BlockPos pos, Direction tipDirection) voidonBrokenAfterFall(Level level, BlockPos pos, FallingBlockEntity entity) protected voidonProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile projectile) protected voidrandomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) private static voidspawnFallingStalactite(BlockState state, ServerLevel level, BlockPos pos) protected voidtick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected BlockStateupdateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) Methods inherited from class Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropFromBlockInteractLootTable, dropFromExplosion, dropFromLootTable, dropResources, dropResources, dropResources, fallOn, getBounceRestitution, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getInteractionShape, getLightDampening, getLootTable, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isRandomlyTicking, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, ownSignal, propagatesSkylightDown, properties, propertiesCodec, requiredFeatures, rotate, shouldChangedStateKeepBlockEntity, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItemMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FeatureElement
isEnabledMethods inherited from interface IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBounceRestitution, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, ignitedByLava, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHidingMethods inherited from interface IBucketPickupExtension
getPickupSoundMethods inherited from interface IFallableExtension
fallingTickMethods inherited from interface SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
TIP_DIRECTION
-
THICKNESS
-
WATERLOGGED
-
DELAY_BEFORE_FALLING
private static final int DELAY_BEFORE_FALLING- See Also:
-
MIN_TRIDENT_VELOCITY_TO_BREAK_SPELEOTHEM
private static final double MIN_TRIDENT_VELOCITY_TO_BREAK_SPELEOTHEM- See Also:
-
STALACTITE_DAMAGE_PER_FALL_DISTANCE_AND_SIZE
private static final float STALACTITE_DAMAGE_PER_FALL_DISTANCE_AND_SIZE- See Also:
-
STALACTITE_MAX_DAMAGE
private static final int STALACTITE_MAX_DAMAGE- See Also:
-
MAX_STALACTITE_HEIGHT_FOR_DAMAGE_CALCULATION
private static final int MAX_STALACTITE_HEIGHT_FOR_DAMAGE_CALCULATION- See Also:
-
SHAPE_TIP_MERGE
-
SHAPE_TIP_UP
-
SHAPE_TIP_DOWN
-
SHAPE_FRUSTUM
-
SHAPE_MIDDLE
-
SHAPE_BASE
-
MAX_HORIZONTAL_OFFSET
private static final float MAX_HORIZONTAL_OFFSET -
AVERAGE_DAYS_PER_GROWTH
private static final float AVERAGE_DAYS_PER_GROWTH- See Also:
-
GROWTH_PROBABILITY_PER_RANDOM_TICK
private static final float GROWTH_PROBABILITY_PER_RANDOM_TICK- See Also:
-
MAX_GROWTH_LENGTH
private static final int MAX_GROWTH_LENGTH- See Also:
-
MAX_STALAGMITE_SEARCH_RANGE_WHEN_GROWING
private static final int MAX_STALAGMITE_SEARCH_RANGE_WHEN_GROWING- See Also:
-
blockToGrowOn
-
-
Constructor Details
-
SpeleothemBlock
-
-
Method Details
-
codec
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
canSurvive
- Overrides:
canSurvivein classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) - Overrides:
updateShapein classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
calculateTipDirection
private @Nullable Direction calculateTipDirection(LevelReader level, BlockPos pos, Direction defaultTipDirection) -
calculateSpeleothemThickness
private SpeleothemThickness calculateSpeleothemThickness(LevelReader level, BlockPos pos, Direction tipDirection, boolean mergeOpposingTips) -
isValidSpeleothemPlacement
-
isSpeleothemWithDirection
-
onProjectileHit
protected void onProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile projectile) - Overrides:
onProjectileHitin classBlockBehaviour
-
tick
- Overrides:
tickin classBlockBehaviour
-
spawnFallingStalactite
-
isStalagmite
-
isStalactite
-
isTip
-
onBrokenAfterFall
- Specified by:
onBrokenAfterFallin interfaceFallable
-
getStalactiteLandingSound
protected abstract int getStalactiteLandingSound() -
getFallDamageSource
- Specified by:
getFallDamageSourcein interfaceFallable
-
getFluidState
- Overrides:
getFluidStatein classBlockBehaviour
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShapein classBlockBehaviour
-
isCollisionShapeFullBlock
- Overrides:
isCollisionShapeFullBlockin classBlockBehaviour
-
getMaxHorizontalOffset
protected float getMaxHorizontalOffset()- Overrides:
getMaxHorizontalOffsetin classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-
randomTick
- Overrides:
randomTickin classBlockBehaviour
-
isStalactiteStartPos
-
growStalactiteOrStalagmiteIfPossible
public void growStalactiteOrStalagmiteIfPossible(BlockState stalactiteStartState, ServerLevel level, BlockPos stalactiteStartPos, RandomSource random) -
canGrow
-
findTip
protected static @Nullable BlockPos findTip(BlockState speleothemState, LevelAccessor level, BlockPos speleothemPos, int maxSearchLength, boolean includeMergedTip) -
findBlockVertical
protected static Optional<BlockPos> findBlockVertical(LevelAccessor level, BlockPos pos, Direction.AxisDirection axisDirection, BiPredicate<BlockPos, BlockState> pathPredicate, Predicate<BlockState> targetPredicate, int maxSteps) -
canTipGrow
-
isUnmergedTipWithDirection
-
grow
-
createSpeleothem
private void createSpeleothem(LevelAccessor level, BlockPos pos, Direction direction, SpeleothemThickness thickness) -
createMergedTips
-
growStalagmiteBelow
-
blocksStalagmiteScan
-
isFreeHangingStalactite
-
getMaxGrowthLength
protected int getMaxGrowthLength()
-