Class Block

    • Field Detail

      • LOGGER

        protected static final org.apache.logging.log4j.Logger LOGGER
      • SHAPE_FULL_BLOCK_CACHE

        private static final com.google.common.cache.LoadingCache<VoxelShape,​java.lang.Boolean> SHAPE_FULL_BLOCK_CACHE
      • defaultBlockState

        private BlockState defaultBlockState
      • descriptionId

        @Nullable
        private java.lang.String descriptionId
      • item

        @Nullable
        private Item item
      • OCCLUSION_CACHE

        private static final java.lang.ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.RenderSideCacheKey>> OCCLUSION_CACHE
      • RANDOM

        protected java.util.Random RANDOM
      • harvestTool

        private ToolType harvestTool
      • harvestLevel

        private int harvestLevel
    • Method Detail

      • 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_)
      • 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_)
      • 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_)
      • canSupportRigidBlock

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

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

        public static boolean isShapeFullBlock​(VoxelShape p_208062_0_)
      • animateTick

        public void animateTick​(BlockState p_180655_1_,
                                World p_180655_2_,
                                BlockPos p_180655_3_,
                                java.util.Random p_180655_4_)
      • dropResources

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

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

        public boolean isPossibleToRespawnInThis()
      • getDescriptionId

        public java.lang.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_)
      • getFriction

        public float getFriction()
      • getSpeedFactor

        public float getSpeedFactor()
      • getJumpFactor

        public float getJumpFactor()
      • handleRain

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

        @Deprecated
        public boolean dropFromExplosion​(Explosion p_149659_1_)
        Deprecated.
      • registerDefaultState

        protected final void registerDefaultState​(BlockState p_180632_1_)
      • defaultBlockState

        public final BlockState defaultBlockState()
      • getSoundType

        @Deprecated
        public SoundType getSoundType​(BlockState p_220072_1_)
        Deprecated.
      • hasDynamicShape

        public boolean hasDynamicShape()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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 java.util.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