Package net.minecraft.block
Class Block
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<Block>
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
- All Implemented Interfaces:
IItemProvider
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
AbstractCoralPlantBlock
,AbstractFireBlock
,AbstractPlantBlock
,AbstractPressurePlateBlock
,AbstractRailBlock
,AirBlock
,BambooBlock
,BambooSaplingBlock
,BarrierBlock
,BreakableBlock
,BubbleColumnBlock
,BushBlock
,CactusBlock
,CakeBlock
,CarpetBlock
,CartographyTableBlock
,CauldronBlock
,ChorusFlowerBlock
,ComposterBlock
,ContainerBlock
,CoralBlock
,CraftingTableBlock
,CryingObsidianBlock
,CustomPlantTypeTest.CustomBlock
,CustomRespawnTest.CustomRespawnBlock
,DirectionalBlock
,DoorBlock
,EndPortalFrameBlock
,FallingBlock
,FarmlandBlock
,FlowerPotBlock
,FlowingFluidBlock
,ForgeChunkManagerTest.ChunkLoaderBlock
,FourWayBlock
,FullPotsAccessorDemo.DioriteFlowerPotBlock
,GrassPathBlock
,HorizontalBlock
,HugeMushroomBlock
,JigsawBlock
,LadderBlock
,LanternBlock
,LeavesBlock
,MagmaBlock
,NetherPortalBlock
,NetherrackBlock
,NewFluidTest.FluidloggableBlock
,NoteBlock
,NyliumBlock
,OreBlock
,RedstoneBlock
,RedstoneLampBlock
,RedstoneOreBlock
,RedstoneWireBlock
,RespawnAnchorBlock
,RotatedPillarBlock
,ScaffoldingBlock
,SilverfishBlock
,SixWayBlock
,SlabBlock
,SnowBlock
,SnowyDirtBlock
,SoulSandBlock
,SpongeBlock
,StairsBlock
,StemGrownBlock
,StonecutterBlock
,StructureVoidBlock
,SugarCaneBlock
,TargetBlock
,TNTBlock
,TorchBlock
,TripWireBlock
,TripWireHookBlock
,TurtleEggBlock
,VineBlock
,WallBlock
,WebBlock
,WetSpongeBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.IExtendedPositionPredicate<A>, AbstractBlock.IPositionPredicate, AbstractBlock.OffsetType, AbstractBlock.Properties
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ObjectIntIdentityMap<BlockState>
Deprecated.private BlockState
private String
private int
private ToolType
private Item
protected static final org.apache.logging.log4j.Logger
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.RenderSideCacheKey>>
protected Random
private final ReverseTagWrapper<Block>
private static final com.google.common.cache.LoadingCache<VoxelShape,
Boolean> protected final StateContainer<Block,
BlockState> Fields inherited from class net.minecraft.block.AbstractBlock
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_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) void
appendHoverText
(ItemStack p_190948_1_, IBlockReader p_190948_2_, List<ITextComponent> p_190948_3_, ITooltipFlag p_190948_4_) protected Block
asBlock()
asItem()
static VoxelShape
box
(double p_208617_0_, double p_208617_2_, double p_208617_4_, double p_208617_6_, double p_208617_8_, double p_208617_10_) static Block
static boolean
canSupportCenter
(IWorldReader p_220055_0_, BlockPos p_220055_1_, Direction p_220055_2_) static boolean
canSupportRigidBlock
(IBlockReader p_220064_0_, BlockPos p_220064_1_) boolean
canSustainPlant
(BlockState state, IBlockReader world, BlockPos pos, Direction facing, IPlantable plantable) Determines if this block can support the passed in plant, allowing it to be planted and grow.protected void
createBlockStateDefinition
(StateContainer.Builder<Block, BlockState> p_206840_1_) final BlockState
void
destroy
(IWorld p_176206_1_, BlockPos p_176206_2_, BlockState p_176206_3_) boolean
dropFromExplosion
(Explosion p_149659_1_) Deprecated.static void
dropResources
(BlockState p_220059_0_, IWorld p_220059_1_, BlockPos p_220059_2_, TileEntity p_220059_3_) static void
dropResources
(BlockState p_220075_0_, World p_220075_1_, BlockPos p_220075_2_) static void
dropResources
(BlockState p_220054_0_, World p_220054_1_, BlockPos p_220054_2_, TileEntity p_220054_3_, Entity p_220054_4_, ItemStack p_220054_5_) void
void
fillItemCategory
(ItemGroup p_149666_1_, NonNullList<ItemStack> p_149666_2_) getCloneItemStack
(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) Deprecated.getDrops
(BlockState p_220070_0_, ServerWorld p_220070_1_, BlockPos p_220070_2_, TileEntity p_220070_3_) getDrops
(BlockState p_220077_0_, ServerWorld p_220077_1_, BlockPos p_220077_2_, TileEntity p_220077_3_, Entity p_220077_4_, ItemStack p_220077_5_) float
Deprecated.float
int
getHarvestLevel
(BlockState state) Queries the harvest level of this item stack for the specified tool class, Returns -1 if this tool is not of the specified typegetHarvestTool
(BlockState state) Queries the class of tool required to harvest this block, if null is returned we assume that anything can harvest this block.static int
getId
(BlockState p_196246_0_) float
getName()
getSoundType
(BlockState p_220072_1_) Deprecated.float
getStateForPlacement
(BlockItemUseContext p_196258_1_) final Set<ResourceLocation>
getTags()
Retrieves a list of tags names this is known to be associated with.void
handleRain
(World p_176224_1_, BlockPos p_176224_2_) boolean
boolean
boolean
static boolean
isExceptionForConnection
(Block p_220073_0_) static boolean
isFaceFull
(VoxelShape p_208061_0_, Direction p_208061_1_) boolean
boolean
isRandomlyTicking
(BlockState p_149653_1_) static boolean
isShapeFullBlock
(VoxelShape p_208062_0_) void
playerDestroy
(World p_180657_1_, PlayerEntity p_180657_2_, BlockPos p_180657_3_, BlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) void
playerWillDestroy
(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) void
popExperience
(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) static void
popResource
(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) boolean
propagatesSkylightDown
(BlockState p_200123_1_, IBlockReader p_200123_2_, BlockPos p_200123_3_) static BlockState
pushEntitiesUp
(BlockState p_199601_0_, BlockState p_199601_1_, World p_199601_2_, BlockPos p_199601_3_) protected final void
registerDefaultState
(BlockState p_180632_1_) void
setPlacedBy
(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_) static boolean
shouldRenderFace
(BlockState p_176225_0_, IBlockReader p_176225_1_, BlockPos p_176225_2_, Direction p_176225_3_) static BlockState
stateById
(int p_196257_0_) void
toString()
void
updateEntityAfterFallOn
(IBlockReader p_176216_1_, Entity p_176216_2_) static BlockState
updateFromNeighbourShapes
(BlockState p_199770_0_, IWorld p_199770_1_, BlockPos p_199770_2_) static void
updateOrDestroy
(BlockState p_196263_0_, BlockState p_196263_1_, IWorld p_196263_2_, BlockPos p_196263_3_, int p_196263_4_) static void
updateOrDestroy
(BlockState p_241468_0_, BlockState p_241468_1_, IWorld p_241468_2_, BlockPos p_241468_3_, int p_241468_4_, int p_241468_5_) void
wasExploded
(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) Methods inherited from class net.minecraft.block.AbstractBlock
attack, canBeReplaced, canBeReplaced, canSurvive, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMenuProvider, getOcclusionShape, getOffsetType, getPistonPushReaction, getRenderShape, getSeed, getShadeBrightness, getShape, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isEntityBlock, 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
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRespawnPosition, getSlipperiness, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasTileEntity, isAir, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isToolEffective, makesOpenTrapdoorAboveClimbable, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
BLOCK_STATE_REGISTRY
Deprecated. -
SHAPE_FULL_BLOCK_CACHE
private static final com.google.common.cache.LoadingCache<VoxelShape,Boolean> SHAPE_FULL_BLOCK_CACHE -
stateDefinition
-
defaultBlockState
-
descriptionId
-
item
-
OCCLUSION_CACHE
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.RenderSideCacheKey>> OCCLUSION_CACHE -
RANDOM
-
harvestTool
-
harvestLevel
private int harvestLevel -
reverseTags
-
-
Constructor Details
-
Block
-
-
Method Details
-
getId
-
stateById
-
byItem
-
pushEntitiesUp
public static BlockState pushEntitiesUp(BlockState p_199601_0_, BlockState p_199601_1_, World p_199601_2_, BlockPos p_199601_3_) -
box
public static VoxelShape box(double p_208617_0_, double p_208617_2_, double p_208617_4_, double p_208617_6_, double p_208617_8_, double p_208617_10_) -
is
-
is
-
updateFromNeighbourShapes
public static BlockState updateFromNeighbourShapes(BlockState p_199770_0_, IWorld p_199770_1_, BlockPos p_199770_2_) -
updateOrDestroy
public static void updateOrDestroy(BlockState p_196263_0_, BlockState p_196263_1_, IWorld p_196263_2_, BlockPos p_196263_3_, int p_196263_4_) -
updateOrDestroy
public static void updateOrDestroy(BlockState p_241468_0_, BlockState p_241468_1_, IWorld p_241468_2_, BlockPos p_241468_3_, int p_241468_4_, int p_241468_5_) -
isExceptionForConnection
-
isRandomlyTicking
-
shouldRenderFace
public static boolean shouldRenderFace(BlockState p_176225_0_, IBlockReader p_176225_1_, BlockPos p_176225_2_, Direction p_176225_3_) -
canSupportRigidBlock
-
canSupportCenter
public static boolean canSupportCenter(IWorldReader p_220055_0_, BlockPos p_220055_1_, Direction p_220055_2_) -
isFaceFull
-
isShapeFullBlock
-
propagatesSkylightDown
public boolean propagatesSkylightDown(BlockState p_200123_1_, IBlockReader p_200123_2_, BlockPos p_200123_3_) -
animateTick
public void animateTick(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) -
destroy
-
getDrops
public static List<ItemStack> getDrops(BlockState p_220070_0_, ServerWorld p_220070_1_, BlockPos p_220070_2_, @Nullable TileEntity p_220070_3_) -
getDrops
public static List<ItemStack> getDrops(BlockState p_220077_0_, ServerWorld p_220077_1_, BlockPos p_220077_2_, @Nullable TileEntity p_220077_3_, @Nullable Entity p_220077_4_, ItemStack p_220077_5_) -
dropResources
-
dropResources
public static void dropResources(BlockState p_220059_0_, IWorld p_220059_1_, BlockPos p_220059_2_, @Nullable TileEntity p_220059_3_) -
dropResources
public static void dropResources(BlockState p_220054_0_, World p_220054_1_, BlockPos p_220054_2_, @Nullable TileEntity p_220054_3_, Entity p_220054_4_, ItemStack p_220054_5_) -
popResource
-
popExperience
-
getExplosionResistance
Deprecated. -
wasExploded
-
stepOn
-
getStateForPlacement
-
playerDestroy
public void playerDestroy(World p_180657_1_, PlayerEntity p_180657_2_, BlockPos p_180657_3_, BlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) -
setPlacedBy
public void setPlacedBy(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, @Nullable LivingEntity p_180633_4_, ItemStack p_180633_5_) -
isPossibleToRespawnInThis
public boolean isPossibleToRespawnInThis() -
getName
-
getDescriptionId
-
fallOn
-
updateEntityAfterFallOn
-
getCloneItemStack
@Deprecated public ItemStack getCloneItemStack(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) Deprecated. -
fillItemCategory
-
getFriction
public float getFriction() -
getSpeedFactor
public float getSpeedFactor() -
getJumpFactor
public float getJumpFactor() -
playerWillDestroy
public void playerWillDestroy(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) -
handleRain
-
dropFromExplosion
Deprecated. -
createBlockStateDefinition
-
getStateDefinition
-
registerDefaultState
-
defaultBlockState
-
getSoundType
Deprecated. -
asItem
- Specified by:
asItem
in interfaceIItemProvider
- Specified by:
asItem
in classAbstractBlock
-
hasDynamicShape
public boolean hasDynamicShape() -
toString
-
appendHoverText
public void appendHoverText(ItemStack p_190948_1_, @Nullable IBlockReader p_190948_2_, List<ITextComponent> p_190948_3_, ITooltipFlag p_190948_4_) -
asBlock
- Specified by:
asBlock
in classAbstractBlock
-
getHarvestTool
Description copied from interface:IForgeBlock
Queries the class of tool required to harvest this block, if null is returned we assume that anything can harvest this block.- Specified by:
getHarvestTool
in interfaceIForgeBlock
-
getHarvestLevel
Description copied from interface:IForgeBlock
Queries the harvest level of this item stack for the specified tool class, Returns -1 if this tool is not of the specified type- Specified by:
getHarvestLevel
in interfaceIForgeBlock
- Returns:
- Harvest level, or -1 if not the specified tool type.
-
canSustainPlant
public boolean canSustainPlant(BlockState state, IBlockReader 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 worldfacing
- 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.
-
getTags
Description copied from interface:IForgeBlock
Retrieves a list of tags names this is known to be associated with. This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.- Specified by:
getTags
in interfaceIForgeBlock
-