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 ClassesNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.IExtendedPositionPredicate<A>, AbstractBlock.IPositionPredicate, AbstractBlock.OffsetType, AbstractBlock.PropertiesNested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectIntIdentityMap<BlockState>Deprecated.private BlockStateprivate Stringprivate intprivate ToolTypeprivate Itemprotected static final org.apache.logging.log4j.Loggerprivate static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.RenderSideCacheKey>>protected Randomprivate 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_ORDERFields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidanimateTick(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) voidappendHoverText(ItemStack p_190948_1_, IBlockReader p_190948_2_, List<ITextComponent> p_190948_3_, ITooltipFlag p_190948_4_) protected BlockasBlock()asItem()static VoxelShapebox(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 Blockstatic booleancanSupportCenter(IWorldReader p_220055_0_, BlockPos p_220055_1_, Direction p_220055_2_) static booleancanSupportRigidBlock(IBlockReader p_220064_0_, BlockPos p_220064_1_) booleancanSustainPlant(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 voidcreateBlockStateDefinition(StateContainer.Builder<Block, BlockState> p_206840_1_) final BlockStatevoiddestroy(IWorld p_176206_1_, BlockPos p_176206_2_, BlockState p_176206_3_) booleandropFromExplosion(Explosion p_149659_1_) Deprecated.static voiddropResources(BlockState p_220059_0_, IWorld p_220059_1_, BlockPos p_220059_2_, TileEntity p_220059_3_) static voiddropResources(BlockState p_220075_0_, World p_220075_1_, BlockPos p_220075_2_) static voiddropResources(BlockState p_220054_0_, World p_220054_1_, BlockPos p_220054_2_, TileEntity p_220054_3_, Entity p_220054_4_, ItemStack p_220054_5_) voidvoidfillItemCategory(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_) floatDeprecated.floatintgetHarvestLevel(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 intgetId(BlockState p_196246_0_) floatgetName()getSoundType(BlockState p_220072_1_) Deprecated.floatgetStateForPlacement(BlockItemUseContext p_196258_1_) final Set<ResourceLocation>getTags()Retrieves a list of tags names this is known to be associated with.voidhandleRain(World p_176224_1_, BlockPos p_176224_2_) booleanbooleanbooleanstatic booleanisExceptionForConnection(Block p_220073_0_) static booleanisFaceFull(VoxelShape p_208061_0_, Direction p_208061_1_) booleanbooleanisRandomlyTicking(BlockState p_149653_1_) static booleanisShapeFullBlock(VoxelShape p_208062_0_) voidplayerDestroy(World p_180657_1_, PlayerEntity p_180657_2_, BlockPos p_180657_3_, BlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) voidplayerWillDestroy(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) voidpopExperience(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) static voidpopResource(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) booleanpropagatesSkylightDown(BlockState p_200123_1_, IBlockReader p_200123_2_, BlockPos p_200123_3_) static BlockStatepushEntitiesUp(BlockState p_199601_0_, BlockState p_199601_1_, World p_199601_2_, BlockPos p_199601_3_) protected final voidregisterDefaultState(BlockState p_180632_1_) voidsetPlacedBy(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_) static booleanshouldRenderFace(BlockState p_176225_0_, IBlockReader p_176225_1_, BlockPos p_176225_2_, Direction p_176225_3_) static BlockStatestateById(int p_196257_0_) voidtoString()voidupdateEntityAfterFallOn(IBlockReader p_176216_1_, Entity p_176216_2_) static BlockStateupdateFromNeighbourShapes(BlockState p_199770_0_, IWorld p_199770_1_, BlockPos p_199770_2_) static voidupdateOrDestroy(BlockState p_196263_0_, BlockState p_196263_1_, IWorld p_196263_2_, BlockPos p_196263_3_, int p_196263_4_) static voidupdateOrDestroy(BlockState p_241468_0_, BlockState p_241468_1_, IWorld p_241468_2_, BlockPos p_241468_3_, int p_241468_4_, int p_241468_5_) voidwasExploded(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, useShapeForLightOcclusionMethods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
asItemin interfaceIItemProvider- Specified by:
asItemin 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:
asBlockin classAbstractBlock
-
getHarvestTool
Description copied from interface:IForgeBlockQueries the class of tool required to harvest this block, if null is returned we assume that anything can harvest this block.- Specified by:
getHarvestToolin interfaceIForgeBlock
-
getHarvestLevel
Description copied from interface:IForgeBlockQueries 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:
getHarvestLevelin 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:IForgeBlockDetermines 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:
canSustainPlantin 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:IForgeBlockRetrieves 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:
getTagsin interfaceIForgeBlock
-