Package net.minecraft.world.level.block
Class Block
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<Block>
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
- All Implemented Interfaces:
ItemLike
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
AbstractCandleBlock
,AbstractCauldronBlock
,AirBlock
,AmethystBlock
,BambooBlock
,BambooSaplingBlock
,BarrierBlock
,BaseCoralPlantTypeBlock
,BaseEntityBlock
,BaseFireBlock
,BasePressurePlateBlock
,BaseRailBlock
,BlockEntityOnLoadTest.TestBlock
,BlockStateChangeTest.TestBlock
,BubbleColumnBlock
,BushBlock
,CactusBlock
,CakeBlock
,CarpetBlock
,CartographyTableBlock
,ChorusFlowerBlock
,ComposterBlock
,CoralBlock
,CraftingTableBlock
,CrossCollisionBlock
,CryingObsidianBlock
,CustomPlantTypeTest.CustomBlock
,CustomRespawnTest.CustomRespawnBlock
,DirectionalBlock
,DirtPathBlock
,DoorBlock
,DynamicMapColorTest.TestBlock
,EndPortalFrameBlock
,FallingBlock
,FarmBlock
,FlowerPotBlock
,ForgeChunkManagerTest.ChunkLoaderBlock
,FullPotsAccessorDemo.DioriteFlowerPotBlock
,GameTestTest.EnergyBlock
,GrowingPlantBlock
,HalfTransparentBlock
,HangingRootsBlock
,HorizontalDirectionalBlock
,HugeMushroomBlock
,InfestedBlock
,JigsawBlock
,LadderBlock
,LanternBlock
,LeavesBlock
,LightBlock
,LiquidBlock
,MagmaBlock
,MossBlock
,MultifaceBlock
,NetherPortalBlock
,NetherrackBlock
,NewFluidTest.FluidloggableBlock
,NoteBlock
,NyliumBlock
,OreBlock
,PipeBlock
,PointedDripstoneBlock
,PowderSnowBlock
,PoweredBlock
,RedstoneLampBlock
,RedStoneOreBlock
,RedstoneSidedConnectivityTest.EastRedstoneBlock
,RedStoneWireBlock
,RespawnAnchorBlock
,RootedDirtBlock
,RotatedPillarBlock
,ScaffoldingBlock
,SlabBlock
,SnowLayerBlock
,SnowyDirtBlock
,SoulSandBlock
,SpongeBlock
,SporeBlossomBlock
,StairBlock
,StemGrownBlock
,StonecutterBlock
,StructureVoidBlock
,SugarCaneBlock
,TargetBlock
,TntBlock
,TorchBlock
,TripWireBlock
,TripWireHookBlock
,TurtleEggBlock
,VineBlock
,WallBlock
,WeatheringCopperFullBlock
,WebBlock
,WetSpongeBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IdMapper<BlockState>
Deprecated.private final Holder.Reference<Block>
private static final int
private BlockState
private String
static final float
static final float
private Item
private static final org.slf4j.Logger
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>>
protected Random
private Object
private static final com.google.common.cache.LoadingCache<VoxelShape,
Boolean> protected final StateDefinition<Block,
BlockState> static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
animateTick
(BlockState p_49888_, Level p_49889_, BlockPos p_49890_, Random p_49891_) void
appendHoverText
(ItemStack p_49816_, BlockGetter p_49817_, List<Component> p_49818_, TooltipFlag p_49819_) protected Block
asBlock()
asItem()
static VoxelShape
box
(double p_49797_, double p_49798_, double p_49799_, double p_49800_, double p_49801_, double p_49802_) Deprecated.static Block
static boolean
canSupportCenter
(LevelReader p_49864_, BlockPos p_49865_, Direction p_49866_) static boolean
canSupportRigidBlock
(BlockGetter p_49937_, BlockPos p_49938_) boolean
canSustainPlant
(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable) Determines if this block can support the passed in plant, allowing it to be planted and grow.private static <T extends Comparable<T>>
BlockStatecopyProperty
(BlockState p_152455_, BlockState p_152456_, Property<T> p_152457_) protected void
final BlockState
void
destroy
(LevelAccessor p_49860_, BlockPos p_49861_, BlockState p_49862_) boolean
dropFromExplosion
(Explosion p_49826_) Deprecated.static void
dropResources
(BlockState p_49893_, LevelAccessor p_49894_, BlockPos p_49895_, BlockEntity p_49896_) static void
dropResources
(BlockState p_49951_, Level p_49952_, BlockPos p_49953_) static void
dropResources
(BlockState p_49882_, Level p_49883_, BlockPos p_49884_, BlockEntity p_49885_, Entity p_49886_, ItemStack p_49887_) static void
dropResources
(BlockState p_152461_, LootContext.Builder p_152462_) void
fallOn
(Level p_152426_, BlockState p_152427_, BlockPos p_152428_, Entity p_152429_, float p_152430_) void
fillItemCategory
(CreativeModeTab p_49812_, NonNullList<ItemStack> p_49813_) getCloneItemStack
(BlockGetter p_49823_, BlockPos p_49824_, BlockState p_49825_) Deprecated.getDrops
(BlockState p_49870_, ServerLevel p_49871_, BlockPos p_49872_, BlockEntity p_49873_) getDrops
(BlockState p_49875_, ServerLevel p_49876_, BlockPos p_49877_, BlockEntity p_49878_, Entity p_49879_, ItemStack p_49880_) float
Deprecated.float
static int
getId
(BlockState p_49957_) float
getName()
protected com.google.common.collect.ImmutableMap<BlockState,
VoxelShape> getShapeForEachState
(Function<BlockState, VoxelShape> p_152459_) getSoundType
(BlockState p_49963_) Deprecated.float
getStateForPlacement
(BlockPlaceContext p_49820_) void
handlePrecipitation
(BlockState p_152450_, Level p_152451_, BlockPos p_152452_, Biome.Precipitation p_152453_) boolean
private void
void
initializeClient
(Consumer<IBlockRenderProperties> consumer) static boolean
isExceptionForConnection
(BlockState p_152464_) static boolean
isFaceFull
(VoxelShape p_49919_, Direction p_49920_) boolean
boolean
isRandomlyTicking
(BlockState p_49921_) static boolean
isShapeFullBlock
(VoxelShape p_49917_) void
playerDestroy
(Level p_49827_, Player p_49828_, BlockPos p_49829_, BlockState p_49830_, BlockEntity p_49831_, ItemStack p_49832_) void
playerWillDestroy
(Level p_49852_, BlockPos p_49853_, BlockState p_49854_, Player p_49855_) void
popExperience
(ServerLevel p_49806_, BlockPos p_49807_, int p_49808_) private static void
popResource
(Level p_152441_, Supplier<ItemEntity> p_152442_, ItemStack p_152443_) static void
popResource
(Level p_49841_, BlockPos p_49842_, ItemStack p_49843_) static void
popResourceFromFace
(Level p_152436_, BlockPos p_152437_, Direction p_152438_, ItemStack p_152439_) boolean
propagatesSkylightDown
(BlockState p_49928_, BlockGetter p_49929_, BlockPos p_49930_) static BlockState
pushEntitiesUp
(BlockState p_49898_, BlockState p_49899_, Level p_49900_, BlockPos p_49901_) protected final void
registerDefaultState
(BlockState p_49960_) void
setPlacedBy
(Level p_49847_, BlockPos p_49848_, BlockState p_49849_, LivingEntity p_49850_, ItemStack p_49851_) static boolean
shouldRenderFace
(BlockState p_152445_, BlockGetter p_152446_, BlockPos p_152447_, Direction p_152448_, BlockPos p_152449_) protected void
spawnDestroyParticles
(Level p_152422_, Player p_152423_, BlockPos p_152424_, BlockState p_152425_) static BlockState
stateById
(int p_49804_) void
stepOn
(Level p_152431_, BlockPos p_152432_, BlockState p_152433_, Entity p_152434_) toString()
void
updateEntityAfterFallOn
(BlockGetter p_49821_, Entity p_49822_) static BlockState
updateFromNeighbourShapes
(BlockState p_49932_, LevelAccessor p_49933_, BlockPos p_49934_) static void
updateOrDestroy
(BlockState p_49903_, BlockState p_49904_, LevelAccessor p_49905_, BlockPos p_49906_, int p_49907_) static void
updateOrDestroy
(BlockState p_49909_, BlockState p_49910_, LevelAccessor p_49911_, BlockPos p_49912_, int p_49913_, int p_49914_) void
wasExploded
(Level p_49844_, BlockPos p_49845_, Explosion p_49846_) final BlockState
withPropertiesOf
(BlockState p_152466_) Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getOffsetType, getPistonPushReaction, getRenderShape, getSeed, getShadeBrightness, getShape, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isPathfindable, isSignalSource, mirror, neighborChanged, onPlace, onProjectileHit, onRemove, randomTick, rotate, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, use, useShapeForLightOcclusion
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
builtInRegistryHolder
-
BLOCK_STATE_REGISTRY
Deprecated. -
SHAPE_FULL_BLOCK_CACHE
private static final com.google.common.cache.LoadingCache<VoxelShape,Boolean> SHAPE_FULL_BLOCK_CACHE -
UPDATE_NEIGHBORS
public static final int UPDATE_NEIGHBORS- See Also:
-
UPDATE_CLIENTS
public static final int UPDATE_CLIENTS- See Also:
-
UPDATE_INVISIBLE
public static final int UPDATE_INVISIBLE- See Also:
-
UPDATE_IMMEDIATE
public static final int UPDATE_IMMEDIATE- See Also:
-
UPDATE_KNOWN_SHAPE
public static final int UPDATE_KNOWN_SHAPE- See Also:
-
UPDATE_SUPPRESS_DROPS
public static final int UPDATE_SUPPRESS_DROPS- See Also:
-
UPDATE_MOVE_BY_PISTON
public static final int UPDATE_MOVE_BY_PISTON- See Also:
-
UPDATE_SUPPRESS_LIGHT
public static final int UPDATE_SUPPRESS_LIGHT- See Also:
-
UPDATE_NONE
public static final int UPDATE_NONE- See Also:
-
UPDATE_ALL
public static final int UPDATE_ALL- See Also:
-
UPDATE_ALL_IMMEDIATE
public static final int UPDATE_ALL_IMMEDIATE- See Also:
-
INDESTRUCTIBLE
public static final float INDESTRUCTIBLE- See Also:
-
INSTANT
public static final float INSTANT- See Also:
-
UPDATE_LIMIT
public static final int UPDATE_LIMIT- See Also:
-
stateDefinition
-
defaultBlockState
-
descriptionId
-
item
-
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
-
OCCLUSION_CACHE
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>> OCCLUSION_CACHE -
RANDOM
-
renderProperties
-
-
Constructor Details
-
Block
-
-
Method Details
-
getId
-
stateById
-
byItem
-
pushEntitiesUp
public static BlockState pushEntitiesUp(BlockState p_49898_, BlockState p_49899_, Level p_49900_, BlockPos p_49901_) -
box
public static VoxelShape box(double p_49797_, double p_49798_, double p_49799_, double p_49800_, double p_49801_, double p_49802_) -
updateFromNeighbourShapes
public static BlockState updateFromNeighbourShapes(BlockState p_49932_, LevelAccessor p_49933_, BlockPos p_49934_) -
updateOrDestroy
public static void updateOrDestroy(BlockState p_49903_, BlockState p_49904_, LevelAccessor p_49905_, BlockPos p_49906_, int p_49907_) -
updateOrDestroy
public static void updateOrDestroy(BlockState p_49909_, BlockState p_49910_, LevelAccessor p_49911_, BlockPos p_49912_, int p_49913_, int p_49914_) -
isExceptionForConnection
-
isRandomlyTicking
-
shouldRenderFace
public static boolean shouldRenderFace(BlockState p_152445_, BlockGetter p_152446_, BlockPos p_152447_, Direction p_152448_, BlockPos p_152449_) -
canSupportRigidBlock
-
canSupportCenter
-
isFaceFull
-
isShapeFullBlock
-
propagatesSkylightDown
-
animateTick
-
destroy
-
getDrops
public static List<ItemStack> getDrops(BlockState p_49870_, ServerLevel p_49871_, BlockPos p_49872_, @Nullable BlockEntity p_49873_) -
getDrops
public static List<ItemStack> getDrops(BlockState p_49875_, ServerLevel p_49876_, BlockPos p_49877_, @Nullable BlockEntity p_49878_, @Nullable Entity p_49879_, ItemStack p_49880_) -
dropResources
-
dropResources
-
dropResources
public static void dropResources(BlockState p_49893_, LevelAccessor p_49894_, BlockPos p_49895_, @Nullable BlockEntity p_49896_) -
dropResources
public static void dropResources(BlockState p_49882_, Level p_49883_, BlockPos p_49884_, @Nullable BlockEntity p_49885_, Entity p_49886_, ItemStack p_49887_) -
popResource
-
popResourceFromFace
-
popResource
private static void popResource(Level p_152441_, Supplier<ItemEntity> p_152442_, ItemStack p_152443_) -
popExperience
-
getExplosionResistance
Deprecated. -
wasExploded
-
stepOn
-
getStateForPlacement
-
playerDestroy
public void playerDestroy(Level p_49827_, Player p_49828_, BlockPos p_49829_, BlockState p_49830_, @Nullable BlockEntity p_49831_, ItemStack p_49832_) -
setPlacedBy
public void setPlacedBy(Level p_49847_, BlockPos p_49848_, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack p_49851_) -
isPossibleToRespawnInThis
public boolean isPossibleToRespawnInThis() -
getName
-
getDescriptionId
-
fallOn
public void fallOn(Level p_152426_, BlockState p_152427_, BlockPos p_152428_, Entity p_152429_, float p_152430_) -
updateEntityAfterFallOn
-
getCloneItemStack
@Deprecated public ItemStack getCloneItemStack(BlockGetter p_49823_, BlockPos p_49824_, BlockState p_49825_) Deprecated. -
fillItemCategory
-
getFriction
public float getFriction() -
getSpeedFactor
public float getSpeedFactor() -
getJumpFactor
public float getJumpFactor() -
spawnDestroyParticles
protected void spawnDestroyParticles(Level p_152422_, Player p_152423_, BlockPos p_152424_, BlockState p_152425_) -
playerWillDestroy
public void playerWillDestroy(Level p_49852_, BlockPos p_49853_, BlockState p_49854_, Player p_49855_) -
handlePrecipitation
public void handlePrecipitation(BlockState p_152450_, Level p_152451_, BlockPos p_152452_, Biome.Precipitation p_152453_) -
dropFromExplosion
Deprecated. -
createBlockStateDefinition
-
getStateDefinition
-
registerDefaultState
-
defaultBlockState
-
withPropertiesOf
-
copyProperty
private static <T extends Comparable<T>> BlockState copyProperty(BlockState p_152455_, BlockState p_152456_, Property<T> p_152457_) -
getSoundType
Deprecated. -
asItem
- Specified by:
asItem
in interfaceItemLike
- Specified by:
asItem
in classBlockBehaviour
-
hasDynamicShape
public boolean hasDynamicShape() -
toString
-
appendHoverText
public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List<Component> p_49818_, TooltipFlag p_49819_) -
asBlock
- Specified by:
asBlock
in classBlockBehaviour
-
getShapeForEachState
protected com.google.common.collect.ImmutableMap<BlockState,VoxelShape> getShapeForEachState(Function<BlockState, VoxelShape> p_152459_) -
getRenderPropertiesInternal
-
initClient
private void initClient() -
initializeClient
-
canSustainPlant
public boolean canSustainPlant(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable) Description copied from interface:IForgeBlock
Determines if this block can support the passed in plant, allowing it to be planted and grow. Some examples: Reeds check if its a reed, or if its sand/dirt/grass and adjacent to water Cacti checks if its a cacti, or if its sand Nether types check for soul sand Crops check for tilled soil Caves check if it's a solid surface Plains check if its grass or dirt Water check if its still water- Specified by:
canSustainPlant
in interfaceIForgeBlock
- Parameters:
state
- The Current stateworld
- The current levelfacing
- The direction relative to the given position the plant wants to be, typically its UPplantable
- The plant that wants to check- Returns:
- True to allow the plant to be planted/stay.
-
builtInRegistryHolder
Deprecated.
-