Skip to content

Commit

Permalink
Pass a null player to getTooltip (mezz#1388)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josephcsible authored and mezz committed Nov 4, 2018
1 parent fa69944 commit e20c3a5
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,10 +33,9 @@ public void render(Minecraft minecraft, int xPosition, int yPosition, @Nullable

@Override
public List<String> getTooltip(Minecraft minecraft, ItemStack ingredient, ITooltipFlag tooltipFlag) {
EntityPlayer player = minecraft.player;
List<String> 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);
Expand Down

0 comments on commit e20c3a5

Please sign in to comment.