aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java47
1 files changed, 33 insertions, 14 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index 02822ae6..489cf6fb 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -2942,7 +2942,6 @@ public class GuiProfileViewer extends GuiScreen {
//hotm render
//Pain
- //if (miningSpeed == 0) {
renderHotmPerk(
miningSpeed,
@@ -3077,7 +3076,7 @@ public class GuiProfileViewer extends GuiScreen {
(int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42),
mouseX, mouseY,
() -> {
- switch(potm) {
+ switch (potm) {
case 0:
return Lists.newArrayList(
EnumChatFormatting.RED + "Peak of the Mountain",
@@ -3462,18 +3461,29 @@ public class GuiProfileViewer extends GuiScreen {
boolean unlocked = perkLevel > 0;
GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableLighting();
- if(isPickaxeAbility) RenderHelper.enableGUIStandardItemLighting(); // GUI standard item lighting must be enabled for items that are rendered as blocks, like emerald blocks.
- Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(
- isPickaxeAbility ?
- new ItemStack(unlocked ? Blocks.emerald_block : Blocks.coal_block) : // Pickaxe abilities are rendered as blocks
- new ItemStack(unlocked ? (perkLevel >= maxLevel ? Items.diamond : Items.emerald) : Items.coal), // Non-pickaxe abilities are rendered as items
- xPosition, yPosition);
+
+ ItemStack itemStack;
+ if(isPickaxeAbility){
+ RenderHelper.enableGUIStandardItemLighting(); // GUI standard item lighting must be enabled for items that are rendered as blocks, like emerald blocks.
+ itemStack = new ItemStack(unlocked ? Blocks.emerald_block : Blocks.coal_block); // Pickaxe abilities are rendered as blocks
+ } else { // Non-pickaxe abilities are rendered as items
+ itemStack = new ItemStack(unlocked ? (perkLevel >= maxLevel ? Items.diamond : Items.emerald) : Items.coal);
+ }
+
+ ArrayList<String> tooltip = tooltipSupplier.get();
+ // Prepend the green, yellow, or red color on the first line of each tooltip depending on if the perk is unlocked
+ tooltip.set(0, (unlocked ? (perkLevel >= maxLevel ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) : EnumChatFormatting.RED) + tooltip.get(0));
+
+ NBTTagCompound nbt = new NBTTagCompound(); //Adding NBT Data for Custom Resource Packs
+ NBTTagCompound display = new NBTTagCompound();
+ display.setString("Name", tooltip.get(0));
+ nbt.setTag("display", display);
+ itemStack.setTagCompound(nbt);
+
+ Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(itemStack, xPosition, yPosition);
GlStateManager.enableLighting();
if (mouseX >= xPosition && mouseX < xPosition + 16) {
if (mouseY >= yPosition && mouseY <= yPosition + 16) {
- ArrayList<String> tooltip = tooltipSupplier.get();
- // Prepend the green or red color on the first line of each tooltip depending on if the perk is unlocked
- tooltip.set(0, (unlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + tooltip.get(0));
Utils.drawHoveringText(tooltip, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj);
}
}
@@ -3496,13 +3506,22 @@ public class GuiProfileViewer extends GuiScreen {
GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableLighting();
if(isRenderingBlock) RenderHelper.enableGUIStandardItemLighting();
+
+ ArrayList<String> tooltip = tooltipSupplier.get();
+ // Prepend the green or red color on the first line of each tooltip depending on if the perk is unlocked
+ if(!tooltip.get(0).contains("Peak of the Mountain")) tooltip.set(0, (unlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + tooltip.get(0)); //Peak of the Moutain has three color options, and is set already
+
+ NBTTagCompound nbt = new NBTTagCompound(); //Adding NBT Data for Resource Packs
+ NBTTagCompound display = new NBTTagCompound();
+ display.setString("Name", tooltip.get(0));
+ if(tooltip.get(0).contains("Peak of the Mountain")) display.setString("Lore", tooltip.get(1)); //Set Lore to Level
+ nbt.setTag("display", display);
+ itemStack.setTagCompound(nbt);
+
Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(itemStack, xPosition, yPosition);
GlStateManager.enableLighting();
if (mouseX >= xPosition && mouseX < xPosition + 16) {
if (mouseY >= yPosition && mouseY <= yPosition + 16) {
- ArrayList<String> tooltip = tooltipSupplier.get();
- // Prepend the green or red color on the first line of each tooltip depending on if the perk is unlocked
- tooltip.set(0, (unlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + tooltip.get(0));
Utils.drawHoveringText(tooltip, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj);
}
}