Package net.minecraft.world.level.block
Class LeavesBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.LeavesBlock
- All Implemented Interfaces:
FeatureElement
,BucketPickup
,LiquidBlockContainer
,SimpleWaterloggedBlock
,ItemLike
,IBlockExtension
,IBucketPickupExtension
,IShearable
- Direct Known Subclasses:
TintedParticleLeavesBlock
,UntintedParticleLeavesBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.ShapePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final IntegerProperty
protected final float
static final BooleanProperty
private static final int
static final BooleanProperty
Fields inherited from class net.minecraft.world.level.block.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_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
ConstructorsConstructorDescriptionLeavesBlock
(float pLeafParticleChance, BlockBehaviour.Properties pProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
animateTick
(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRandom) Called periodically clientside on blocks near the player to show effects (like furnace fire particles).abstract com.mojang.serialization.MapCodec
<? extends LeavesBlock> codec()
protected void
protected boolean
decaying
(BlockState pState) protected VoxelShape
getBlockSupportShape
(BlockState pState, BlockGetter pReader, BlockPos pPos) private static int
getDistanceAt
(BlockState pNeighbor) protected FluidState
getFluidState
(BlockState pState) protected int
getLightBlock
(BlockState pState) static OptionalInt
getOptionalDistanceAt
(BlockState pState) getStateForPlacement
(BlockPlaceContext pContext) protected boolean
isRandomlyTicking
(BlockState pState) private static void
makeDrippingWaterParticles
(Level pLevel, BlockPos pPos, RandomSource pRandom, BlockState pBlockBelow, BlockPos pBelowPos) private void
makeFallingLeavesParticles
(Level pLevel, BlockPos pPos, RandomSource pRandom, BlockState pBlockBelow, BlockPos pBelowPos) protected void
randomTick
(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) Performs a random tick on a block.protected abstract void
spawnFallingLeavesParticle
(Level pLevel, BlockPos pPos, RandomSource pRandom) protected void
tick
(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) private static BlockState
updateDistance
(BlockState pState, LevelAccessor pLevel, BlockPos pPos) protected BlockState
updateShape
(BlockState pState, LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) Methods inherited from class net.minecraft.world.level.block.Block
asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, 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, updateEntityMovementAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getInteractionShape, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getShape, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isPathfindable, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, requiredFeatures, rotate, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, 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, supportsExternalFaceHiding
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBucketPickupExtension
getPickupSound
Methods inherited from interface net.neoforged.neoforge.common.IShearable
isShearable, onSheared, spawnShearedDrop
Methods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
DECAY_DISTANCE
public static final int DECAY_DISTANCE- See Also:
-
DISTANCE
-
PERSISTENT
-
WATERLOGGED
-
leafParticleChance
protected final float leafParticleChance -
TICK_DELAY
private static final int TICK_DELAY- See Also:
-
-
Constructor Details
-
LeavesBlock
-
-
Method Details
-
codec
-
getBlockSupportShape
- Overrides:
getBlockSupportShape
in classBlockBehaviour
-
isRandomlyTicking
- Overrides:
isRandomlyTicking
in classBlockBehaviour
-
randomTick
protected void randomTick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) Performs a random tick on a block.- Overrides:
randomTick
in classBlockBehaviour
-
decaying
-
tick
- Overrides:
tick
in classBlockBehaviour
-
getLightBlock
- Overrides:
getLightBlock
in classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState pState, LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) - Overrides:
updateShape
in classBlockBehaviour
-
updateDistance
-
getDistanceAt
-
getOptionalDistanceAt
-
getFluidState
- Overrides:
getFluidState
in classBlockBehaviour
-
animateTick
Called periodically clientside on blocks near the player to show effects (like furnace fire particles).- Overrides:
animateTick
in classBlock
-
makeDrippingWaterParticles
private static void makeDrippingWaterParticles(Level pLevel, BlockPos pPos, RandomSource pRandom, BlockState pBlockBelow, BlockPos pBelowPos) -
makeFallingLeavesParticles
private void makeFallingLeavesParticles(Level pLevel, BlockPos pPos, RandomSource pRandom, BlockState pBlockBelow, BlockPos pBelowPos) -
spawnFallingLeavesParticle
protected abstract void spawnFallingLeavesParticle(Level pLevel, BlockPos pPos, RandomSource pRandom) -
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-