Class BlockBehaviour.BlockStateBase
java.lang.Object
net.minecraft.world.level.block.state.StateHolder<Block,BlockState>
net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase
- Direct Known Subclasses:
BlockState
- Enclosing class:
BlockBehaviour
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final floatprivate static final Direction[]private final BlockBehaviour.StatePredicateprivate static final VoxelShape[]private FluidStateprivate static final VoxelShape[]private final BlockBehaviour.StatePredicateprivate final booleanprivate final NoteBlockInstrumentprivate final booleanprivate booleanprivate final BlockBehaviour.StatePredicateprivate final BlockBehaviour.StatePredicateprivate final BlockBehaviour.StatePredicateprivate booleanDeprecated.private intprivate final intprivate final booleanDeprecated.private final MapColorprivate VoxelShapeprivate VoxelShape[]private final BlockBehaviour.OffsetFunctionprivate booleanprivate final PushReactionprivate final booleanprivate final booleanprivate booleanprivate final booleanprivate final booleanFields inherited from class net.minecraft.world.level.block.state.StateHolder
NAME_TAG, owner, PROPERTIES_TAG, propertiesCodec -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockStateBase(Block pOwner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> pValues, com.mojang.serialization.MapCodec<BlockState> pPropertiesCodec) -
Method Summary
Modifier and TypeMethodDescriptionvoidaffectNeighborsAfterRemoval(ServerLevel pLevel, BlockPos pPos, boolean pMovedByPiston) protected abstract BlockStateasState()voidbooleanDeprecated.private booleanbooleanbooleancanBeReplaced(BlockPlaceContext pUseContext) booleancanBeReplaced(Fluid pFluid) booleanbooleancanSurvive(LevelReader pLevel, BlockPos pPos) booleanemissiveRendering(BlockGetter pLevel, BlockPos pPos) final booleanentityCanStandOn(BlockGetter pLevel, BlockPos pPos, Entity pEntity) final booleanentityCanStandOnFace(BlockGetter pLevel, BlockPos pPos, Entity pEntity, Direction pFace) voidentityInside(Level pLevel, BlockPos pPos, Entity pEntity, InsideBlockEffectApplier pApplier, boolean pIntersects) intgetAnalogOutputSignal(Level pLevel, BlockPos pPos, Direction pDirection) getBlock()getBlockSupportShape(BlockGetter pLevel, BlockPos pPos) getCloneItemStack(LevelReader pLevel, BlockPos pPos, boolean pIncludeData) getCollisionShape(BlockGetter pLevel, BlockPos pPos) getCollisionShape(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) floatgetDestroyProgress(Player pPlayer, BlockGetter pLevel, BlockPos pPos) floatgetDestroySpeed(BlockGetter pLevel, BlockPos pPos) intgetDirectSignal(BlockGetter pLevel, BlockPos pPos, Direction pDirection) getDrops(LootParams.Builder pLootParams) getEntityInsideCollisionShape(BlockGetter pLevel, BlockPos pPos, Entity pEntity) getFaceOcclusionShape(Direction pFace) getInteractionShape(BlockGetter pLevel, BlockPos pPos) intintDeprecated.getMapColor(BlockGetter pLevel, BlockPos pPos) getMenuProvider(Level pLevel, BlockPos pPos) longfloatgetShadeBrightness(BlockGetter pLevel, BlockPos pPos) getShape(BlockGetter pLevel, BlockPos pPos) getShape(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) intgetSignal(BlockGetter pLevel, BlockPos pPos, Direction pDirection) Deprecated.getTags()<T extends BlockEntity>
BlockEntityTicker<T> getTicker(Level pLevel, BlockEntityType<T> pBlockEntityType) getVisualShape(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) voidhandleNeighborChanged(Level pLevel, BlockPos pPos, Block pNeighborBlock, Orientation pOrientation, boolean pMovedByPiston) booleanbooleanbooleanbooleanbooleanhasPostProcess(BlockGetter pLevel, BlockPos pPos) booleanDeprecated.Neo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadvoidbooleanbooleanbooleanis(ResourceKey<Block> pBlock) booleanbooleanis(TagKey<Block> pTag, Predicate<BlockBehaviour.BlockStateBase> pPredicate) booleanbooleanisAir()booleanisCollisionShapeFullBlock(BlockGetter pLevel, BlockPos pPos) booleanisFaceSturdy(BlockGetter pLevel, BlockPos pPos, Direction pDirection) booleanisFaceSturdy(BlockGetter pLevel, BlockPos pPos, Direction pFace, SupportType pSupportType) booleanbooleanbooleanisRedstoneConductor(BlockGetter pLevel, BlockPos pPos) booleanbooleanisSolid()Deprecated.booleanbooleanisSuffocating(BlockGetter pLevel, BlockPos pPos) booleanisValidSpawn(BlockGetter pLevel, BlockPos pPos, EntityType<?> pEntityType) booleanisViewBlocking(BlockGetter pLevel, BlockPos pPos) booleanliquid()Deprecated.voidonExplosionHit(ServerLevel pLevel, BlockPos pPos, Explosion pExplosion, BiConsumer<ItemStack, BlockPos> pDropConsumer) voidonPlace(Level pLevel, BlockPos pPos, BlockState pOldState, boolean pMovedByPiston) voidonProjectileHit(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) booleanvoidrandomTick(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) booleanDeprecated.booleanbooleanbooleanskipRendering(BlockState pState, Direction pFace) voidspawnAfterBreak(ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) voidtick(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) booleantriggerEvent(Level pLevel, BlockPos pPos, int pId, int pParam) final voidupdateIndirectNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags) voidupdateIndirectNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) final voidupdateNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags) final voidupdateNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) updateShape(LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) useItemOn(ItemStack pStack, Level pLevel, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) booleanuseWithoutItem(Level pLevel, Player pPlayer, BlockHitResult pHitResult) Methods inherited from class net.minecraft.world.level.block.state.StateHolder
codec, cycle, equals, findNextInCollection, getOptionalValue, getProperties, getValue, getValueOrElse, getValues, hashCode, hasProperty, populateNeighbours, setValue, toString, trySetValue
-
Field Details
-
DIRECTIONS
-
EMPTY_OCCLUSION_SHAPES
-
FULL_BLOCK_OCCLUSION_SHAPES
-
lightEmission
private final int lightEmission -
useShapeForLightOcclusion
private final boolean useShapeForLightOcclusion -
isAir
private final boolean isAir -
ignitedByLava
private final boolean ignitedByLava -
liquid
Deprecated. -
legacySolid
Deprecated. -
pushReaction
-
mapColor
-
destroySpeed
private final float destroySpeed -
requiresCorrectToolForDrops
private final boolean requiresCorrectToolForDrops -
canOcclude
private final boolean canOcclude -
isRedstoneConductor
-
isSuffocating
-
isViewBlocking
-
hasPostProcess
-
emissiveRendering
-
offsetFunction
-
spawnTerrainParticles
private final boolean spawnTerrainParticles -
instrument
-
replaceable
private final boolean replaceable -
cache
-
fluidState
-
isRandomlyTicking
private boolean isRandomlyTicking -
solidRender
private boolean solidRender -
occlusionShape
-
occlusionShapesByFace
-
propagatesSkylightDown
private boolean propagatesSkylightDown -
lightBlock
private int lightBlock
-
-
Constructor Details
-
BlockStateBase
protected BlockStateBase(Block pOwner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> pValues, com.mojang.serialization.MapCodec<BlockState> pPropertiesCodec)
-
-
Method Details
-
calculateSolid
private boolean calculateSolid() -
initCache
public void initCache() -
getBlock
-
getBlockHolder
-
blocksMotion
Deprecated. -
isSolid
Deprecated. -
isValidSpawn
-
propagatesSkylightDown
public boolean propagatesSkylightDown() -
getLightBlock
public int getLightBlock() -
getFaceOcclusionShape
-
getOcclusionShape
-
hasLargeCollisionShape
public boolean hasLargeCollisionShape() -
useShapeForLightOcclusion
public boolean useShapeForLightOcclusion() -
getLightEmission
Deprecated.Neo: UseIBlockStateExtension.getLightEmission(BlockGetter, BlockPos)instead -
isAir
public boolean isAir() -
ignitedByLava
Deprecated.Neo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)instead -
liquid
Deprecated. -
getMapColor
-
rotate
Deprecated.- Returns:
- the blockstate with the given rotation. If inapplicable, returns itself.
-
mirror
- Returns:
- the blockstate mirrored in the given way. If inapplicable, returns itself.
-
getRenderShape
-
emissiveRendering
-
getShadeBrightness
-
isRedstoneConductor
-
isSignalSource
public boolean isSignalSource() -
getSignal
-
hasAnalogOutputSignal
public boolean hasAnalogOutputSignal() -
getAnalogOutputSignal
-
getDestroySpeed
-
getDestroyProgress
-
getDirectSignal
-
getPistonPushReaction
-
isSolidRender
public boolean isSolidRender() -
canOcclude
public boolean canOcclude() -
skipRendering
-
getShape
-
getShape
-
getCollisionShape
-
getCollisionShape
-
getEntityInsideCollisionShape
-
getBlockSupportShape
-
getVisualShape
-
getInteractionShape
-
entityCanStandOn
-
entityCanStandOnFace
public final boolean entityCanStandOnFace(BlockGetter pLevel, BlockPos pPos, Entity pEntity, Direction pFace) - Returns:
- true if the collision box of this state covers the entire upper face of the blockspace
-
getOffset
-
hasOffsetFunction
public boolean hasOffsetFunction() -
triggerEvent
-
handleNeighborChanged
public void handleNeighborChanged(Level pLevel, BlockPos pPos, Block pNeighborBlock, @Nullable Orientation pOrientation, boolean pMovedByPiston) -
updateNeighbourShapes
-
updateNeighbourShapes
public final void updateNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) -
updateIndirectNeighbourShapes
-
updateIndirectNeighbourShapes
public void updateIndirectNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) -
onPlace
-
affectNeighborsAfterRemoval
-
onExplosionHit
public void onExplosionHit(ServerLevel pLevel, BlockPos pPos, Explosion pExplosion, BiConsumer<ItemStack, BlockPos> pDropConsumer) -
tick
-
randomTick
-
entityInside
public void entityInside(Level pLevel, BlockPos pPos, Entity pEntity, InsideBlockEffectApplier pApplier, boolean pIntersects) -
spawnAfterBreak
public void spawnAfterBreak(ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) -
getDrops
-
useItemOn
public InteractionResult useItemOn(ItemStack pStack, Level pLevel, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) -
useWithoutItem
-
attack
-
isSuffocating
-
isViewBlocking
-
updateShape
public BlockState updateShape(LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) -
isPathfindable
-
canBeReplaced
-
canBeReplaced
-
canBeReplaced
public boolean canBeReplaced() -
canSurvive
-
hasPostProcess
-
getMenuProvider
-
is
-
is
-
is
-
is
-
getTags
-
hasBlockEntity
public boolean hasBlockEntity() -
shouldChangedStateKeepBlockEntity
-
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockEntityType<T> pBlockEntityType) -
is
-
is
-
getFluidState
-
isRandomlyTicking
public boolean isRandomlyTicking() -
getSeed
-
getSoundType
Deprecated. -
onProjectileHit
public void onProjectileHit(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) -
isFaceSturdy
-
isFaceSturdy
public boolean isFaceSturdy(BlockGetter pLevel, BlockPos pPos, Direction pFace, SupportType pSupportType) -
isCollisionShapeFullBlock
-
getCloneItemStack
-
asState
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops() -
shouldSpawnTerrainParticles
public boolean shouldSpawnTerrainParticles() -
instrument
-
IBlockStateExtension.getLightEmission(BlockGetter, BlockPos)instead