Package net.minecraft.block
Class AbstractBlock.AbstractBlockState
- java.lang.Object
-
- net.minecraft.state.StateHolder<Block,BlockState>
-
- net.minecraft.block.AbstractBlock.AbstractBlockState
-
- Direct Known Subclasses:
BlockState
- Enclosing class:
- AbstractBlock
public abstract static class AbstractBlock.AbstractBlockState extends StateHolder<Block,BlockState>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
AbstractBlock.AbstractBlockState.Cache
-
Field Summary
Fields Modifier and Type Field Description protected AbstractBlock.AbstractBlockState.Cache
cache
private boolean
canOcclude
private float
destroySpeed
private AbstractBlock.IPositionPredicate
emissiveRendering
private AbstractBlock.IPositionPredicate
hasPostProcess
private boolean
isAir
private AbstractBlock.IPositionPredicate
isRedstoneConductor
private AbstractBlock.IPositionPredicate
isSuffocating
private AbstractBlock.IPositionPredicate
isViewBlocking
private int
lightEmission
private Material
material
private MaterialColor
materialColor
private boolean
requiresCorrectToolForDrops
private boolean
useShapeForLightOcclusion
-
Fields inherited from class net.minecraft.state.StateHolder
owner, propertiesCodec
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBlockState(Block p_i231870_1_, com.google.common.collect.ImmutableMap<Property<?>,java.lang.Comparable<?>> p_i231870_2_, com.mojang.serialization.MapCodec<BlockState> p_i231870_3_)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract BlockState
asState()
void
attack(World p_196942_1_, BlockPos p_196942_2_, PlayerEntity p_196942_3_)
boolean
canBeReplaced(Fluid p_227032_1_)
boolean
canBeReplaced(BlockItemUseContext p_196953_1_)
boolean
canOcclude()
boolean
canSurvive(IWorldReader p_196955_1_, BlockPos p_196955_2_)
boolean
emissiveRendering(IBlockReader p_227035_1_, BlockPos p_227035_2_)
boolean
entityCanStandOn(IBlockReader p_235719_1_, BlockPos p_235719_2_, Entity p_235719_3_)
boolean
entityCanStandOnFace(IBlockReader p_215682_1_, BlockPos p_215682_2_, Entity p_215682_3_, Direction p_215682_4_)
void
entityInside(World p_196950_1_, BlockPos p_196950_2_, Entity p_196950_3_)
int
getAnalogOutputSignal(World p_185888_1_, BlockPos p_185888_2_)
Block
getBlock()
VoxelShape
getBlockSupportShape(IBlockReader p_196951_1_, BlockPos p_196951_2_)
VoxelShape
getCollisionShape(IBlockReader p_196952_1_, BlockPos p_196952_2_)
VoxelShape
getCollisionShape(IBlockReader p_215685_1_, BlockPos p_215685_2_, ISelectionContext p_215685_3_)
float
getDestroyProgress(PlayerEntity p_185903_1_, IBlockReader p_185903_2_, BlockPos p_185903_3_)
float
getDestroySpeed(IBlockReader p_185887_1_, BlockPos p_185887_2_)
int
getDirectSignal(IBlockReader p_185893_1_, BlockPos p_185893_2_, Direction p_185893_3_)
java.util.List<ItemStack>
getDrops(LootContext.Builder p_215693_1_)
VoxelShape
getFaceOcclusionShape(IBlockReader p_215702_1_, BlockPos p_215702_2_, Direction p_215702_3_)
FluidState
getFluidState()
VoxelShape
getInteractionShape(IBlockReader p_235777_1_, BlockPos p_235777_2_)
int
getLightBlock(IBlockReader p_200016_1_, BlockPos p_200016_2_)
int
getLightEmission()
Deprecated.MaterialColor
getMapColor(IBlockReader p_185909_1_, BlockPos p_185909_2_)
Material
getMaterial()
INamedContainerProvider
getMenuProvider(World p_215699_1_, BlockPos p_215699_2_)
VoxelShape
getOcclusionShape(IBlockReader p_235754_1_, BlockPos p_235754_2_)
Vector3d
getOffset(IBlockReader p_191059_1_, BlockPos p_191059_2_)
PushReaction
getPistonPushReaction()
BlockRenderType
getRenderShape()
long
getSeed(BlockPos p_209533_1_)
float
getShadeBrightness(IBlockReader p_215703_1_, BlockPos p_215703_2_)
VoxelShape
getShape(IBlockReader p_196954_1_, BlockPos p_196954_2_)
VoxelShape
getShape(IBlockReader p_215700_1_, BlockPos p_215700_2_, ISelectionContext p_215700_3_)
int
getSignal(IBlockReader p_185911_1_, BlockPos p_185911_2_, Direction p_185911_3_)
SoundType
getSoundType()
VoxelShape
getVisualShape(IBlockReader p_199611_1_, BlockPos p_199611_2_, ISelectionContext p_199611_3_)
boolean
hasAnalogOutputSignal()
boolean
hasLargeCollisionShape()
boolean
hasPostProcess(IBlockReader p_202065_1_, BlockPos p_202065_2_)
void
initCache()
boolean
is(Block p_203425_1_)
boolean
is(ITag<Block> p_235714_1_)
boolean
is(ITag<Block> p_235715_1_, java.util.function.Predicate<AbstractBlock.AbstractBlockState> p_235715_2_)
boolean
isAir()
Deprecated.useIForgeBlockState.isAir(IBlockReader, BlockPos)
until 1.17, at which point this method will be undreprecated.boolean
isCollisionShapeFullBlock(IBlockReader p_235785_1_, BlockPos p_235785_2_)
boolean
isFaceSturdy(IBlockReader p_224755_1_, BlockPos p_224755_2_, Direction p_224755_3_)
boolean
isFaceSturdy(IBlockReader p_242698_1_, BlockPos p_242698_2_, Direction p_242698_3_, BlockVoxelShape p_242698_4_)
boolean
isPathfindable(IBlockReader p_196957_1_, BlockPos p_196957_2_, PathType p_196957_3_)
boolean
isRandomlyTicking()
boolean
isRedstoneConductor(IBlockReader p_215686_1_, BlockPos p_215686_2_)
boolean
isSignalSource()
boolean
isSolidRender(IBlockReader p_200015_1_, BlockPos p_200015_2_)
boolean
isSuffocating(IBlockReader p_229980_1_, BlockPos p_229980_2_)
boolean
isValidSpawn(IBlockReader p_215688_1_, BlockPos p_215688_2_, EntityType<?> p_215688_3_)
boolean
isViewBlocking(IBlockReader p_215696_1_, BlockPos p_215696_2_)
BlockState
mirror(Mirror p_185902_1_)
void
neighborChanged(World p_215697_1_, BlockPos p_215697_2_, Block p_215697_3_, BlockPos p_215697_4_, boolean p_215697_5_)
void
onPlace(World p_215705_1_, BlockPos p_215705_2_, BlockState p_215705_3_, boolean p_215705_4_)
void
onProjectileHit(World p_215690_1_, BlockState p_215690_2_, BlockRayTraceResult p_215690_3_, ProjectileEntity p_215690_4_)
void
onRemove(World p_196947_1_, BlockPos p_196947_2_, BlockState p_196947_3_, boolean p_196947_4_)
boolean
propagatesSkylightDown(IBlockReader p_200131_1_, BlockPos p_200131_2_)
void
randomTick(ServerWorld p_227034_1_, BlockPos p_227034_2_, java.util.Random p_227034_3_)
boolean
requiresCorrectToolForDrops()
BlockState
rotate(Rotation p_185907_1_)
Deprecated.boolean
skipRendering(BlockState p_200017_1_, Direction p_200017_2_)
void
spawnAfterBreak(ServerWorld p_215706_1_, BlockPos p_215706_2_, ItemStack p_215706_3_)
void
tick(ServerWorld p_227033_1_, BlockPos p_227033_2_, java.util.Random p_227033_3_)
boolean
triggerEvent(World p_235728_1_, BlockPos p_235728_2_, int p_235728_3_, int p_235728_4_)
void
updateIndirectNeighbourShapes(IWorld p_196948_1_, BlockPos p_196948_2_, int p_196948_3_)
void
updateIndirectNeighbourShapes(IWorld p_241483_1_, BlockPos p_241483_2_, int p_241483_3_, int p_241483_4_)
void
updateNeighbourShapes(IWorld p_235734_1_, BlockPos p_235734_2_, int p_235734_3_)
void
updateNeighbourShapes(IWorld p_241482_1_, BlockPos p_241482_2_, int p_241482_3_, int p_241482_4_)
BlockState
updateShape(Direction p_196956_1_, BlockState p_196956_2_, IWorld p_196956_3_, BlockPos p_196956_4_, BlockPos p_196956_5_)
ActionResultType
use(World p_227031_1_, PlayerEntity p_227031_2_, Hand p_227031_3_, BlockRayTraceResult p_227031_4_)
boolean
useShapeForLightOcclusion()
-
Methods inherited from class net.minecraft.state.StateHolder
codec, cycle, findNextInCollection, getOptionalValue, getProperties, getValue, getValues, hasProperty, populateNeighbours, setValue, toString
-
-
-
-
Field Detail
-
lightEmission
private final int lightEmission
-
useShapeForLightOcclusion
private final boolean useShapeForLightOcclusion
-
isAir
private final boolean isAir
-
material
private final Material material
-
materialColor
private final MaterialColor materialColor
-
destroySpeed
private final float destroySpeed
-
requiresCorrectToolForDrops
private final boolean requiresCorrectToolForDrops
-
canOcclude
private final boolean canOcclude
-
isRedstoneConductor
private final AbstractBlock.IPositionPredicate isRedstoneConductor
-
isSuffocating
private final AbstractBlock.IPositionPredicate isSuffocating
-
isViewBlocking
private final AbstractBlock.IPositionPredicate isViewBlocking
-
hasPostProcess
private final AbstractBlock.IPositionPredicate hasPostProcess
-
emissiveRendering
private final AbstractBlock.IPositionPredicate emissiveRendering
-
cache
@Nullable protected AbstractBlock.AbstractBlockState.Cache cache
-
-
Constructor Detail
-
AbstractBlockState
protected AbstractBlockState(Block p_i231870_1_, com.google.common.collect.ImmutableMap<Property<?>,java.lang.Comparable<?>> p_i231870_2_, com.mojang.serialization.MapCodec<BlockState> p_i231870_3_)
-
-
Method Detail
-
initCache
public void initCache()
-
getBlock
public Block getBlock()
-
getMaterial
public Material getMaterial()
-
isValidSpawn
public boolean isValidSpawn(IBlockReader p_215688_1_, BlockPos p_215688_2_, EntityType<?> p_215688_3_)
-
propagatesSkylightDown
public boolean propagatesSkylightDown(IBlockReader p_200131_1_, BlockPos p_200131_2_)
-
getLightBlock
public int getLightBlock(IBlockReader p_200016_1_, BlockPos p_200016_2_)
-
getFaceOcclusionShape
public VoxelShape getFaceOcclusionShape(IBlockReader p_215702_1_, BlockPos p_215702_2_, Direction p_215702_3_)
-
getOcclusionShape
public VoxelShape getOcclusionShape(IBlockReader p_235754_1_, BlockPos p_235754_2_)
-
hasLargeCollisionShape
public boolean hasLargeCollisionShape()
-
useShapeForLightOcclusion
public boolean useShapeForLightOcclusion()
-
getLightEmission
@Deprecated public int getLightEmission()
Deprecated.
-
isAir
@Deprecated public boolean isAir()
Deprecated.useIForgeBlockState.isAir(IBlockReader, BlockPos)
until 1.17, at which point this method will be undreprecated. See https://github.com/MinecraftForge/MinecraftForge/issues/7409 for more details
-
getMapColor
public MaterialColor getMapColor(IBlockReader p_185909_1_, BlockPos p_185909_2_)
-
rotate
@Deprecated public BlockState rotate(Rotation p_185907_1_)
Deprecated.
-
mirror
public BlockState mirror(Mirror p_185902_1_)
-
getRenderShape
public BlockRenderType getRenderShape()
-
emissiveRendering
public boolean emissiveRendering(IBlockReader p_227035_1_, BlockPos p_227035_2_)
-
getShadeBrightness
public float getShadeBrightness(IBlockReader p_215703_1_, BlockPos p_215703_2_)
-
isRedstoneConductor
public boolean isRedstoneConductor(IBlockReader p_215686_1_, BlockPos p_215686_2_)
-
isSignalSource
public boolean isSignalSource()
-
getSignal
public int getSignal(IBlockReader p_185911_1_, BlockPos p_185911_2_, Direction p_185911_3_)
-
hasAnalogOutputSignal
public boolean hasAnalogOutputSignal()
-
getDestroySpeed
public float getDestroySpeed(IBlockReader p_185887_1_, BlockPos p_185887_2_)
-
getDestroyProgress
public float getDestroyProgress(PlayerEntity p_185903_1_, IBlockReader p_185903_2_, BlockPos p_185903_3_)
-
getDirectSignal
public int getDirectSignal(IBlockReader p_185893_1_, BlockPos p_185893_2_, Direction p_185893_3_)
-
getPistonPushReaction
public PushReaction getPistonPushReaction()
-
isSolidRender
public boolean isSolidRender(IBlockReader p_200015_1_, BlockPos p_200015_2_)
-
canOcclude
public boolean canOcclude()
-
skipRendering
public boolean skipRendering(BlockState p_200017_1_, Direction p_200017_2_)
-
getShape
public VoxelShape getShape(IBlockReader p_196954_1_, BlockPos p_196954_2_)
-
getShape
public VoxelShape getShape(IBlockReader p_215700_1_, BlockPos p_215700_2_, ISelectionContext p_215700_3_)
-
getCollisionShape
public VoxelShape getCollisionShape(IBlockReader p_196952_1_, BlockPos p_196952_2_)
-
getCollisionShape
public VoxelShape getCollisionShape(IBlockReader p_215685_1_, BlockPos p_215685_2_, ISelectionContext p_215685_3_)
-
getBlockSupportShape
public VoxelShape getBlockSupportShape(IBlockReader p_196951_1_, BlockPos p_196951_2_)
-
getVisualShape
public VoxelShape getVisualShape(IBlockReader p_199611_1_, BlockPos p_199611_2_, ISelectionContext p_199611_3_)
-
getInteractionShape
public VoxelShape getInteractionShape(IBlockReader p_235777_1_, BlockPos p_235777_2_)
-
entityCanStandOn
public final boolean entityCanStandOn(IBlockReader p_235719_1_, BlockPos p_235719_2_, Entity p_235719_3_)
-
entityCanStandOnFace
public final boolean entityCanStandOnFace(IBlockReader p_215682_1_, BlockPos p_215682_2_, Entity p_215682_3_, Direction p_215682_4_)
-
getOffset
public Vector3d getOffset(IBlockReader p_191059_1_, BlockPos p_191059_2_)
-
triggerEvent
public boolean triggerEvent(World p_235728_1_, BlockPos p_235728_2_, int p_235728_3_, int p_235728_4_)
-
neighborChanged
public void neighborChanged(World p_215697_1_, BlockPos p_215697_2_, Block p_215697_3_, BlockPos p_215697_4_, boolean p_215697_5_)
-
updateNeighbourShapes
public final void updateNeighbourShapes(IWorld p_235734_1_, BlockPos p_235734_2_, int p_235734_3_)
-
updateNeighbourShapes
public final void updateNeighbourShapes(IWorld p_241482_1_, BlockPos p_241482_2_, int p_241482_3_, int p_241482_4_)
-
updateIndirectNeighbourShapes
public final void updateIndirectNeighbourShapes(IWorld p_196948_1_, BlockPos p_196948_2_, int p_196948_3_)
-
updateIndirectNeighbourShapes
public void updateIndirectNeighbourShapes(IWorld p_241483_1_, BlockPos p_241483_2_, int p_241483_3_, int p_241483_4_)
-
onPlace
public void onPlace(World p_215705_1_, BlockPos p_215705_2_, BlockState p_215705_3_, boolean p_215705_4_)
-
onRemove
public void onRemove(World p_196947_1_, BlockPos p_196947_2_, BlockState p_196947_3_, boolean p_196947_4_)
-
tick
public void tick(ServerWorld p_227033_1_, BlockPos p_227033_2_, java.util.Random p_227033_3_)
-
randomTick
public void randomTick(ServerWorld p_227034_1_, BlockPos p_227034_2_, java.util.Random p_227034_3_)
-
spawnAfterBreak
public void spawnAfterBreak(ServerWorld p_215706_1_, BlockPos p_215706_2_, ItemStack p_215706_3_)
-
getDrops
public java.util.List<ItemStack> getDrops(LootContext.Builder p_215693_1_)
-
use
public ActionResultType use(World p_227031_1_, PlayerEntity p_227031_2_, Hand p_227031_3_, BlockRayTraceResult p_227031_4_)
-
attack
public void attack(World p_196942_1_, BlockPos p_196942_2_, PlayerEntity p_196942_3_)
-
isSuffocating
public boolean isSuffocating(IBlockReader p_229980_1_, BlockPos p_229980_2_)
-
isViewBlocking
public boolean isViewBlocking(IBlockReader p_215696_1_, BlockPos p_215696_2_)
-
updateShape
public BlockState updateShape(Direction p_196956_1_, BlockState p_196956_2_, IWorld p_196956_3_, BlockPos p_196956_4_, BlockPos p_196956_5_)
-
isPathfindable
public boolean isPathfindable(IBlockReader p_196957_1_, BlockPos p_196957_2_, PathType p_196957_3_)
-
canBeReplaced
public boolean canBeReplaced(BlockItemUseContext p_196953_1_)
-
canBeReplaced
public boolean canBeReplaced(Fluid p_227032_1_)
-
canSurvive
public boolean canSurvive(IWorldReader p_196955_1_, BlockPos p_196955_2_)
-
hasPostProcess
public boolean hasPostProcess(IBlockReader p_202065_1_, BlockPos p_202065_2_)
-
getMenuProvider
@Nullable public INamedContainerProvider getMenuProvider(World p_215699_1_, BlockPos p_215699_2_)
-
is
public boolean is(ITag<Block> p_235715_1_, java.util.function.Predicate<AbstractBlock.AbstractBlockState> p_235715_2_)
-
is
public boolean is(Block p_203425_1_)
-
getFluidState
public FluidState getFluidState()
-
isRandomlyTicking
public boolean isRandomlyTicking()
-
getSeed
public long getSeed(BlockPos p_209533_1_)
-
getSoundType
public SoundType getSoundType()
-
onProjectileHit
public void onProjectileHit(World p_215690_1_, BlockState p_215690_2_, BlockRayTraceResult p_215690_3_, ProjectileEntity p_215690_4_)
-
isFaceSturdy
public boolean isFaceSturdy(IBlockReader p_224755_1_, BlockPos p_224755_2_, Direction p_224755_3_)
-
isFaceSturdy
public boolean isFaceSturdy(IBlockReader p_242698_1_, BlockPos p_242698_2_, Direction p_242698_3_, BlockVoxelShape p_242698_4_)
-
isCollisionShapeFullBlock
public boolean isCollisionShapeFullBlock(IBlockReader p_235785_1_, BlockPos p_235785_2_)
-
asState
protected abstract BlockState asState()
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops()
-
-