Class 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

public class Block extends AbstractBlock implements IItemProvider, IForgeBlock
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public static int getId(@Nullable BlockState p_196246_0_)
    • stateById

      public static BlockState stateById(int p_196257_0_)
    • byItem

      public static Block byItem(@Nullable Item p_149634_0_)
    • 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

      public boolean is(ITag<Block> p_203417_1_)
    • is

      public boolean is(Block p_235332_1_)
    • 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

      public static boolean isExceptionForConnection(Block p_220073_0_)
    • isRandomlyTicking

      public boolean isRandomlyTicking(BlockState p_149653_1_)
    • shouldRenderFace

      public static boolean shouldRenderFace(BlockState p_176225_0_, IBlockReader p_176225_1_, BlockPos p_176225_2_, Direction p_176225_3_)
    • canSupportRigidBlock

      public static boolean canSupportRigidBlock(IBlockReader p_220064_0_, BlockPos p_220064_1_)
    • canSupportCenter

      public static boolean canSupportCenter(IWorldReader p_220055_0_, BlockPos p_220055_1_, Direction p_220055_2_)
    • isFaceFull

      public static boolean isFaceFull(VoxelShape p_208061_0_, Direction p_208061_1_)
    • isShapeFullBlock

      public static boolean isShapeFullBlock(VoxelShape p_208062_0_)
    • 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

      public void destroy(IWorld p_176206_1_, BlockPos p_176206_2_, BlockState p_176206_3_)
    • 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

      public static void dropResources(BlockState p_220075_0_, World p_220075_1_, BlockPos p_220075_2_)
    • 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

      public static void popResource(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_)
    • popExperience

      public void popExperience(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_)
    • getExplosionResistance

      @Deprecated public float getExplosionResistance()
      Deprecated.
    • wasExploded

      public void wasExploded(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_)
    • stepOn

      public void stepOn(World p_176199_1_, BlockPos p_176199_2_, Entity p_176199_3_)
    • getStateForPlacement

      @Nullable public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_)
    • 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

      public IFormattableTextComponent getName()
    • getDescriptionId

      public String getDescriptionId()
    • fallOn

      public void fallOn(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
    • updateEntityAfterFallOn

      public void updateEntityAfterFallOn(IBlockReader p_176216_1_, Entity p_176216_2_)
    • getCloneItemStack

      @Deprecated public ItemStack getCloneItemStack(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_)
      Deprecated.
    • fillItemCategory

      public void fillItemCategory(ItemGroup p_149666_1_, NonNullList<ItemStack> p_149666_2_)
    • 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

      public void handleRain(World p_176224_1_, BlockPos p_176224_2_)
    • dropFromExplosion

      @Deprecated public boolean dropFromExplosion(Explosion p_149659_1_)
      Deprecated.
    • createBlockStateDefinition

      protected void createBlockStateDefinition(StateContainer.Builder<Block,BlockState> p_206840_1_)
    • getStateDefinition

      public StateContainer<Block,BlockState> getStateDefinition()
    • registerDefaultState

      protected final void registerDefaultState(BlockState p_180632_1_)
    • defaultBlockState

      public final BlockState defaultBlockState()
    • getSoundType

      @Deprecated public SoundType getSoundType(BlockState p_220072_1_)
      Deprecated.
    • asItem

      public Item asItem()
      Specified by:
      asItem in interface IItemProvider
      Specified by:
      asItem in class AbstractBlock
    • hasDynamicShape

      public boolean hasDynamicShape()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • appendHoverText

      public void appendHoverText(ItemStack p_190948_1_, @Nullable IBlockReader p_190948_2_, List<ITextComponent> p_190948_3_, ITooltipFlag p_190948_4_)
    • asBlock

      protected Block asBlock()
      Specified by:
      asBlock in class AbstractBlock
    • getHarvestTool

      @Nullable public ToolType getHarvestTool(BlockState state)
      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 interface IForgeBlock
    • getHarvestLevel

      public int getHarvestLevel(BlockState state)
      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 interface IForgeBlock
      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 interface IForgeBlock
      Parameters:
      state - The Current state
      world - The current world
      facing - The direction relative to the given position the plant wants to be, typically its UP
      plantable - The plant that wants to check
      Returns:
      True to allow the plant to be planted/stay.
    • getTags

      public final Set<ResourceLocation> 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 interface IForgeBlock