mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-07 22:16:44 +01:00
Don't show diet information on blocks unaffected by the diet system
This commit is contained in:
parent
0f681b07b3
commit
29502e7529
1 changed files with 7 additions and 13 deletions
|
@ -77,23 +77,17 @@ public class PonyDiets implements DietView {
|
|||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, @Nullable PlayerEntity user, List<Text> tooltip, TooltipContext context) {
|
||||
|
||||
if (initEdibility(stack, user)) {
|
||||
if (!((ItemDuck)stack.getItem()).getOriginalFoodComponent().isEmpty() || stack.getItem().getFoodComponent() != null) {
|
||||
Pony pony = Pony.of(user);
|
||||
|
||||
tooltip.add(Text.translatable("unicopia.diet.information").formatted(Formatting.DARK_PURPLE));
|
||||
getEffects(stack, pony).appendTooltip(stack, tooltip, context);
|
||||
|
||||
/*for (Race race : Race.REGISTRY) {
|
||||
var diet = diets.get(race);
|
||||
if (diet != null) {
|
||||
tooltip.add(race.getDisplayName());
|
||||
diet.appendTooltip(stack, user, tooltip, context);
|
||||
}
|
||||
}*/
|
||||
|
||||
getDiet(pony).appendTooltip(stack, user, tooltip, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean initEdibility(ItemStack stack, LivingEntity user) {
|
||||
ItemDuck item = (ItemDuck)stack.getItem();
|
||||
|
|
Loading…
Reference in a new issue