From e20c3a588c20e41b44794b1909b11c7c840a497b Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sun, 4 Nov 2018 16:26:19 -0500 Subject: [PATCH] Pass a null player to getTooltip (#1388) Some items display useful information in their tooltips and it should not be shown in JEI since the item needs to be crafted to get the info normally. --- .../jei/plugins/vanilla/ingredients/ItemStackRenderer.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/ItemStackRenderer.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/ItemStackRenderer.java index 8c3b29af2..dcd6e9335 100644 --- a/src/main/java/mezz/jei/plugins/vanilla/ingredients/ItemStackRenderer.java +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/ItemStackRenderer.java @@ -13,7 +13,6 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; @@ -34,10 +33,9 @@ public void render(Minecraft minecraft, int xPosition, int yPosition, @Nullable @Override public List getTooltip(Minecraft minecraft, ItemStack ingredient, ITooltipFlag tooltipFlag) { - EntityPlayer player = minecraft.player; List list; try { - list = ingredient.getTooltip(player, tooltipFlag); + list = ingredient.getTooltip(null, tooltipFlag); } catch (RuntimeException | LinkageError e) { String itemStackInfo = ErrorUtil.getItemStackInfo(ingredient); Log.get().error("Failed to get tooltip: {}", itemStackInfo, e);