Class CustomPlantTypeTest.CustomBlock

All Implemented Interfaces:
IItemProvider, IForgeBlock, IForgeRegistryEntry<Block>
Enclosing class:
CustomPlantTypeTest

public static class CustomPlantTypeTest.CustomBlock extends Block
  • Constructor Details

    • CustomBlock

      public CustomBlock()
  • Method Details

    • 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
      Overrides:
      canSustainPlant in class Block
      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.