MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / food

Method food

src/main/java/gregapi/util/ST.java:897–905  ·  view source on GitHub ↗
(ItemStack aStack)

Source from the content-addressed store, hash-verified

895 return item_(aStack) instanceof ItemFood;
896 }
897 public static int food(ItemStack aStack) {
898 if (invalid(aStack)) return 0;
899 if (item_(aStack) instanceof ItemFood) {try {return ((ItemFood)item_(aStack)).func_150905_g(aStack);} catch(Throwable e) {return 1;}}
900 if (item_(aStack) instanceof MultiItemRandom) {
901 IFoodStat tStat = ((MultiItemRandom)item_(aStack)).mFoodStats.get(meta_(aStack));
902 return tStat == null ? 0 : tStat.getFoodLevel(item_(aStack), aStack, null);
903 }
904 return 0;
905 }
906 public static float saturation(ItemStack aStack) {
907 if (invalid(aStack)) return 0;
908 if (item_(aStack) instanceof ItemFood) {try {return ((ItemFood)item_(aStack)).func_150906_h(aStack);} catch(Throwable e) {return 0.5F;}}

Callers 10

onPlayerDestroyItemMethod · 0.95
onRightClickEntityMethod · 0.95
cropMethod · 0.95
containsInputMethod · 0.95
findRecipeMethod · 0.95
foodMethod · 0.95
getRottenMethod · 0.95
getTotalFoodMethod · 0.95
onOreRegistrationMethod · 0.95
onOreRegistrationMethod · 0.95

Calls 5

invalidMethod · 0.95
item_Method · 0.95
meta_Method · 0.95
getFoodLevelMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected