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 TypeFieldDescriptionprotected BlockBehaviour.BlockStateBase.Cache
private final boolean
private final float
private final BlockBehaviour.StatePredicate
private FluidState
private final BlockBehaviour.StatePredicate
private final boolean
private final NoteBlockInstrument
private final boolean
private boolean
private final BlockBehaviour.StatePredicate
private final BlockBehaviour.StatePredicate
private final BlockBehaviour.StatePredicate
private boolean
Deprecated.private final int
private final boolean
Deprecated.private final MapColor
private final BlockBehaviour.OffsetFunction
private final PushReaction
private final boolean
private final boolean
private final boolean
private final boolean
Fields inherited from class net.minecraft.world.level.block.state.StateHolder
NAME_TAG, owner, PROPERTIES_TAG, propertiesCodec
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BlockStateBase
(Block owner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> values, com.mojang.serialization.MapCodec<BlockState> propertiesCodec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockState
asState()
void
boolean
Deprecated.private boolean
boolean
boolean
canBeReplaced
(BlockPlaceContext useContext) boolean
canBeReplaced
(Fluid fluid) boolean
boolean
canSurvive
(LevelReader level, BlockPos pos) boolean
emissiveRendering
(BlockGetter level, BlockPos pos) final boolean
entityCanStandOn
(BlockGetter level, BlockPos pos, Entity entity) final boolean
entityCanStandOnFace
(BlockGetter level, BlockPos pos, Entity entity, Direction face) void
entityInside
(Level level, BlockPos pos, Entity entity) int
getAnalogOutputSignal
(Level level, BlockPos pos) getBlock()
getBlockSupportShape
(BlockGetter level, BlockPos pos) getCollisionShape
(BlockGetter level, BlockPos pos) getCollisionShape
(BlockGetter level, BlockPos pos, CollisionContext context) float
getDestroyProgress
(Player player, BlockGetter level, BlockPos pos) float
getDestroySpeed
(BlockGetter level, BlockPos pos) int
getDirectSignal
(BlockGetter level, BlockPos pos, Direction direction) getDrops
(LootParams.Builder lootParams) getFaceOcclusionShape
(BlockGetter level, BlockPos pos, Direction direction) getInteractionShape
(BlockGetter level, BlockPos pos) int
getLightBlock
(BlockGetter level, BlockPos pos) int
Deprecated.getMapColor
(BlockGetter level, BlockPos pos) getMenuProvider
(Level level, BlockPos pos) getOcclusionShape
(BlockGetter level, BlockPos pos) getOffset
(BlockGetter level, BlockPos pos) long
float
getShadeBrightness
(BlockGetter level, BlockPos pos) getShape
(BlockGetter level, BlockPos pos) getShape
(BlockGetter level, BlockPos pos, CollisionContext context) int
getSignal
(BlockGetter level, BlockPos pos, Direction direction) Deprecated.getTags()
<T extends BlockEntity>
BlockEntityTicker<T> getTicker
(Level level, BlockEntityType<T> blockEntityType) getVisualShape
(BlockGetter level, BlockPos pos, CollisionContext context) void
handleNeighborChanged
(Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) boolean
boolean
boolean
boolean
boolean
hasPostProcess
(BlockGetter level, BlockPos pos) boolean
void
boolean
boolean
boolean
is
(ResourceKey<Block> block) boolean
boolean
is
(TagKey<Block> tag, Predicate<BlockBehaviour.BlockStateBase> predicate) boolean
boolean
isAir()
boolean
isCollisionShapeFullBlock
(BlockGetter level, BlockPos pos) boolean
isFaceSturdy
(BlockGetter level, BlockPos pos, Direction direction) boolean
isFaceSturdy
(BlockGetter level, BlockPos pos, Direction face, SupportType supportType) boolean
isPathfindable
(PathComputationType p_60650_) boolean
boolean
isRedstoneConductor
(BlockGetter level, BlockPos pos) boolean
boolean
isSolid()
Deprecated.boolean
isSolidRender
(BlockGetter level, BlockPos pos) boolean
isSuffocating
(BlockGetter level, BlockPos pos) boolean
isValidSpawn
(BlockGetter level, BlockPos pos, EntityType<?> entityType) boolean
isViewBlocking
(BlockGetter level, BlockPos pos) boolean
liquid()
Deprecated.void
onExplosionHit
(Level level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> dropConsumer) void
onPlace
(Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) void
onProjectileHit
(Level level, BlockState state, BlockHitResult hit, Projectile projectile) void
onRemove
(Level level, BlockPos pos, BlockState newState, boolean movedByPiston) boolean
propagatesSkylightDown
(BlockGetter level, BlockPos pos) void
randomTick
(ServerLevel level, BlockPos pos, RandomSource random) boolean
Deprecated.boolean
boolean
skipRendering
(BlockState state, Direction face) void
spawnAfterBreak
(ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) void
tick
(ServerLevel level, BlockPos pos, RandomSource random) boolean
triggerEvent
(Level level, BlockPos pos, int id, int param) final void
updateIndirectNeighbourShapes
(LevelAccessor level, BlockPos pos, int flags) void
updateIndirectNeighbourShapes
(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) final void
updateNeighbourShapes
(LevelAccessor level, BlockPos pos, int flags) final void
updateNeighbourShapes
(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) updateShape
(Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) useItemOn
(ItemStack stack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) boolean
useWithoutItem
(Level level, Player player, BlockHitResult hitResult) Methods inherited from class net.minecraft.world.level.block.state.StateHolder
codec, cycle, findNextInCollection, getOptionalValue, getProperties, getValue, getValues, hasProperty, populateNeighbours, setValue, toString, trySetValue
-
Field Details
-
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
-
-
Constructor Details
-
BlockStateBase
protected BlockStateBase(Block owner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> values, com.mojang.serialization.MapCodec<BlockState> propertiesCodec)
-
-
Method Details
-
calculateSolid
private boolean calculateSolid() -
initCache
public void initCache() -
getBlock
-
getBlockHolder
-
blocksMotion
Deprecated. -
isSolid
Deprecated. -
isValidSpawn
-
propagatesSkylightDown
-
getLightBlock
-
getFaceOcclusionShape
-
getOcclusionShape
-
hasLargeCollisionShape
public boolean hasLargeCollisionShape() -
useShapeForLightOcclusion
public boolean useShapeForLightOcclusion() -
getLightEmission
Deprecated.Forge: UseIBlockStateExtension.getLightEmission(BlockGetter, BlockPos)
instead -
isAir
public boolean isAir() -
ignitedByLava
public boolean ignitedByLava() -
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
-
canOcclude
public boolean canOcclude() -
skipRendering
-
getShape
-
getShape
-
getCollisionShape
-
getCollisionShape
-
getBlockSupportShape
-
getVisualShape
-
getInteractionShape
-
entityCanStandOn
-
entityCanStandOnFace
public final boolean entityCanStandOnFace(BlockGetter level, BlockPos pos, Entity entity, Direction face) - Returns:
- true if the collision box of this state covers the entire upper face of the blockspace
-
getOffset
-
hasOffsetFunction
public boolean hasOffsetFunction() -
triggerEvent
-
handleNeighborChanged
-
updateNeighbourShapes
-
updateNeighbourShapes
public final void updateNeighbourShapes(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) -
updateIndirectNeighbourShapes
-
updateIndirectNeighbourShapes
public void updateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) -
onPlace
-
onRemove
-
onExplosionHit
-
tick
-
randomTick
-
entityInside
-
spawnAfterBreak
public void spawnAfterBreak(ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) -
getDrops
-
useItemOn
public ItemInteractionResult useItemOn(ItemStack stack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) -
useWithoutItem
-
attack
-
isSuffocating
-
isViewBlocking
-
updateShape
public BlockState updateShape(Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) -
isPathfindable
-
canBeReplaced
-
canBeReplaced
-
canBeReplaced
public boolean canBeReplaced() -
canSurvive
-
hasPostProcess
-
getMenuProvider
-
is
-
is
-
is
-
is
-
getTags
-
hasBlockEntity
public boolean hasBlockEntity() -
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockEntityType<T> blockEntityType) -
is
-
is
-
getFluidState
-
isRandomlyTicking
public boolean isRandomlyTicking() -
getSeed
-
getSoundType
Deprecated. -
onProjectileHit
public void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) -
isFaceSturdy
-
isFaceSturdy
public boolean isFaceSturdy(BlockGetter level, BlockPos pos, Direction face, SupportType supportType) -
isCollisionShapeFullBlock
-
asState
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops() -
shouldSpawnTerrainParticles
public boolean shouldSpawnTerrainParticles() -
instrument
-
IBlockStateExtension.getLightEmission(BlockGetter, BlockPos)
instead