Class StrippableBlockRegistry
java.lang.Object
net.fabricmc.fabric.api.registry.StrippableBlockRegistry
A registry for axe stripping interactions. A vanilla example is turning logs to stripped logs.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable net.minecraft.world.level.block.state.BlockStategetStrippedBlockState(net.minecraft.world.level.block.state.BlockState blockState) Provides result of stripping interaction.static voidregister(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.Block stripped) Registers a stripping interaction.static voidregister(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.Block stripped, StrippableBlockRegistry.StrippingTransformer transformer) Registers a stripping interaction.static voidregisterCopyState(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.Block stripped) Registers a stripping interaction.
-
Method Details
-
register
public static void register(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.Block stripped) Registers a stripping interaction. The resulting BlockState of stripping of input will only copy theaxisproperty, if it's present.- Parameters:
input- the input block that can be strippedstripped- the stripped result block
-
registerCopyState
public static void registerCopyState(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.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 strippedstripped- the stripped result block
-
register
public static void register(net.minecraft.world.level.block.Block input, net.minecraft.world.level.block.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 strippedstripped- the stripped result blocktransformer- the transformer used to provide the resulting block state
-
getStrippedBlockState
public static @Nullable net.minecraft.world.level.block.state.BlockState getStrippedBlockState(net.minecraft.world.level.block.state.BlockState blockState) Provides result of stripping interaction.- Parameters:
blockState- original block state- Returns:
- stripped block state if successful, otherwise null
-