Some Assembly Required

Some Assembly Required

2M Downloads

[1.18.1] Crash when Diet tries to render nutrition tooltips on Sandwiches with any Potion added

Prunoideae opened this issue ยท 1 comments

commented

Crash report:
crash-2022-03-12_13.19.18-client.txt

starts at

new ImmutableTriple<>(handler.getItems(), handler.getTotalNutrition(), handler.getAverageSaturation())

where

public int getTotalNutrition() {
int result = 0;
for (ItemStack stack : items) {
result += Ingredients.getFood(stack).getNutrition();
}
return result;
}

but

public static FoodProperties getFood(ItemStack item) {
return IngredientPropertiesManager.getOrDefault(item).getFood(item);
}

public FoodProperties getFood(ItemStack item) {
return null;
}

commented

Thanks for the detailed report! Diet didn't have a release for 1.18 yet when I implemented compatibility, that's why I forgot to properly test it. I've uploaded a patch that fixes the issue. (It seems there's some issues with curseforge at the moment though, it might take some time to be approved)