Package net.fabricmc.fabric.api.registry
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 BlockStategetStrippedBlockState(BlockState blockState) Provides result of stripping interaction.static voidRegisters a stripping interaction.static voidregister(Block input, Block stripped, StrippableBlockRegistry.StrippingTransformer transformer) Registers a stripping interaction.static voidregisterCopyState(Block input, Block stripped) Registers a stripping interaction.
-
Method Details
-
register
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
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(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 strippedstripped- the stripped result blocktransformer- the transformer used to provide the resulting block state
-
getStrippedBlockState
Provides result of stripping interaction.- Parameters:
blockState- original block state- Returns:
- stripped block state if successful, otherwise null
-