From bc6a76d6b5348b450ffc2e398030da6128a31cae Mon Sep 17 00:00:00 2001 From: DoKM Date: Tue, 6 Jul 2021 15:16:51 +0200 Subject: add voidgloom stats to profile viewer add voidgloom level to main profile viewer tab reorganize slayer tabs add voidgloom 3 and 4 and revenant 5 stats to slayer stats --- .../profileviewer/GuiProfileViewer.java | 5864 ++++++++++---------- .../profileviewer/ProfileViewer.java | 2243 ++++---- 2 files changed, 4064 insertions(+), 4043 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 3fe7d9d3..661bd5a9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1,2926 +1,2938 @@ -package io.github.moulberry.notenoughupdates.profileviewer; - -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.cosmetics.ShaderManager; -import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField; -import io.github.moulberry.notenoughupdates.util.SBInfo; -import io.github.moulberry.notenoughupdates.util.Constants; -import io.github.moulberry.notenoughupdates.util.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityOtherPlayerMP; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.*; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.resources.DefaultPlayerSkin; -import net.minecraft.client.resources.SkinManager; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.client.shader.Shader; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EnumPlayerModelParts; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.*; -import net.minecraft.util.*; -import org.apache.commons.lang3.text.WordUtils; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; -import org.lwjgl.opengl.GL20; - -import java.awt.*; -import java.io.IOException; -import java.text.NumberFormat; -import java.util.*; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class GuiProfileViewer extends GuiScreen { - - private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png"); - public static final ResourceLocation pv_basic = new ResourceLocation("notenoughupdates:pv_basic.png"); - public static final ResourceLocation pv_dung = new ResourceLocation("notenoughupdates:pv_dung.png"); - public static final ResourceLocation pv_extra = new ResourceLocation("notenoughupdates:pv_extra.png"); - public static final ResourceLocation pv_invs = new ResourceLocation("notenoughupdates:pv_invs.png"); - public static final ResourceLocation pv_cols = new ResourceLocation("notenoughupdates:pv_cols.png"); - public static final ResourceLocation pv_pets = new ResourceLocation("notenoughupdates:pv_pets.png"); - public static final ResourceLocation pv_dropdown = new ResourceLocation("notenoughupdates:pv_dropdown.png"); - public static final ResourceLocation pv_bg = new ResourceLocation("notenoughupdates:pv_bg.png"); - public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); - public static final ResourceLocation resource_packs = new ResourceLocation("minecraft:textures/gui/resource_packs.png"); - public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); - - private static final NumberFormat numberFormat = NumberFormat.getInstance(Locale.US); - - private final ProfileViewer.Profile profile; - public static ProfileViewerPage currentPage = ProfileViewerPage.BASIC; - private int sizeX; - private int sizeY; - private int guiLeft; - private int guiTop; - - private float backgroundRotation = 0; - - private long currentTime = 0; - private long lastTime = 0; - private long startTime = 0; - - private List tooltipToDisplay = null; - - private String profileId = null; - private boolean profileDropdownSelected = false; - - public enum ProfileViewerPage { - LOADING(null), - INVALID_NAME(null), - NO_SKYBLOCK(null), - BASIC(new ItemStack(Items.paper)), - DUNG(new ItemStack(Item.getItemFromBlock(Blocks.deadbush))), - EXTRA(new ItemStack(Items.book)), - INVS(new ItemStack(Item.getItemFromBlock(Blocks.ender_chest))), - COLS(new ItemStack(Items.painting)), - PETS(new ItemStack(Items.bone)); - - public final ItemStack stack; - - ProfileViewerPage(ItemStack stack) { - this.stack = stack; - } - } - - public GuiProfileViewer(ProfileViewer.Profile profile) { - this.profile = profile; - String name = ""; - if(profile != null && profile.getHypixelProfile() != null) { - name = profile.getHypixelProfile().get("displayname").getAsString(); - } - playerNameTextField = new GuiElementTextField(name, - GuiElementTextField.SCALE_TEXT); - playerNameTextField.setSize(100, 20); - - if(currentPage == ProfileViewerPage.LOADING) { - currentPage = ProfileViewerPage.BASIC; - } - } - - private GuiElementTextField playerNameTextField; - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - currentTime = System.currentTimeMillis(); - if(startTime == 0) startTime = currentTime; - - ProfileViewerPage page = currentPage; - if(profile == null) { - page = ProfileViewerPage.INVALID_NAME; - } else if(profile.getPlayerInformation(null) == null) { - page = ProfileViewerPage.LOADING; - } else if(profile.getLatestProfile() == null) { - page = ProfileViewerPage.NO_SKYBLOCK; - } - - if(profileId == null && profile != null && profile.getLatestProfile() != null) { - profileId = profile.getLatestProfile(); - } - - this.sizeX = 431; - this.sizeY = 202; - this.guiLeft = (this.width-this.sizeX)/2; - this.guiTop = (this.height-this.sizeY)/2; - - super.drawScreen(mouseX, mouseY, partialTicks); - drawDefaultBackground(); - - blurBackground(); - renderBlurredBackground(width, height, guiLeft+2, guiTop+2, sizeX-4, sizeY-4); - - GlStateManager.enableDepth(); - GlStateManager.translate(0, 0, 5); - renderTabs(true); - GlStateManager.translate(0, 0, -3); - - GlStateManager.disableDepth(); - GlStateManager.translate(0, 0, -2); - renderTabs(false); - GlStateManager.translate(0, 0, 2); - - GlStateManager.disableLighting(); - GlStateManager.enableDepth(); - GlStateManager.enableBlend(); - GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - - Minecraft.getMinecraft().getTextureManager().bindTexture(pv_bg); - Utils.drawTexturedRect(guiLeft, guiTop, sizeX, sizeY, GL11.GL_NEAREST); - - if(!(page == ProfileViewerPage.LOADING)) { - playerNameTextField.render(guiLeft+sizeX-100, guiTop+sizeY+5); - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - - if(profile != null) { - renderBlurredBackground(width, height, guiLeft+2, guiTop+sizeY+3+2, 100-4, 20-4); - Minecraft.getMinecraft().getTextureManager().bindTexture(pv_dropdown); - Utils.drawTexturedRect(guiLeft, guiTop+sizeY+3, 100, 20, - 0, 100/200f, 0, 20/185f, GL11.GL_NEAREST); - Utils.drawStringCenteredScaledMaxWidth(profileId, Minecraft.getMinecraft().fontRendererObj, guiLeft+50, - guiTop+sizeY+3+10, true, 90, new Color(63, 224, 208, 255).getRGB()); - - if(profileDropdownSelected && !profile.getProfileIds().isEmpty() && scaledResolution.getScaleFactor() != 4) { - int dropdownOptionSize = scaledResolution.getScaleFactor()==3?10:20; - - int numProfiles = profile.getProfileIds().size(); - int sizeYDropdown = numProfiles*dropdownOptionSize; - renderBlurredBackground(width, height, guiLeft+2, guiTop+sizeY+23, 100-4, sizeYDropdown-2); - Minecraft.getMinecraft().getTextureManager().bindTexture(pv_dropdown); - Utils.drawTexturedRect(guiLeft, guiTop+sizeY+23-3, 100, 3, - 100/200f, 1, 0, 3/185f, GL11.GL_NEAREST); - Utils.drawTexturedRect(guiLeft, guiTop+sizeY+23+sizeYDropdown-4, 100, 4, - 100/200f, 1, 181/185f, 1, GL11.GL_NEAREST); - Utils.drawTexturedRect(guiLeft, guiTop+sizeY+23, 100, sizeYDropdown-4, - 100/200f, 1, (181-sizeYDropdown)/185f, 181/185f, GL11.GL_NEAREST); - - for(int yIndex = 0; yIndex 333) { - if(currentTimeMod < 666) { - str += "."; - } else { - str += ".."; - } - } - - Utils.drawStringCentered(str, Minecraft.getMinecraft().fontRendererObj, - guiLeft+sizeX/2f, guiTop+101, true, 0); - break; - case INVALID_NAME: - Utils.drawStringCentered(EnumChatFormatting.RED+"Invalid name or API is down!", Minecraft.getMinecraft().fontRendererObj, - guiLeft+sizeX/2f, guiTop+101, true, 0); - break; - case NO_SKYBLOCK: - Utils.drawStringCentered(EnumChatFormatting.RED+"No skyblock data found!", Minecraft.getMinecraft().fontRendererObj, - guiLeft+sizeX/2f, guiTop+101, true, 0); - break; - } - - lastTime = currentTime; - - if(tooltipToDisplay != null) { - List grayTooltip = new ArrayList<>(tooltipToDisplay.size()); - for(String line : tooltipToDisplay) { - grayTooltip.add(EnumChatFormatting.GRAY + line); - } - Utils.drawHoveringText(grayTooltip, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj); - tooltipToDisplay = null; - } - } - - private void renderTabs(boolean renderPressed) { - int ignoredTabs = 0; - for(int i=0; i x && mouseX < x+28) { - if(mouseY > y && mouseY < y+32) { - if(currentPage != page) Utils.playPressSound(); - currentPage = page; - inventoryTextField.otherComponentClick(); - playerNameTextField.otherComponentClick(); - return; - } - } - } - } - switch (currentPage) { - case DUNG: - mouseClickedDung(mouseX, mouseY, mouseButton); - break; - case INVS: - inventoryTextField.setSize(88, 20); - if(mouseX > guiLeft+19 && mouseX < guiLeft+19+88) { - if(mouseY > guiTop+sizeY-26-20 && mouseY < guiTop+sizeY-26) { - inventoryTextField.mouseClicked(mouseX, mouseY, mouseButton); - playerNameTextField.otherComponentClick(); - return; - } - } - break; - case PETS: - if(sortedPets == null) break; - for(int i=petsPage*20; i guiLeft+x && mouseX < guiLeft+x+20) { - if(mouseY > guiTop+y && mouseY < guiTop+y+20) { - selectedPet = i; - return; - } - } - } - break; - } - if(mouseX > guiLeft+sizeX-100 && mouseX < guiLeft+sizeX) { - if(mouseY > guiTop+sizeY+5 && mouseY < guiTop+sizeY+25) { - playerNameTextField.mouseClicked(mouseX, mouseY, mouseButton); - inventoryTextField.otherComponentClick(); - return; - } - } - if(mouseX > guiLeft && mouseX < guiLeft+100 && profile != null && !profile.getProfileIds().isEmpty()) { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - if(mouseY > guiTop+sizeY+3 && mouseY < guiTop+sizeY+23) { - if(scaledResolution.getScaleFactor() == 4) { - profileDropdownSelected = false; - int profileNum = 0; - for(int index = 0; index= profile.getProfileIds().size()) profileNum = 0; - if(profileNum < 0) profileNum = profile.getProfileIds().size()-1; - - String newProfileId = profile.getProfileIds().get(profileNum); - if(profileId != null && !profileId.equals(newProfileId)) { - resetCache(); - } - profileId = newProfileId; - } else { - profileDropdownSelected = !profileDropdownSelected; - } - } else if(scaledResolution.getScaleFactor() != 4 && profileDropdownSelected) { - int dropdownOptionSize = scaledResolution.getScaleFactor()==3?10:20; - int extraY = mouseY - (guiTop+sizeY+23); - int index = extraY/dropdownOptionSize; - if(index >= 0 && index < profile.getProfileIds().size()) { - String newProfileId = profile.getProfileIds().get(index); - if(profileId != null && !profileId.equals(newProfileId)) { - resetCache(); - } - profileId = newProfileId; - } - } - playerNameTextField.otherComponentClick(); - inventoryTextField.otherComponentClick(); - return; - } - profileDropdownSelected = false; - playerNameTextField.otherComponentClick(); - inventoryTextField.otherComponentClick(); - } - - @Override - protected void keyTyped(char typedChar, int keyCode) throws IOException { - super.keyTyped(typedChar, keyCode); - switch (currentPage) { - case INVS: - keyTypedInvs(typedChar, keyCode); - inventoryTextField.keyTyped(typedChar, keyCode); - break; - case COLS: - keyTypedCols(typedChar, keyCode); - break; - case DUNG: - keyTypedDung(typedChar, keyCode); - break; - } - if(playerNameTextField.getFocus() && !(currentPage == ProfileViewerPage.LOADING)) { - if(keyCode == Keyboard.KEY_RETURN) { - currentPage = ProfileViewerPage.LOADING; - NotEnoughUpdates.profileViewer.getProfileByName(playerNameTextField.getText(), profile -> { //todo: invalid name - if(profile != null) profile.resetCache(); - Minecraft.getMinecraft().displayGuiScreen(new GuiProfileViewer(profile)); - }); - } - playerNameTextField.keyTyped(typedChar, keyCode); - } - } - - @Override - protected void mouseReleased(int mouseX, int mouseY, int mouseButton) { - super.mouseReleased(mouseX, mouseY, mouseButton); - - switch (currentPage) { - case INVS: - mouseReleasedInvs(mouseX, mouseY, mouseButton); - break; - case COLS: - mouseReleasedCols(mouseX, mouseY, mouseButton); - break; - case PETS: - mouseReleasedPets(mouseX, mouseY, mouseButton); - } - } - - protected void mouseClickedDung(int mouseX, int mouseY, int mouseButton) { - if(mouseX >= guiLeft+50 && mouseX <= guiLeft+70 && - mouseY >= guiTop+54 && mouseY <= guiTop+64) { - dungeonLevelTextField.mouseClicked(mouseX, mouseY, mouseButton); - } else { - dungeonLevelTextField.otherComponentClick(); - } - - int cW = fontRendererObj.getStringWidth("Calculate"); - if(mouseX >= guiLeft+23+110-17-cW && mouseX <= guiLeft+23+110-17 && - mouseY >= guiTop+55 && mouseY <= guiTop+65) { - calculateFloorLevelXP(); - } - - int y = guiTop+142; - - if(mouseY >= y-2 && mouseY <= y+9) { - for(int i=1; i<=7; i++) { - int w = fontRendererObj.getStringWidth(""+i); - - int x = guiLeft+23+110*i/8-w/2; - - if(mouseX >= x-2 && mouseX <= x+7) { - floorTime = i; - return; - } - } - } - } - - protected void keyTypedDung(char typedChar, int keyCode) { - dungeonLevelTextField.keyTyped(typedChar, keyCode); - } - - protected void keyTypedInvs(char typedChar, int keyCode) throws IOException { - switch(keyCode) { - case Keyboard.KEY_1: - case Keyboard.KEY_NUMPAD1: - selectedInventory = "inv_contents"; break; - case Keyboard.KEY_2: - case Keyboard.KEY_NUMPAD2: - selectedInventory = "ender_chest_contents"; break; - case Keyboard.KEY_3: - case Keyboard.KEY_NUMPAD3: - selectedInventory = "talisman_bag"; break; - case Keyboard.KEY_4: - case Keyboard.KEY_NUMPAD4: - selectedInventory = "wardrobe_contents"; break; - case Keyboard.KEY_5: - case Keyboard.KEY_NUMPAD5: - selectedInventory = "fishing_bag"; break; - case Keyboard.KEY_6: - case Keyboard.KEY_NUMPAD6: - selectedInventory = "potion_bag"; break; - } - Utils.playPressSound(); - } - - protected void keyTypedCols(char typedChar, int keyCode) throws IOException { - ItemStack stack = null; - Iterator items = ProfileViewer.getCollectionCatToCollectionMap().keySet().iterator(); - switch(keyCode) { - case Keyboard.KEY_5: - case Keyboard.KEY_NUMPAD5: - stack = items.next(); - case Keyboard.KEY_4: - case Keyboard.KEY_NUMPAD4: - stack = items.next(); - case Keyboard.KEY_3: - case Keyboard.KEY_NUMPAD3: - stack = items.next(); - case Keyboard.KEY_2: - case Keyboard.KEY_NUMPAD2: - stack = items.next(); - case Keyboard.KEY_1: - case Keyboard.KEY_NUMPAD1: - stack = items.next(); - } - if(stack != null) { - selectedCollectionCategory = stack; - } - Utils.playPressSound(); - } - - private void mouseReleasedPets(int mouseX, int mouseY, int mouseButton) { - if(mouseY > guiTop+6 && mouseY < guiTop+22) { - if(mouseX > guiLeft+100-15-12 && mouseX < guiLeft+100-20) { - if(petsPage > 0) { - petsPage--; - } - return; - } else if(mouseX > guiLeft+100+15 && mouseX < guiLeft+100+20+12) { - if(sortedPets != null && petsPage < Math.ceil(sortedPets.size()/20f)-1) { - petsPage++; - } - return; - } - } - } - - private void mouseReleasedInvs(int mouseX, int mouseY, int mouseButton) { - if(mouseButton == 0) { - int i=0; - for(Map.Entry entry : invNameToDisplayMap.entrySet()) { - int xIndex = i%3; - int yIndex = i/3; - - int x = guiLeft+19+34*xIndex; - int y = guiTop+26+34*yIndex; - - if(mouseX >= x && mouseX <= x+16) { - if(mouseY >= y && mouseY <= y+16) { - if(selectedInventory != entry.getKey()) Utils.playPressSound(); - selectedInventory = entry.getKey(); - return; - } - } - - i++; - } - - JsonObject inventoryInfo = profile.getInventoryInfo(profileId); - if(inventoryInfo == null) return; - - ItemStack[][][] inventories = getItemsForInventory(inventoryInfo, selectedInventory); - if(currentInventoryIndex >= inventories.length) currentInventoryIndex = inventories.length-1; - if(currentInventoryIndex < 0) currentInventoryIndex = 0; - - ItemStack[][] inventory = inventories[currentInventoryIndex]; - if(inventory == null) return; - - int inventoryRows = inventory.length; - int invSizeY = inventoryRows*18+17+7; - - int y = guiTop+101-invSizeY/2; - - if(mouseY > y+invSizeY && mouseY < y+invSizeY+16) { - if(mouseX > guiLeft+320-12 && mouseX < guiLeft+320+12) { - if(mouseX < guiLeft+320) { - currentInventoryIndex--; - } else { - currentInventoryIndex++; - } - } - } - } - } - - private ItemStack selectedCollectionCategory = null; - - private void mouseReleasedCols(int mouseX, int mouseY, int mouseButton) { - int collectionCatSize = ProfileViewer.getCollectionCatToCollectionMap().size(); - int collectionCatYSize = (int)(162f/(collectionCatSize-1+0.0000001f)); - int yIndex = 0; - for(ItemStack stack : ProfileViewer.getCollectionCatToCollectionMap().keySet()) { - if(mouseX > guiLeft+7 && mouseX < guiLeft+7+20) { - if(mouseY > guiTop+10+collectionCatYSize*yIndex && mouseY < guiTop+10+collectionCatYSize*yIndex+20) { - selectedCollectionCategory = stack; - Utils.playPressSound(); - return; - } - } - yIndex++; - } - } - - private static final ItemStack DEADBUSH = new ItemStack(Item.getItemFromBlock(Blocks.deadbush)); - private static final ItemStack[] BOSS_HEADS = new ItemStack[7]; - - private HashMap levelObjCatas = new HashMap<>(); - private HashMap> levelObjClasseses = new HashMap<>(); - - private GuiElementTextField dungeonLevelTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); - - private static final String[] dungSkillsName = {"Healer", "Mage", "Berserk", "Archer", "Tank"}; - private static final ItemStack[] dungSkillsStack = { new ItemStack(Items.potionitem, 1, 16389), - new ItemStack(Items.blaze_rod), new ItemStack(Items.iron_sword), new ItemStack(Items.bow), new ItemStack(Items.leather_chestplate)}; - private static final String[] bossFloorArr = {"Bonzo", "Scarf", "Professor", "Thorn", "Livid", "Sadan", "Necron"}; - private static final String[] bossFloorHeads = { - "12716ecbf5b8da00b05f316ec6af61e8bd02805b21eb8e440151468dc656549c", - "7de7bbbdf22bfe17980d4e20687e386f11d59ee1db6f8b4762391b79a5ac532d", - "9971cee8b833a62fc2a612f3503437fdf93cad692d216b8cf90bbb0538c47dd8", - "8b6a72138d69fbbd2fea3fa251cabd87152e4f1c97e5f986bf685571db3cc0", - "c1007c5b7114abec734206d4fc613da4f3a0e99f71ff949cedadc99079135a0b", - "fa06cb0c471c1c9bc169af270cd466ea701946776056e472ecdaeb49f0f4a4dc", - "a435164c05cea299a3f016bbbed05706ebb720dac912ce4351c2296626aecd9a" - }; - private static int floorTime = 7; - private int floorLevelTo = -1; - private int floorLevelToXP = -1; - - private void calculateFloorLevelXP() { - JsonObject leveling = Constants.LEVELING; - if(leveling == null) return; - ProfileViewer.Level levelObjCata = levelObjCatas.get(profileId); - if(levelObjCata == null) return; - - try { - dungeonLevelTextField.setCustomBorderColour(0xffffffff); - floorLevelTo = Integer.parseInt(dungeonLevelTextField.getText()); - - JsonArray levelingArray = Utils.getElement(leveling, "catacombs").getAsJsonArray(); - - float remaining = -((levelObjCata.level % 1) * levelObjCata.maxXpForLevel); - - for(int level=0; level= 0) { - dungeonLevelTextField.setText(""+(levelFloored+1)); - calculateFloorLevelXP(); - } - - int x = guiLeft+23; - int y = guiTop+25; - - renderXpBar(skillName, DEADBUSH, x, y, sectionWidth, levelObjCata, mouseX, mouseY); - - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Until Cata "+floorLevelTo+": ", - EnumChatFormatting.WHITE.toString()+shortNumberFormat(floorLevelToXP, 0), x, y+16, sectionWidth); - - if(mouseX > x && mouseX < x + sectionWidth && - mouseY > y+16 && mouseY < y+24) { - float xpF5 = 2000; - float xpF6 = 4000; - float xpF7 = 20000; - if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - xpF5 *= 1.1; - xpF6 *= 1.1; - xpF7 *= 1.1; - } - - long runsF5 = (int)Math.ceil(floorLevelToXP/xpF5); - long runsF6 = (int)Math.ceil(floorLevelToXP/xpF6); - long runsF7 = (int)Math.ceil(floorLevelToXP/xpF7); - - float timeF5 = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s_plus.5"), 0); - float timeF6 = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s_plus.6"), 0); - float timeF7 = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s_plus.7"), 0); - - tooltipToDisplay = Lists.newArrayList( - String.format("# F5 Runs (%s xp) : %d", shortNumberFormat(xpF5, 0), runsF5), - String.format("# F6 Runs (%s xp) : %d", shortNumberFormat(xpF6, 0), runsF6), - String.format("# F7 Runs (%s xp) : %d", shortNumberFormat(xpF7, 0), runsF7), - "" - ); - boolean hasTime = false; - if(timeF5 > 1000) { - tooltipToDisplay.add(String.format("Expected Time (F5) : %s", Utils.prettyTime(runsF5*(long)(timeF5*1.2)))); - hasTime = true; - } - if(timeF6 > 1000) { - tooltipToDisplay.add(String.format("Expected Time (F6) : %s", Utils.prettyTime(runsF6*(long)(timeF6*1.2)))); - hasTime = true; - } - if(timeF7 > 1000) { - tooltipToDisplay.add(String.format("Expected Time (F7) : %s", Utils.prettyTime(runsF7*(long)(timeF7*1.2)))); - hasTime = true; - } - if(hasTime) { - tooltipToDisplay.add(""); - } - if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - tooltipToDisplay.add("[Hold "+EnumChatFormatting.YELLOW+"SHIFT"+EnumChatFormatting.GRAY+" to show without Expert Ring]"); - } - if(Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { - if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) tooltipToDisplay.add(""); - tooltipToDisplay.add("Number of runs is calculated as [Remaining XP]/[XP per Run]."); - tooltipToDisplay.add("The [XP per Run] is the average xp gained from an S+ run"); - tooltipToDisplay.add("The "+EnumChatFormatting.DARK_PURPLE+"Catacombs Expert Ring"+EnumChatFormatting.GRAY+ - " is assumed to be used, unless "+EnumChatFormatting.YELLOW+"SHIFT"+EnumChatFormatting.GRAY+" is held."); - tooltipToDisplay.add("[Time per run] is calculated using fastestSPlus x 120%"); - } else { - tooltipToDisplay.add("[Hold "+EnumChatFormatting.YELLOW+"CTRL"+EnumChatFormatting.GRAY+" to see details]"); - } - } - - dungeonLevelTextField.setSize(20, 10); - dungeonLevelTextField.render(x+22, y+29); - int calcLen = fontRendererObj.getStringWidth("Calculate"); - Utils.renderShadowedString(EnumChatFormatting.WHITE+"Calculate", x+sectionWidth-17-calcLen/2f, - y+30, 100); - - //Random stats - - float secrets = Utils.getElementAsFloat(Utils.getElement(hypixelInfo, - "achievements.skyblock_treasure_hunter"), 0); - - float totalRuns = 0; - float totalRunsF5 = 0; - for(int i=1; i<=7; i++) { - float runs = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.tier_completions."+i), 0); - totalRuns += runs; - if(i >= 5) { - totalRunsF5 += runs; - } - } - - float mobKills = 0; - float mobKillsF5 = 0; - for(int i=1; i<=7; i++) { - float kills = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.mobs_killed."+i), 0); - mobKills += kills; - if(i >= 5) { - mobKillsF5 += kills; - } - } - - int miscTopY = y+55; - - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs ", - EnumChatFormatting.WHITE.toString()+((int)(totalRuns)), x, miscTopY, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Total Runs (F5-7) ", - EnumChatFormatting.WHITE.toString()+((int)(totalRunsF5)), x, miscTopY+10, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Secrets (Total) ", - EnumChatFormatting.WHITE.toString()+shortNumberFormat(secrets, 0), x, miscTopY+20, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Secrets (/Run) ", - EnumChatFormatting.WHITE.toString()+(Math.round(secrets/Math.max(1, totalRuns)*100)/100f), x, miscTopY+30, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Mob Kills (Total) ", - EnumChatFormatting.WHITE.toString()+shortNumberFormat(mobKills, 0), x, miscTopY+40, sectionWidth); - - int y3 = y+117; - - for(int i=1; i<=7; i++) { - int w = fontRendererObj.getStringWidth(""+i); - - int bx = x+sectionWidth*i/8-w/2; - - boolean invert = i == floorTime; - float uMin = 20/256f; - float uMax = 29/256f; - float vMin = 0/256f; - float vMax = 11/256f; - - GlStateManager.color(1, 1, 1, 1); - Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); - Utils.drawTexturedRect(bx-2, y3-2, 9, 11, - invert ? uMax : uMin, invert ? uMin : uMax, - invert ? vMax : vMin, invert ? vMin : vMax, GL11.GL_NEAREST); - - Utils.renderShadowedString(EnumChatFormatting.WHITE.toString()+i, bx+w/2, y3, 10); - } - - float timeNorm = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time."+floorTime), 0); - float timeS = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s."+floorTime), 0); - float timeSPLUS = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.fastest_time_s_plus."+floorTime), 0); - String timeNormStr = timeNorm <= 0 ? "N/A" : Utils.prettyTime((long)timeNorm); - String timeSStr = timeS <= 0 ? "N/A" : Utils.prettyTime((long)timeS); - String timeSPlusStr = timeSPLUS <= 0 ? "N/A" : Utils.prettyTime((long)timeSPLUS); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Floor "+floorTime+" ", - EnumChatFormatting.WHITE.toString()+timeNormStr, x, y3+10, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Floor "+floorTime+" S", - EnumChatFormatting.WHITE.toString()+timeSStr, x, y3+20, sectionWidth); - Utils.renderAlignedString(EnumChatFormatting.YELLOW+"Floor "+floorTime+" S+", - EnumChatFormatting.WHITE.toString()+timeSPlusStr, x, y3+30, sectionWidth); - } - - //Completions - { - int x = guiLeft+161; - int y = guiTop+27; - - Utils.renderShadowedString(EnumChatFormatting.RED+"Boss Collections", - x+sectionWidth/2, y, sectionWidth); - for(int i=1; i<=7; i++) { - float compl = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.dungeon_types.catacombs.tier_completions."+i), 0); - - if(BOSS_HEADS[i-1] == null) { - String textureLink = bossFloorHeads[i-1]; - - String b64Decoded = "{\"textures\":{\"SKIN\":{\"url\":\"http://textures.minecraft.net/texture/" + textureLink + "\"}}}"; - String b64Encoded = new String(Base64.getEncoder().encode(b64Decoded.getBytes())); - - ItemStack stack = new ItemStack(Items.skull, 1, 3); - NBTTagCompound nbt = new NBTTagCompound(); - NBTTagCompound skullOwner = new NBTTagCompound(); - NBTTagCompound properties = new NBTTagCompound(); - NBTTagList textures = new NBTTagList(); - NBTTagCompound textures_0 = new NBTTagCompound(); - - String uuid = UUID.nameUUIDFromBytes(b64Encoded.getBytes()).toString(); - skullOwner.setString("Id", uuid); - skullOwner.setString("Name", uuid); - - textures_0.setString("Value", b64Encoded); - textures.appendTag(textures_0); - - properties.setTag("textures", textures); - skullOwner.setTag("Properties", properties); - nbt.setTag("SkullOwner", skullOwner); - stack.setTagCompound(nbt); - - BOSS_HEADS[i-1] = stack; - } - - GlStateManager.pushMatrix(); - GlStateManager.translate(x-4, y+10+20*(i-1), 0); - GlStateManager.scale(1.3f, 1.3f, 1); - Utils.drawItemStack(BOSS_HEADS[i-1], 0, 0); - GlStateManager.popMatrix(); - - Utils.renderAlignedString(String.format(EnumChatFormatting.YELLOW+"%s (F%d) ", bossFloorArr[i-1], i), - EnumChatFormatting.WHITE.toString()+(int)compl, - x+16, y+18+20*(i-1), sectionWidth-15); - - } - } - - //Skills - { - int x = guiLeft+298; - int y = guiTop+27; - - //Gui.drawRect(x, y, x+120, y+147, 0xffffffff); - - Utils.renderShadowedString(EnumChatFormatting.DARK_PURPLE+"Class Levels", - x+sectionWidth/2, y, sectionWidth); - - JsonElement activeClassElement = Utils.getElement(profileInfo, "dungeons.selected_dungeon_class"); - String activeClass = null; - if(activeClassElement instanceof JsonPrimitive && ((JsonPrimitive) activeClassElement).isString()) { - activeClass = activeClassElement.getAsString(); - } - - for(int i=0; i levelObjClasses = levelObjClasseses.computeIfAbsent(profileId, k->new HashMap<>()); - if(!levelObjClasses.containsKey(skillName)) { - float cataXp = Utils.getElementAsFloat(Utils.getElement(profileInfo, - "dungeons.player_classes."+skillName.toLowerCase()+".experience"), 0); - ProfileViewer.Level levelObj = ProfileViewer.getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), - cataXp, 50, false); - levelObjClasses.put(skillName, levelObj); - } - - String colour = EnumChatFormatting.WHITE.toString(); - if(skillName.toLowerCase().equals(activeClass)) { - colour = EnumChatFormatting.GREEN.toString(); - } - - ProfileViewer.Level levelObj = levelObjClasses.get(skillName); - - renderXpBar(colour+skillName, dungSkillsStack[i], x, y+20+29*i, sectionWidth, levelObj, mouseX, mouseY); - } - } - } - - private void renderXpBar(String skillName, ItemStack stack, int x, int y, int xSize, ProfileViewer.Level levelObj, int mouseX, int mouseY) { - float level = levelObj.level; - int levelFloored = (int)Math.floor(level); - - Utils.renderAlignedString(skillName, EnumChatFormatting.WHITE.toString()+levelFloored, x+14, y-4, xSize-20); - - if(levelObj.maxed) { - renderGoldBar(x, y+6, xSize); - } else { - renderBar(x, y+6, xSize, level%1); - } - - if(mouseX > x && mouseX < x+120) { - if(mouseY > y-4 && mouseY < y+13) { - String levelStr; - if(levelObj.maxed) { - levelStr = EnumChatFormatting.GOLD+"MAXED!"; - } else { - int maxXp = (int)levelObj.maxXpForLevel; - levelStr = EnumChatFormatting.DARK_PURPLE.toString() + shortNumberFormat(Math.round((level%1)*maxXp), - 0) + "/" + shortNumberFormat(maxXp, 0); - } - - tooltipToDisplay = Utils.createList(levelStr); - } - } - - GL11.glTranslatef((x), (y-6f), 0); - GL11.glScalef(0.7f, 0.7f, 1); - Utils.drawItemStackLinear(stack, 0, 0); - GL11.glScalef(1/0.7f, 1/0.7f, 1); - GL11.glTranslatef(-(x), -(y-6f), 0); - } - - public static class PetLevel { - public float level; - public float currentLevelRequirement; - public float maxXP; - public float levelPercentage; - public float levelXp; - public float totalXp; - } - - public static PetLevel getPetLevel(JsonArray levels, int offset, float exp) { - float xpTotal = 0; - float level = 1; - float currentLevelRequirement = 0; - float currentLevelProgress = 0; - - boolean addLevel = true; - - for(int i=offset; i exp) { - currentLevelProgress = (exp-(xpTotal-currentLevelRequirement)); - addLevel = false; - } else { - level += 1; - } - } else { - xpTotal += levels.get(i).getAsFloat(); - } - } - - level += currentLevelProgress/currentLevelRequirement; - if(level <= 0) { - level = 1; - } else if(level > 100) { - level = 100; - } - PetLevel levelObj = new PetLevel(); - levelObj.level = level; - levelObj.currentLevelRequirement = currentLevelRequirement; - levelObj.maxXP = xpTotal; - levelObj.levelPercentage = currentLevelProgress/currentLevelRequirement; - levelObj.levelXp = currentLevelProgress; - levelObj.totalXp = exp; - return levelObj; - } - - public static final HashMap> PET_STAT_BOOSTS = new HashMap<>(); - static { - HashMap bigTeeth = new HashMap<>(); - bigTeeth.put("CRIT_CHANCE", 5f); - PET_STAT_BOOSTS.put("PET_ITEM_BIG_TEETH_COMMON", bigTeeth); - - HashMap hardenedScales = new HashMap<>(); - hardenedScales.put("DEFENCE", 25f); - PET_STAT_BOOSTS.put("PET_ITEM_HARDENED_SCALES_UNCOMMON", hardenedScales); - - HashMap luckyClover = new HashMap<>(); - luckyClover.put("MAGIC_FIND", 7f); - PET_STAT_BOOSTS.put("PET_ITEM_LUCKY_CLOVER", luckyClover); - - HashMap sharpenedClaws = new HashMap<>(); - sharpenedClaws.put("CRIT_DAMAGE", 15f); - PET_STAT_BOOSTS.put("PET_ITEM_SHARPENED_CLAWS_UNCOMMON", sharpenedClaws); - } - public static final HashMap> PET_STAT_BOOSTS_MULT = new HashMap<>(); - static { - HashMap ironClaws = new HashMap<>(); - ironClaws.put("CRIT_DAMAGE", 1.4f); - ironClaws.put("CRIT_CHANCE", 1.4f); - PET_STAT_BOOSTS_MULT.put("PET_ITEM_IRON_CLAWS_COMMON", ironClaws); - - HashMap textbook = new HashMap<>(); - textbook.put("INTELLIGENCE", 2f); - PET_STAT_BOOSTS_MULT.put("PET_ITEM_TEXTBOOK", textbook); - } - - private int selectedPet = -1; - private int petsPage = 0; - private List sortedPets = null; - private List sortedPetsStack = null; - public static HashMap MINION_RARITY_TO_NUM = new HashMap<>(); - static { - MINION_RARITY_TO_NUM.put("COMMON", "0"); - MINION_RARITY_TO_NUM.put("UNCOMMON", "1"); - MINION_RARITY_TO_NUM.put("RARE", "2"); - MINION_RARITY_TO_NUM.put("EPIC", "3"); - MINION_RARITY_TO_NUM.put("LEGENDARY", "4"); - MINION_RARITY_TO_NUM.put("MYTHIC", "5"); - } - private void drawPetsPage(int mouseX, int mouseY, float partialTicks) { - JsonObject petsInfo = profile.getPetsInfo(profileId); - if(petsInfo == null) return; - JsonObject petsJson = Constants.PETS; - if(petsJson == null) return; - - String location = null; - JsonObject status = profile.getPlayerStatus(); - if(status != null && status.has("mode")) { - location = status.get("mode").getAsString(); - } - - backgroundRotation += (currentTime - lastTime)/400f; - backgroundRotation %= 360; - - String panoramaIdentifier = "day"; - if(SBInfo.getInstance().currentTimeDate != null) { - if(SBInfo.getInstance().currentTimeDate.getHours() <= 6 || - SBInfo.getInstance().currentTimeDate.getHours() >= 20) { - panoramaIdentifier = "night"; - } - } - - JsonArray pets = petsInfo.get("pets").getAsJsonArray(); - if(sortedPets == null) { - sortedPets = new ArrayList<>(); - sortedPetsStack = new ArrayList<>(); - for(int i=0; i { - String tier1 = pet1.get("tier").getAsString(); - String tierNum1 = MINION_RARITY_TO_NUM.get(tier1); - if(tierNum1 == null) return 1; - int tierNum1I = Integer.parseInt(tierNum1); - float exp1 = pet1.get("exp").getAsFloat(); - - String tier2 = pet2.get("tier").getAsString(); - String tierNum2 = MINION_RARITY_TO_NUM.get(tier2); - if(tierNum2 == null) return -1; - int tierNum2I = Integer.parseInt(tierNum2); - float exp2 = pet2.get("exp").getAsFloat(); - - if(tierNum1I != tierNum2I) { - return tierNum2I - tierNum1I; - } else { - return (int)(exp2 - exp1); - } - }); - for(JsonObject pet : sortedPets) { - String petname = pet.get("type").getAsString(); - String tier = pet.get("tier").getAsString(); - String heldItem = Utils.getElementAsString(pet.get("heldItem"), null); - JsonObject heldItemJson = heldItem==null?null:NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(heldItem); - String tierNum = MINION_RARITY_TO_NUM.get(tier); - float exp = pet.get("exp").getAsFloat(); - if(tierNum == null) continue; - - if(pet.has("heldItem") && !pet.get("heldItem").isJsonNull() && pet.get("heldItem").getAsString().equals("PET_ITEM_TIER_BOOST")) { - tierNum = ""+(Integer.parseInt(tierNum)+1); - } - - int petRarityOffset = petsJson.get("pet_rarity_offset").getAsJsonObject().get(tier).getAsInt(); - JsonArray levelsArr = petsJson.get("pet_levels").getAsJsonArray(); - - PetLevel levelObj = getPetLevel(levelsArr, petRarityOffset, exp); - float level = levelObj.level; - float currentLevelRequirement = levelObj.currentLevelRequirement; - float maxXP = levelObj.maxXP; - pet.addProperty("level", level); - pet.addProperty("currentLevelRequirement", currentLevelRequirement); - pet.addProperty("maxXP", maxXP); - - JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(petname+";"+tierNum); - if(petItem == null) continue; - - ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem, false, false); - HashMap replacements = NotEnoughUpdates.INSTANCE.manager.getLoreReplacements(petname, tier, (int)Math.floor(level)); - - if(heldItem != null) { - HashMap petStatBoots = PET_STAT_BOOSTS.get(heldItem); - HashMap petStatBootsMult = PET_STAT_BOOSTS_MULT.get(heldItem); - if(petStatBoots != null) { - for(Map.Entry entryBoost : petStatBoots.entrySet()) { - try { - float value = Float.parseFloat(replacements.get(entryBoost.getKey())); - replacements.put(entryBoost.getKey(), String.valueOf((int)Math.floor(value+entryBoost.getValue()))); - } catch(Exception ignored) {} - } - - } - if(petStatBootsMult != null) { - for(Map.Entry entryBoost : petStatBootsMult.entrySet()) { - try { - float value = Float.parseFloat(replacements.get(entryBoost.getKey())); - replacements.put(entryBoost.getKey(), String.valueOf((int)Math.floor(value*entryBoost.getValue()))); - } catch(Exception ignored) {} - } - } - } - - NBTTagCompound tag = stack.getTagCompound()==null?new NBTTagCompound():stack.getTagCompound(); - if(tag.hasKey("display", 10)) { - NBTTagCompound display = tag.getCompoundTag("display"); - if(display.hasKey("Lore", 9)) { - NBTTagList newNewLore = new NBTTagList(); - NBTTagList newLore = new NBTTagList(); - NBTTagList lore = display.getTagList("Lore", 8); - HashMap blankLocations = new HashMap<>(); - for(int j=0; j replacement : replacements.entrySet()) { - line = line.replace("{"+replacement.getKey()+"}", replacement.getValue()); - } - newLore.appendTag(new NBTTagString(line)); - } - Integer secondLastBlank = blankLocations.get(blankLocations.size()-2); - if(heldItemJson != null && secondLastBlank != null) { - for(int j=0; j2) { - break; - } - } - } - - newNewLore.appendTag(new NBTTagString(line)); - } - display.setTag("Lore", newNewLore); - } else { - display.setTag("Lore", newLore); - } - } - if(display.hasKey("Name", 8)) { - String displayName = display.getString("Name"); - for(Map.Entry replacement : replacements.entrySet()) { - displayName = displayName.replace("{"+replacement.getKey()+"}", replacement.getValue()); - } - display.setTag("Name", new NBTTagString(displayName)); - } - tag.setTag("display", display); - } - stack.setTagCompound(tag); - - sortedPetsStack.add(stack); - } - } - - Panorama.drawPanorama(-backgroundRotation, guiLeft+212, guiTop+44, 81, 108, -0.37f, 0.6f, - getPanoramasForLocation(location==null?"dynamic":location, panoramaIdentifier)); - - Minecraft.getMinecraft().getTextureManager().bindTexture(pv_pets); - Utils.drawTexturedRect(guiLeft, guiTop, sizeX, sizeY, GL11.GL_NEAREST); - - Utils.drawStringCentered(EnumChatFormatting.DARK_PURPLE+"Pets", Minecraft.getMinecraft().fontRendererObj, - guiLeft+100, guiTop+14, true, 4210752); - GlStateManager.color(1, 1, 1, 1); - - JsonElement activePetElement = petsInfo.get("active_pet"); - if(selectedPet == -1 && activePetElement != null && activePetElement.isJsonObject()) { - JsonObject active = activePetElement.getAsJsonObject(); - for(int i=0; i guiTop+6 && mouseY < guiTop+22) { - if(mouseX > guiLeft+100-20-12 && mouseX < guiLeft+100-20) { - leftHovered = true; - } else if(mouseX > guiLeft+100+20 && mouseX < guiLeft+100+20+12) { - rightHovered = true; - } - } - } - Minecraft.getMinecraft().getTextureManager().bindTexture(resource_packs); - - if(petsPage > 0) { - Utils.drawTexturedRect(guiLeft+100-15-12, guiTop+6, 12, 16, - 29/256f, 53/256f, !leftHovered?0:32/256f, !leftHovered?32/256f:64/256f, GL11.GL_NEAREST); - } - if(petsPage < Math.ceil(pets.size()/20f)-1) { - Utils.drawTexturedRect( guiLeft+100+15, guiTop+6, 12, 16, - 5/256f, 29/256f, !rightHovered?0:32/256f, !rightHovered?32/256f:64/256f, GL11.GL_NEAREST); - } - - for(int i=petsPage*20; i guiLeft+x && mouseX < guiLeft+x+20) { - if(mouseY > guiTop+y && mouseY < guiTop+y+20) { - tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - } - } - } - } - - if(selectedPet >= 0) { - ItemStack petStack = sortedPetsStack.get(selectedPet); - String display = petStack.getDisplayName(); - JsonObject pet = sortedPets.get(selectedPet); - String type = pet.get("type").getAsString(); - - for(int i=0; i<4; i++) { - JsonObject item = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(type+";"+i); - if(item != null) { - int x = guiLeft+280; - float y = guiTop+67+15*(float)Math.sin(((currentTime-startTime)/800f)%(2*Math.PI)); - - int displayLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(display); - int halfDisplayLen = displayLen/2; - - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, 0); - - drawRect(-halfDisplayLen-1-28, -1, halfDisplayLen+1-28, 8, new Color(0, 0, 0, 100).getRGB()); - - Minecraft.getMinecraft().fontRendererObj.drawString(display, -halfDisplayLen-28, 0, 0, true); - - ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(item); - GlStateManager.enableDepth(); - GlStateManager.translate(-55, 0, 0); - GlStateManager.scale(3.5f, 3.5f, 1); - Utils.drawItemStack(stack, 0, 0); - GlStateManager.popMatrix(); - break; - } - } - - float level = pet.get("level").getAsFloat(); - float currentLevelRequirement = pet.get("currentLevelRequirement").getAsFloat(); - float exp = pet.get("exp").getAsFloat(); - float maxXP = pet.get("maxXP").getAsFloat(); - - String[] split = display.split("] "); - String colouredName = split[split.length-1]; - - Utils.renderAlignedString(colouredName, EnumChatFormatting.WHITE+"Level "+(int)Math.floor(level), guiLeft+319, guiTop+28, 98); - - //Utils.drawStringCenteredScaledMaxWidth(, Minecraft.getMinecraft().fontRendererObj, guiLeft+368, guiTop+28+4, true, 98, 0); - //renderAlignedString(display, EnumChatFormatting.YELLOW+"[LVL "+Math.floor(lev