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 p_60608_, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> p_326208_, com.mojang.serialization.MapCodec<BlockState> p_60610_) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockState
asState()
void
boolean
Deprecated.private boolean
boolean
boolean
canBeReplaced
(BlockPlaceContext pUseContext) boolean
canBeReplaced
(Fluid pFluid) boolean
boolean
canSurvive
(LevelReader pLevel, BlockPos pPos) boolean
emissiveRendering
(BlockGetter pLevel, BlockPos pPos) final boolean
entityCanStandOn
(BlockGetter pLevel, BlockPos pPos, Entity pEntity) final boolean
entityCanStandOnFace
(BlockGetter pLevel, BlockPos pPos, Entity pEntity, Direction pFace) void
entityInside
(Level pLevel, BlockPos pPos, Entity pEntity) int
getAnalogOutputSignal
(Level pLevel, BlockPos pPos) getBlock()
getBlockSupportShape
(BlockGetter pLevel, BlockPos pPos) getCollisionShape
(BlockGetter pLevel, BlockPos pPos) getCollisionShape
(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) float
getDestroyProgress
(Player pPlayer, BlockGetter pLevel, BlockPos pPos) float
getDestroySpeed
(BlockGetter pLevel, BlockPos pPos) int
getDirectSignal
(BlockGetter pLevel, BlockPos pPos, Direction pDirection) getDrops
(LootParams.Builder pLootParams) getFaceOcclusionShape
(BlockGetter pLevel, BlockPos pPos, Direction pDirection) getInteractionShape
(BlockGetter pLevel, BlockPos pPos) int
getLightBlock
(BlockGetter pLevel, BlockPos pPos) int
Deprecated.getMapColor
(BlockGetter pLevel, BlockPos pPos) getMenuProvider
(Level pLevel, BlockPos pPos) getOcclusionShape
(BlockGetter pLevel, BlockPos pPos) getOffset
(BlockGetter pLevel, BlockPos pPos) long
float
getShadeBrightness
(BlockGetter pLevel, BlockPos pPos) getShape
(BlockGetter pLevel, BlockPos pPos) getShape
(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) int
getSignal
(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) void
handleNeighborChanged
(Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) boolean
boolean
boolean
boolean
boolean
hasPostProcess
(BlockGetter pLevel, BlockPos pPos) boolean
void
boolean
boolean
boolean
is
(ResourceKey<Block> pBlock) boolean
boolean
is
(TagKey<Block> pTag, Predicate<BlockBehaviour.BlockStateBase> pPredicate) boolean
boolean
isAir()
boolean
isCollisionShapeFullBlock
(BlockGetter pLevel, BlockPos pPos) boolean
isFaceSturdy
(BlockGetter pLevel, BlockPos pPos, Direction pDirection) boolean
isFaceSturdy
(BlockGetter pLevel, BlockPos pPos, Direction pFace, SupportType pSupportType) boolean
isPathfindable
(PathComputationType p_60650_) boolean
boolean
isRedstoneConductor
(BlockGetter pLevel, BlockPos pPos) boolean
boolean
isSolid()
Deprecated.boolean
isSolidRender
(BlockGetter pLevel, BlockPos pPos) boolean
isSuffocating
(BlockGetter pLevel, BlockPos pPos) boolean
isValidSpawn
(BlockGetter pLevel, BlockPos pPos, EntityType<?> pEntityType) boolean
isViewBlocking
(BlockGetter pLevel, BlockPos pPos) boolean
liquid()
Deprecated.void
onExplosionHit
(Level pLevel, BlockPos pPos, Explosion pExplosion, BiConsumer<ItemStack, BlockPos> pDropConsumer) void
onPlace
(Level pLevel, BlockPos pPos, BlockState pOldState, boolean pMovedByPiston) void
onProjectileHit
(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) void
onRemove
(Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) boolean
propagatesSkylightDown
(BlockGetter pLevel, BlockPos pPos) void
randomTick
(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) boolean
Deprecated.boolean
boolean
skipRendering
(BlockState pState, Direction pFace) void
spawnAfterBreak
(ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) void
tick
(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) boolean
triggerEvent
(Level pLevel, BlockPos pPos, int pId, int pParam) final void
updateIndirectNeighbourShapes
(LevelAccessor pLevel, BlockPos pPos, int pFlags) void
updateIndirectNeighbourShapes
(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) final void
updateNeighbourShapes
(LevelAccessor pLevel, BlockPos pPos, int pFlags) final void
updateNeighbourShapes
(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) updateShape
(Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) useItemOn
(ItemStack pStack, Level pLevel, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) boolean
useWithoutItem
(Level pLevel, Player pPlayer, BlockHitResult pHitResult) 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 p_60608_, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> p_326208_, com.mojang.serialization.MapCodec<BlockState> p_60610_)
-
-
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 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
-
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
-
onRemove
-
onExplosionHit
-
tick
-
randomTick
-
entityInside
-
spawnAfterBreak
public void spawnAfterBreak(ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) -
getDrops
-
useItemOn
public ItemInteractionResult useItemOn(ItemStack pStack, Level pLevel, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) -
useWithoutItem
-
attack
-
isSuffocating
-
isViewBlocking
-
updateShape
public BlockState updateShape(Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) -
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 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
-
asState
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops() -
shouldSpawnTerrainParticles
public boolean shouldSpawnTerrainParticles() -
instrument
-
IBlockStateExtension.getLightEmission(BlockGetter, BlockPos)
instead