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.Cacheprivate final booleanprivate final floatprivate final BlockBehaviour.StatePredicateprivate FluidStateprivate final BlockBehaviour.StatePredicateprivate final booleanprivate final NoteBlockInstrumentprivate final booleanprivate booleanprivate final BlockBehaviour.StatePredicateprivate final BlockBehaviour.StatePredicateprivate final BlockBehaviour.StatePredicateprivate booleanDeprecated.private final intprivate final booleanDeprecated.private final MapColorprivate final BlockBehaviour.OffsetFunctionprivate final PushReactionprivate final booleanprivate final 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 TypeMethodDescriptionprotected 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) intgetAnalogOutputSignal(Level level, BlockPos pos) getBlock()getBlockSupportShape(BlockGetter level, BlockPos pos) 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) getFaceOcclusionShape(BlockGetter level, BlockPos pos, Direction direction) getInteractionShape(BlockGetter level, BlockPos pos) intgetLightBlock(BlockGetter level, BlockPos pos) intDeprecated.getMapColor(BlockGetter level, BlockPos pos) getMenuProvider(Level level, BlockPos pos) getOcclusionShape(BlockGetter level, BlockPos pos) getOffset(BlockGetter 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 block, BlockPos fromPos, boolean isMoving) 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) booleanisPathfindable(PathComputationType p_60650_) booleanbooleanisRedstoneConductor(BlockGetter level, BlockPos pos) booleanbooleanisSolid()Deprecated.booleanisSolidRender(BlockGetter level, BlockPos pos) booleanisSuffocating(BlockGetter level, BlockPos pos) booleanisValidSpawn(BlockGetter level, BlockPos pos, EntityType<?> entityType) booleanisViewBlocking(BlockGetter level, BlockPos pos) booleanliquid()Deprecated.voidonExplosionHit(Level 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) voidonRemove(Level level, BlockPos pos, BlockState newState, boolean movedByPiston) booleanpropagatesSkylightDown(BlockGetter level, BlockPos pos) voidrandomTick(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(Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) 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, 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