MCPcopy Index your code
hub / github.com/cabaletta/baritone / getMaterialCost

Method getMaterialCost

src/main/java/baritone/utils/ToolSet.java:107–113  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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();

Callers 1

getBestSlotMethod · 0.95

Calls 3

sizeMethod · 0.65
getMethod · 0.65
isMethod · 0.65

Tested by

no test coverage detected