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 p_221374_, Level p_221375_, BlockPos p_221376_, RandomSource p_221377_) 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 p_221384_) protected int
getLightBlock
(BlockState p_54460_) 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 p_221379_, ServerLevel p_221380_, BlockPos p_221381_, RandomSource p_221382_) Performs a random tick on a block.protected abstract void
spawnFallingLeavesParticle
(Level pLevel, BlockPos pPos, RandomSource pRandom) protected void
tick
(BlockState p_221369_, ServerLevel p_221370_, BlockPos p_221371_, RandomSource p_221372_) private static BlockState
updateDistance
(BlockState pState, LevelAccessor pLevel, BlockPos pPos) protected BlockState
updateShape
(BlockState p_54440_, LevelReader p_374064_, ScheduledTickAccess p_374538_, BlockPos p_54444_, Direction p_54441_, BlockPos p_54445_, BlockState p_54442_, RandomSource p_374122_) 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 p_221379_, ServerLevel p_221380_, BlockPos p_221381_, RandomSource p_221382_) Description copied from class:BlockBehaviour
Performs a random tick on a block.- Overrides:
randomTick
in classBlockBehaviour
-
decaying
-
tick
protected void tick(BlockState p_221369_, ServerLevel p_221370_, BlockPos p_221371_, RandomSource p_221372_) - Overrides:
tick
in classBlockBehaviour
-
getLightBlock
- Overrides:
getLightBlock
in classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState p_54440_, LevelReader p_374064_, ScheduledTickAccess p_374538_, BlockPos p_54444_, Direction p_54441_, BlockPos p_54445_, BlockState p_54442_, RandomSource p_374122_) - Overrides:
updateShape
in classBlockBehaviour
-
updateDistance
-
getDistanceAt
-
getOptionalDistanceAt
-
getFluidState
- Overrides:
getFluidState
in classBlockBehaviour
-
animateTick
public void animateTick(BlockState p_221374_, Level p_221375_, BlockPos p_221376_, RandomSource p_221377_) Description copied from class:Block
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
-