类 CustomPlantTypeTest.CustomBlock

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.neoforged.neoforge.oldtest.block.CustomPlantTypeTest.CustomBlock
所有已实现的接口:
FeatureElement, ItemLike, IBlockExtension
封闭类:
CustomPlantTypeTest

public static class CustomPlantTypeTest.CustomBlock extends Block
  • 构造器详细资料

  • 方法详细资料

    • canSustainPlant

      public TriState canSustainPlant(BlockState state, BlockGetter level, BlockPos pos, Direction facing, BlockState plantable)
      从接口复制的说明: 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.
      参数:
      state - The current state
      level - The current level
      pos - 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
      plantable - The plant that is checking survivability
      返回:
      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.