Fix crash

This commit is contained in:
Sollace 2024-10-05 03:14:51 +01:00
parent 02e9e80a71
commit ae86396a86
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -41,7 +41,9 @@ public class ModifierTooltipRenderer {
lines.add(Text.translatable("item.unicopia.friendship_bracelet.glowing").formatted(Formatting.ITALIC, Formatting.GRAY));
}
PonyDiets.getInstance().getDiet(pony).appendTooltip(stack, pony, lines, type);
if (pony != null) {
PonyDiets.getInstance().getDiet(pony).appendTooltip(stack, pony, lines, type);
}
}
private <T extends TooltipAppender> void appendTooltip(ItemStack stack, ComponentType<T> componentType, Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type) {