[Suggestion] Replace `FabricBlockSettings.breakByTool` by extending the 1.17 vanilla tag system
Juuxel opened this issue ยท 1 comments
In 1.17, Mojang added a system for defining the breaking tools and required tool levels with a set of builtin tags. (Previously, this was done with ugly if-statements in tool classes.) This makes the Fabric breakByTool
system redundant for vanilla tools and vanilla mining levels.
- Custom tool types can be done by passing a custom
mineable
tag for your tool, and passing it intoMiningToolItem
's constructor. There's no API needed here.- Multitools that have multiple tool types can just have a custom
Item.isSuitableFor(BlockState)
implementation, which is reasonable enough to implement manually IMO.- Example:
state.isIn(#mineable/pickaxe) || state.isIn(#mineable/shovel)
for a pickaxe-shovel multitool
- Example:
- Multitools that have multiple tool types can just have a custom
- Custom mining levels are a bit harder. The tags themselves are hardcoded in
MiningToolItem.isSuitableFor
, so a simple registry of "mining level (int) -> mining level block tag" could be made here.