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 owner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> values, com.mojang.serialization.MapCodec<BlockState> propertiesCodec) -
Method Summary
Modifier and TypeMethodDescriptionvoidaffectNeighborsAfterRemoval(ServerLevel level, BlockPos pos, boolean movedByPiston) protected abstract BlockStateasState()voidbooleanDeprecated.private booleanbooleanbooleancanBeReplaced(BlockPlaceContext useContext) booleancanBeReplaced(Fluid fluid) booleanbooleancanSurvive(LevelReader level, BlockPos pos) booleanemissiveRendering(BlockGetter level, BlockPos pos) final booleanentityCanStandOn(BlockGetter level, BlockPos pos, Entity entity) final booleanentityCanStandOnFace(BlockGetter level, BlockPos pos, Entity entity, Direction face) voidentityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) intgetAnalogOutputSignal(Level level, BlockPos pos) getBlock()getBlockSupportShape(BlockGetter level, BlockPos pos) getCloneItemStack(LevelReader level, BlockPos pos, boolean includeData) getCollisionShape(BlockGetter level, BlockPos pos) getCollisionShape(BlockGetter level, BlockPos pos, CollisionContext context) floatgetDestroyProgress(Player player, BlockGetter level, BlockPos pos) floatgetDestroySpeed(BlockGetter level, BlockPos pos) intgetDirectSignal(BlockGetter level, BlockPos pos, Direction direction) getDrops(LootParams.Builder lootParams) getEntityInsideCollisionShape(BlockGetter level, BlockPos pos, Entity entity) getInteractionShape(BlockGetter level, BlockPos pos) intintDeprecated.getMapColor(BlockGetter level, BlockPos pos) getMenuProvider(Level level, BlockPos pos) longfloatgetShadeBrightness(BlockGetter level, BlockPos pos) getShape(BlockGetter level, BlockPos pos) getShape(BlockGetter level, BlockPos pos, CollisionContext context) intgetSignal(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) voidhandleNeighborChanged(Level level, BlockPos pos, Block neighborBlock, Orientation orientation, boolean movedByPiston) booleanbooleanbooleanbooleanbooleanhasPostProcess(BlockGetter level, BlockPos pos) booleanvoidbooleanbooleanbooleanis(ResourceKey<Block> block) booleanbooleanis(TagKey<Block> tag, Predicate<BlockBehaviour.BlockStateBase> predicate) booleanbooleanisAir()booleanisCollisionShapeFullBlock(BlockGetter level, BlockPos pos) booleanisFaceSturdy(BlockGetter level, BlockPos pos, Direction direction) booleanisFaceSturdy(BlockGetter level, BlockPos pos, Direction face, SupportType supportType) booleanbooleanbooleanisRedstoneConductor(BlockGetter level, BlockPos pos) booleanbooleanisSolid()Deprecated.booleanbooleanisSuffocating(BlockGetter level, BlockPos pos) booleanisValidSpawn(BlockGetter level, BlockPos pos, EntityType<?> entityType) booleanisViewBlocking(BlockGetter level, BlockPos pos) booleanliquid()Deprecated.voidonExplosionHit(ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> dropConsumer) voidonPlace(Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) voidonProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) booleanvoidrandomTick(ServerLevel level, BlockPos pos, RandomSource random) booleanDeprecated.booleanbooleanskipRendering(BlockState state, Direction face) voidspawnAfterBreak(ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) voidtick(ServerLevel level, BlockPos pos, RandomSource random) booleantriggerEvent(Level level, BlockPos pos, int id, int param) final voidupdateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int flags) voidupdateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) final voidupdateNeighbourShapes(LevelAccessor level, BlockPos pos, int flags) final voidupdateNeighbourShapes(LevelAccessor level, BlockPos pos, int flags, int recursionLeft) updateShape(LevelReader level, ScheduledTickAccess scheduledTickAccess, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) useItemOn(ItemStack stack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) booleanuseWithoutItem(Level level, Player player, BlockHitResult hitResult) 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 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
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
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
public boolean isSolidRender() -
canOcclude
public boolean canOcclude() -
skipRendering
-
getShape
-
getShape
-
getCollisionShape
-
getCollisionShape
-
getEntityInsideCollisionShape
-
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
public void handleNeighborChanged(Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) -
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
-
affectNeighborsAfterRemoval
-
onExplosionHit
public void onExplosionHit(ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> dropConsumer) -
tick
-
randomTick
-
entityInside
public void entityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) -
spawnAfterBreak
public void spawnAfterBreak(ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) -
getDrops
-
useItemOn
public InteractionResult useItemOn(ItemStack stack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) -
useWithoutItem
-
attack
-
isSuffocating
-
isViewBlocking
-
updateShape
public BlockState updateShape(LevelReader level, ScheduledTickAccess scheduledTickAccess, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) -
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
-
getCloneItemStack
-
asState
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops() -
shouldSpawnTerrainParticles
public boolean shouldSpawnTerrainParticles() -
instrument
-
IBlockStateExtension.getLightEmission(BlockGetter, BlockPos)instead