Skip to content

Commit

Permalink
Add a tooltip to foodstuff for the frypan-achievement to make it obvi…
Browse files Browse the repository at this point in the history
…ous why they don't stack normally
  • Loading branch information
bonii-xx committed Apr 9, 2015
1 parent 5d4d646 commit 2931a54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -765,6 +765,7 @@ smeltery.castingfaucet.tooltip=This Smeltery is leaking
smeltery.castingbasin.tooltip=For the ambitious Smeltery
#Dear translators, only translate this line if the joke is applicable in your language.
grout.tooltip=I am Grout!
frypankill.tooltip=This poor animal met its demise with a loud *bang*

tconstruct.waila.empty=Empty
tconstruct.waila.liquidtag=Liquid:
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/tconstruct/achievements/AchievementEvents.java
@@ -1,11 +1,14 @@
package tconstruct.achievements;

import com.mojang.realmsclient.gui.ChatFormatting;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import tconstruct.items.tools.FryingPan;
import tconstruct.library.event.ToolCraftedEvent;
import tconstruct.library.tools.*;
Expand Down Expand Up @@ -73,4 +76,12 @@ public void entityDrops (LivingDropsEvent event)
}
}
}

@SubscribeEvent
public void tooltip(ItemTooltipEvent event) {
if(event.itemStack == null || event.itemStack.getItem() == null || !event.itemStack.hasTagCompound() || !event.itemStack.getTagCompound().hasKey("frypanKill"))
return;

event.toolTip.add("" + ChatFormatting.DARK_PURPLE + ChatFormatting.ITALIC + StatCollector.translateToLocal("frypankill.tooltip"));
}
}

0 comments on commit 2931a54

Please sign in to comment.