diff options
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 8769bd3..925b5df 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -53,6 +53,7 @@ import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -1636,11 +1637,31 @@ public class TheMod final ToggleCommand tc = new ToggleCommand(); if (event.toolTip == null) return; + + ItemStack item = event.itemStack; if (tc.goldenToggled) { for (int i = 0; i < event.toolTip.size(); i++) { event.toolTip.set(i, Utils.returnGoldenEnchants(event.toolTip.get(i))); } } + + if (tc.expertiseLoreToggled) { + if (item.hasTagCompound()) { + NBTTagCompound tags = item.getSubCompound("ExtraAttributes", false); + if (tags != null) { + if (tags.hasKey("expertise_kills")) { + int index = 4; + if (!Minecraft.getMinecraft().gameSettings.advancedItemTooltips) index -= 2; + + event.toolTip.add(event.toolTip.size() - index, ""); + event.toolTip.add(event.toolTip.size() - index, "Expertise Kills: " + EnumChatFormatting.RED + tags.getInteger("expertise_kills")); + if (Utils.expertiseKillsLeft(tags.getInteger("expertise_kills")) != -1) { + event.toolTip.add(event.toolTip.size() - index, Utils.expertiseKillsLeft(tags.getInteger("expertise_kills")) + " kills to tier up!"); + } + } + } + } + } } @SubscribeEvent |