Class StrippableBlockRegistry

java.lang.Object
net.fabricmc.fabric.api.registry.StrippableBlockRegistry

public final class StrippableBlockRegistry extends Object
A registry for axe stripping interactions. A vanilla example is turning logs to stripped logs.
  • Method Details

    • register

      public static void register(Block input, Block stripped)
      Registers a stripping interaction. The resulting BlockState of stripping of input will only copy the axis property, if it's present.
      Parameters:
      input - the input block that can be stripped
      stripped - the stripped result block
    • registerCopyState

      public static void registerCopyState(Block input, Block stripped)
      Registers a stripping interaction. The resulting BlockState of stripping of input will copy all present properties.
      Parameters:
      input - the input block that can be stripped
      stripped - the stripped result block
    • register

      public static void register(Block input, Block stripped, StrippableBlockRegistry.StrippingTransformer transformer)
      Registers a stripping interaction. The resulting BlockState of stripping of input will depend on provided transformer.
      Parameters:
      input - the input block that can be stripped
      stripped - the stripped result block
      transformer - the transformer used to provide the resulting block state
    • getStrippedBlockState

      @Nullable public static @Nullable BlockState getStrippedBlockState(BlockState blockState)
      Provides result of stripping interaction.
      Parameters:
      blockState - original block state
      Returns:
      stripped block state if successful, otherwise null