Evaluate the material cost of a possible tool. If all else is equal, we want to prefer the tool with the lowest material cost. i.e. we want to prefer a wooden pickaxe over a stone pickaxe, if all else is equal. @param itemStack a possibly empty ItemStack @return values from 0 up
(ItemStack itemStack)
| 105 | * @return values from 0 up |
| 106 | */ |
| 107 | private int getMaterialCost(ItemStack itemStack) { |
| 108 | for (int i = 0; i < materialTagsPriorityList.size(); i++) { |
| 109 | final TagKey<Item> tag = materialTagsPriorityList.get(i); |
| 110 | if (itemStack.is(tag)) return i; |
| 111 | } |
| 112 | return -1; |
| 113 | } |
| 114 | |
| 115 | public boolean hasSilkTouch(ItemStack stack) { |
| 116 | ItemEnchantments enchantments = stack.getEnchantments(); |
no test coverage detected