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 pOwner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> pValues, com.mojang.serialization.MapCodec<BlockState> pPropertiesCodec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockStateasState()voidbooleanDeprecated.private booleanbooleanbooleancanBeReplaced(BlockPlaceContext pUseContext) booleancanBeReplaced(Fluid pFluid) booleanbooleancanSurvive(LevelReader pLevel, BlockPos pPos) booleanemissiveRendering(BlockGetter pLevel, BlockPos pPos) final booleanentityCanStandOn(BlockGetter pLevel, BlockPos pPos, Entity pEntity) final booleanentityCanStandOnFace(BlockGetter pLevel, BlockPos pPos, Entity pEntity, Direction pFace) voidentityInside(Level pLevel, BlockPos pPos, Entity pEntity) intgetAnalogOutputSignal(Level pLevel, BlockPos pPos) getBlock()getBlockSupportShape(BlockGetter pLevel, BlockPos pPos) getCollisionShape(BlockGetter pLevel, BlockPos pPos) getCollisionShape(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) floatgetDestroyProgress(Player pPlayer, BlockGetter pLevel, BlockPos pPos) floatgetDestroySpeed(BlockGetter pLevel, BlockPos pPos) intgetDirectSignal(BlockGetter pLevel, BlockPos pPos, Direction pDirection) getDrops(LootParams.Builder pLootParams) getFaceOcclusionShape(BlockGetter pLevel, BlockPos pPos, Direction pDirection) getInteractionShape(BlockGetter pLevel, BlockPos pPos) intgetLightBlock(BlockGetter pLevel, BlockPos pPos) intDeprecated.getMapColor(BlockGetter pLevel, BlockPos pPos) getMenuProvider(Level pLevel, BlockPos pPos) getOcclusionShape(BlockGetter pLevel, BlockPos pPos) getOffset(BlockGetter pLevel, BlockPos pPos) longfloatgetShadeBrightness(BlockGetter pLevel, BlockPos pPos) getShape(BlockGetter pLevel, BlockPos pPos) getShape(BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) intgetSignal(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) voidhandleNeighborChanged(Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) booleanbooleanbooleanbooleanbooleanhasPostProcess(BlockGetter pLevel, BlockPos pPos) booleanDeprecated.Neo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadvoidbooleanbooleanbooleanis(ResourceKey<Block> pBlock) booleanbooleanis(TagKey<Block> pTag, Predicate<BlockBehaviour.BlockStateBase> pPredicate) booleanbooleanisAir()booleanisCollisionShapeFullBlock(BlockGetter pLevel, BlockPos pPos) booleanisFaceSturdy(BlockGetter pLevel, BlockPos pPos, Direction pDirection) booleanisFaceSturdy(BlockGetter pLevel, BlockPos pPos, Direction pFace, SupportType pSupportType) booleanisPathfindable(PathComputationType p_60650_) booleanbooleanisRedstoneConductor(BlockGetter pLevel, BlockPos pPos) booleanbooleanisSolid()Deprecated.booleanisSolidRender(BlockGetter pLevel, BlockPos pPos) booleanisSuffocating(BlockGetter pLevel, BlockPos pPos) booleanisValidSpawn(BlockGetter pLevel, BlockPos pPos, EntityType<?> pEntityType) booleanisViewBlocking(BlockGetter pLevel, BlockPos pPos) booleanliquid()Deprecated.voidonExplosionHit(Level pLevel, BlockPos pPos, Explosion pExplosion, BiConsumer<ItemStack, BlockPos> pDropConsumer) voidonPlace(Level pLevel, BlockPos pPos, BlockState pOldState, boolean pMovedByPiston) voidonProjectileHit(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) voidonRemove(Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) booleanpropagatesSkylightDown(BlockGetter pLevel, BlockPos pPos) voidrandomTick(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) booleanDeprecated.booleanbooleanskipRendering(BlockState pState, Direction pFace) voidspawnAfterBreak(ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) voidtick(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) booleantriggerEvent(Level pLevel, BlockPos pPos, int pId, int pParam) final voidupdateIndirectNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags) voidupdateIndirectNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) final voidupdateNeighbourShapes(LevelAccessor pLevel, BlockPos pPos, int pFlags) final voidupdateNeighbourShapes(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) booleanuseWithoutItem(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 pOwner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> pValues, com.mojang.serialization.MapCodec<BlockState> pPropertiesCodec)
-
-
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
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
-
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