Class BlockBehaviour.BlockStateBase
java.lang.Object
net.minecraft.world.level.block.state.StateHolder<Block, BlockState>
net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase
- All Implemented Interfaces:
TypedInstance<Block>
- Direct Known Subclasses:
BlockState
- Enclosing class:
BlockBehaviour
public abstract static class BlockBehaviour.BlockStateBase
extends StateHolder<Block, BlockState>
implements TypedInstance<Block>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable BlockBehaviour.BlockStateBase.Cacheprivate 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 @Nullable BlockBehaviour.OffsetFunctionprivate booleanprivate final PushReactionprivate final booleanprivate final booleanprivate booleanprivate final booleanprivate final booleanFields inherited from class 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 context) 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 faceDirection) voidentityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier, boolean isPrecise) intgetAnalogOutputSignal(Level level, BlockPos pos, Direction direction) 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 params) getEntityInsideCollisionShape(BlockGetter level, BlockPos pos, Entity entity) getFaceOcclusionShape(Direction direction) getInteractionShape(BlockGetter level, BlockPos pos) intintDeprecated.getMapColor(BlockGetter level, BlockPos pos) @Nullable MenuProvidergetMenuProvider(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.<T extends BlockEntity>
@Nullable BlockEntityTicker<T> getTicker(Level level, BlockEntityType<T> type) getVisualShape(BlockGetter level, BlockPos pos, CollisionContext context) voidhandleNeighborChanged(Level level, BlockPos pos, Block block, @Nullable Orientation orientation, boolean movedByPiston) booleanbooleanbooleanbooleanbooleanhasPostProcess(BlockGetter level, BlockPos pos) booleanDeprecated.Neo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadvoidbooleanis(TagKey<Block> tag, Predicate<BlockBehaviour.BlockStateBase> predicate) booleanisAir()booleanisCollisionShapeFullBlock(BlockGetter level, BlockPos pos) booleanisFaceSturdy(BlockGetter level, BlockPos pos, Direction direction) booleanisFaceSturdy(BlockGetter level, BlockPos pos, Direction direction, SupportType supportType) booleanbooleanbooleanisRedstoneConductor(BlockGetter level, BlockPos pos) booleanbooleanisSolid()Deprecated.booleanbooleanisSuffocating(BlockGetter level, BlockPos pos) booleanisValidSpawn(BlockGetter level, BlockPos pos, EntityType<?> type) booleanisViewBlocking(BlockGetter level, BlockPos pos) booleanliquid()Deprecated.voidonExplosionHit(ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> onHit) voidonPlace(Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) voidonProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile entity) booleanvoidrandomTick(ServerLevel level, BlockPos pos, RandomSource random) booleanDeprecated.booleanshouldChangedStateKeepBlockEntity(BlockState oldState) booleanbooleanskipRendering(BlockState neighborState, Direction direction) voidspawnAfterBreak(ServerLevel level, BlockPos pos, ItemStack tool, boolean dropExperience) voidtick(ServerLevel level, BlockPos pos, RandomSource random) booleantriggerEvent(Level level, BlockPos pos, int b0, int b1) final voidupdateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags) voidupdateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) final voidupdateNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags) final voidupdateNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) updateShape(LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) useItemOn(ItemStack itemStack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) booleanuseWithoutItem(Level level, Player player, BlockHitResult hitResult) Methods inherited from class 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
-
typeHolder
- Specified by:
typeHolderin interfaceTypedInstance<Block>
-
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 level, BlockPos pos, Entity entity, Direction faceDirection) - 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 block, @Nullable Orientation orientation, boolean movedByPiston) -
updateNeighbourShapes
-
updateNeighbourShapes
public final void updateNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) -
updateIndirectNeighbourShapes
-
updateIndirectNeighbourShapes
public void updateIndirectNeighbourShapes(LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) -
onPlace
-
affectNeighborsAfterRemoval
-
onExplosionHit
public void onExplosionHit(ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> onHit) -
tick
-
randomTick
-
entityInside
public void entityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier, boolean isPrecise) -
spawnAfterBreak
public void spawnAfterBreak(ServerLevel level, BlockPos pos, ItemStack tool, boolean dropExperience) -
getDrops
-
useItemOn
public InteractionResult useItemOn(ItemStack itemStack, Level level, Player player, InteractionHand hand, BlockHitResult hitResult) -
useWithoutItem
-
attack
-
isSuffocating
-
isViewBlocking
-
updateShape
public BlockState updateShape(LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) -
isPathfindable
-
canBeReplaced
-
canBeReplaced
-
canBeReplaced
public boolean canBeReplaced() -
canSurvive
-
hasPostProcess
-
getMenuProvider
-
is
-
hasBlockEntity
public boolean hasBlockEntity() -
shouldChangedStateKeepBlockEntity
-
getTicker
public <T extends BlockEntity> @Nullable BlockEntityTicker<T> getTicker(Level level, BlockEntityType<T> type) -
getFluidState
-
isRandomlyTicking
public boolean isRandomlyTicking() -
getSeed
-
getSoundType
Deprecated. -
onProjectileHit
public void onProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile entity) -
isFaceSturdy
-
isFaceSturdy
public boolean isFaceSturdy(BlockGetter level, BlockPos pos, Direction direction, SupportType supportType) -
isCollisionShapeFullBlock
-
getCloneItemStack
-
asState
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops() -
shouldSpawnTerrainParticles
public boolean shouldSpawnTerrainParticles() -
instrument
-
IBlockStateExtension.getLightEmission(BlockGetter, BlockPos)instead