Class CanSustainPlantTests.CustomSuperSustainingBlock

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.neoforged.neoforge.debug.block.CanSustainPlantTests.CustomSuperSustainingBlock
All Implemented Interfaces:
FeatureElement, ItemLike, IBlockExtension
Enclosing class:
CanSustainPlantTests

private static class CanSustainPlantTests.CustomSuperSustainingBlock extends Block
  • Constructor Details

  • Method Details

    • canSustainPlant

      public TriState canSustainPlant(BlockState state, BlockGetter level, BlockPos soilPosition, Direction facing, BlockState plant)
      Description copied from interface: IBlockExtension
      Determines if this block either force allow or force disallow a plant from being placed on it. (Or pass and let the plant's decision win) This will be called in plant's canSurvive method and/or mayPlace method.
      Parameters:
      state - The current state
      level - The current level
      soilPosition - The current position of the block that will sustain the plant
      facing - The direction relative to the given position the plant wants to be, typically its UP
      plant - The plant that is checking survivability
      Returns:
      TriState.TRUE to allow the plant to be planted/stay. TriState.FALSE to disallow the plant from placing. TriState.DEFAULT to allow the plant to make the decision to stay or not.