Package vazkii.botania.api.item
Interface SortableTool
- All Known Implementing Classes:
ElementiumAxeItem,ElementiumHoeItem,ElementiumPickaxeItem,ElementiumShearsItem,ElementiumShovelItem,ManasteelAxeItem,ManasteelHoeItem,ManasteelPickaxeItem,ManasteelShearsItem,ManasteelShovelItem,TerraShattererItem,TerraTruncatorItem,VitreousPickaxeItem
public interface SortableTool
This interface describes a tool that can be sorted by the Ring of
Correction.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intgetSortingPriority(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.block.state.BlockState state) Gets the priority that this tool should have when being sorted.
-
Method Details
-
getSortingPriority
default int getSortingPriority(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.block.state.BlockState state) Gets the priority that this tool should have when being sorted. The tool with the highest priority will be picked. The way this is specified should be (tool-level) * 100 + (tool-modifier) * 10 + (efficiency-level).
For example, a Manasteel Pickaxe is tool-level 10 and it doesn't have modifiers. Assuming Efficiency 4, the priority should be 10 * 100 + 4 = 1004. This will rate higher than a similar pickaxe with Efficiency 3.
A Terra Shatterer has a modifier, its rank and is tool-level 20. With Efficiency 5 and rank B (2) the priority should be 20 * 100 + 2 * 10 + 5 = 2025.
All intermediate tool levels are there for other mod tools that wish to occupy the spots inbetween. Of course, you don't have to always adhere to this. Tools like the Vitreous Pickaxe don't, that one in particular is priority 0, unless looking at glass, in which case it'sInteger.MAX_VALUE.- Parameters:
state- The blockstate being broken.
-