diff options
44 files changed, 3019 insertions, 290 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2df530bf..56fe7093 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,13 +2,15 @@ name: Build on: push: - branches: [ master ] + branches: + - '*' paths-ignore: - 'README.md' - 'LICENSE' - '.gitignore' pull_request: - branches: [ master ] + branches: + - '*' paths-ignore: - 'README.md' - 'LICENSE' @@ -21,22 +23,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 8 + uses: actions/setup-java@v2 with: - java-version: 1.8 - - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Grant execute permission for gradlew - run: chmod +x gradlew + java-version: 8 + distribution: zulu + cache: gradle - name: Build with Gradle - run: ./gradlew build --no-daemon + run: chmod +x ./gradlew && ./gradlew setupCIWorkspace build --no-daemon - uses: actions/upload-artifact@v2 with: path: build/libs/*.jar diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md new file mode 100644 index 00000000..0a3c9685 --- /dev/null +++ b/Update Notes/2.1.md @@ -0,0 +1,33 @@ +# These are the change notes for NEU 2.1 REL + +### **Major Changes** +- Added mining skill overlay +- Added fishing skill overlay +- [Added mining tab in /pv](https://cdn.discordapp.com/attachments/832652653292027904/903619242384056370/unknown.png) +- Big thanks to kwev1n for some math and jani for the texture +### **Minor Changes:** +- Make cata xp in /pv be calculated on how many runs you have and shows master mode xp rates +- Hide mine waypoints when at location setting - Lulonaut +- Added some info panels to some settings in /neu +- Added /pv button in /neu +- Added pitch and coins/m as options in farming skill overlay +- Make it so tab completion in ah search GUI goes down the items - Lulonaut +- Added a toggle for enchant glint in storage gui (ty ery for texture) +- Added fairy souls option to /neu misc +- Added a button in storage menu to open the settings +- Added an option to change the click names for /pv to /ah +- Added a help menu to /neuec +### **Bug Fixes** +- Made titanium overlay and waypoints work with dwarven overlay off +- "fixed" divan rarity in NEUAH (scuffed) +- Made etherwarp block overlay config option +- Fixed ram usage in crystal hollows - Dokm +- Made skills not show int limit when at max level in skill overlays +- Fixed space cape texture - Microcontrollers +- Make it so you can hold down keys in sign GUIs +### **Other** +- New icons was added in storage_icons.png +- Moved the help icon in /neucustomize over a lil +- Added dg partner cape +### **Previous change log** +https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/Update%20Notes/2.0-Pre31-Release.md diff --git a/build.gradle b/build.gradle index f2620a00..3258358f 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ apply plugin: 'com.github.johnrengelman.shadow' sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = "2.0-PRE" +version = "2.1-REL" group= "io.github.moulberry" archivesBaseName = "NotEnoughUpdates" String modid = "notenoughupdates" diff --git a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java index 7eefac6a..5cadd856 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java @@ -70,6 +70,12 @@ public class CustomItems { "Your life has been a lie,", "the moon is made out of iron." ); + public static JsonObject NOPO = create( + "nopo", + "writable_book", + "Nopo", + "We do a lil Chatting" + ); /** * SHAAAAAAAAAAAAAAAAAAME diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 527abd02..aca9a8c5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -204,7 +204,10 @@ public class NEUEventListener { @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - if (Minecraft.getMinecraft().currentScreen == null || !(Minecraft.getMinecraft().currentScreen instanceof GuiChat)) { + if (Minecraft.getMinecraft().currentScreen != null && (Minecraft.getMinecraft().currentScreen instanceof GuiChat + || Minecraft.getMinecraft().currentScreen instanceof GuiEditSign || Minecraft.getMinecraft().currentScreen instanceof GuiScreenBook)) { + Keyboard.enableRepeatEvents(true); + } else { Keyboard.enableRepeatEvents(false); } if (event.phase != TickEvent.Phase.START) return; @@ -240,7 +243,7 @@ public class NEUEventListener { inventoryLoadedTicks = 3; } - if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1) && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4) && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD9)) { + if ((Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1) && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4) && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD9))) { ChatComponentText component = new ChatComponentText("\u00a7cYou are permanently banned from this server!"); component.appendText("\n"); component.appendText("\n\u00a77Reason: \u00a7rSuspicious account activity/Other"); @@ -793,13 +796,17 @@ public class NEUEventListener { private IChatComponent replaceSocialControlsWithPV(IChatComponent chatComponent) { - if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions && chatComponent.getChatStyle() != null && chatComponent.getChatStyle().getChatClickEvent() != null && chatComponent.getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND) { + if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 > 0 && chatComponent.getChatStyle() != null && chatComponent.getChatStyle().getChatClickEvent() != null && chatComponent.getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND) { if (chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")) { String username = chatComponent.getChatStyle().getChatClickEvent().getValue().substring(15); - - chatComponent.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/pv " + username, "" + EnumChatFormatting.YELLOW + "Click to open " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + username + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + "'s profile in " + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + "NEU's" + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + " profile viewer.")); - return chatComponent; - } + if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 == 1) { + chatComponent.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/pv " + username, "" + EnumChatFormatting.YELLOW + "Click to open " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + username + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + "'s profile in " + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + "NEU's" + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + " profile viewer.")); + return chatComponent; + } else if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 == 2) { + chatComponent.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/ah " + username, "" + EnumChatFormatting.YELLOW + "Click to open " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + username + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + "'s /ah page")); + return chatComponent; + } + } // wanted to add this for guild but guild uses uuid :sad: } return chatComponent; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index f40c60cd..adf0df8b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1308,6 +1308,10 @@ public class NEUOverlay extends Gui { case "ironm00n": searchedItems.add(CustomItems.IRONM00N); break; + case "nopo": + case "nopothegamer": + searchedItems.add(CustomItems.NOPO); + break; } this.searchedItems = searchedItems; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java index 6f3209b2..75af7de1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java @@ -144,12 +144,12 @@ public class CustomAH extends Gui { private static final int SORT_MODE_LOW = 1; private static final int SORT_MODE_SOON = 2; - // private static final String[] rarities = {"COMMON", "UNCOMMON", "RARE", "EPIC", -// "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME"}; +// private static final String[] rarities = {"COMMON", "UNCOMMON", "RARE", "EPIC", +// "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME", "DIVINE"}; private static final String[] rarityColours = {"" + EnumChatFormatting.WHITE, "" + EnumChatFormatting.GREEN, "" + EnumChatFormatting.BLUE, "" + EnumChatFormatting.DARK_PURPLE, "" + EnumChatFormatting.GOLD, "" + EnumChatFormatting.LIGHT_PURPLE, "" + EnumChatFormatting.RED, - "" + EnumChatFormatting.RED, "" + EnumChatFormatting.DARK_RED}; + "" + EnumChatFormatting.RED,"" + EnumChatFormatting.AQUA, "" + EnumChatFormatting.AQUA}; private static final int BIN_FILTER_ALL = 0; private static final int BIN_FILTER_BIN = 1; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorFSR.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorFSR.java new file mode 100644 index 00000000..e6ec3548 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorFSR.java @@ -0,0 +1,16 @@ +package io.github.moulberry.notenoughupdates.core.config.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface ConfigEditorFSR { + + int runnableId(); + + String buttonText() default ""; + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorFSR.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorFSR.java new file mode 100644 index 00000000..545241c0 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorFSR.java @@ -0,0 +1,63 @@ +package io.github.moulberry.notenoughupdates.core.config.gui; + +import io.github.moulberry.notenoughupdates.core.config.Config; +import io.github.moulberry.notenoughupdates.core.config.struct.ConfigProcessor; +import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; +import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.input.Mouse; + +import static io.github.moulberry.notenoughupdates.util.GuiTextures.button_fsr; + +public class GuiOptionEditorFSR extends GuiOptionEditor { + + private final int runnableId; + private String buttonText; + private final Config config; + + public GuiOptionEditorFSR(ConfigProcessor.ProcessedOption option, int runnableId, String buttonText, Config config) { + super(option); + this.runnableId = runnableId; + this.config = config; + + this.buttonText = buttonText; + if (this.buttonText != null && this.buttonText.isEmpty()) this.buttonText = null; + } + + @Override + public void render(int x, int y, int width) { + super.render(x, y, width); + + int height = getHeight(); + + GlStateManager.color(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(button_fsr); + RenderUtils.drawTexturedRect(x + width / 6 - 24, y + height - 7 - 14, 48, 16); + + if (buttonText != null) { + TextRenderUtils.drawStringCenteredScaledMaxWidth(buttonText, Minecraft.getMinecraft().fontRendererObj, + x + width / 6, y + height - 7 - 6, + false, 44, 0xFF303030); + } + } + + @Override + public boolean mouseInput(int x, int y, int width, int mouseX, int mouseY) { + if (Mouse.getEventButtonState()) { + int height = getHeight(); + if (mouseX > x + width / 6 - 24 && mouseX < x + width / 6 + 24 && + mouseY > y + height - 7 - 14 && mouseY < y + height - 7 + 2) { + config.executeRunnable(runnableId); + return true; + } + } + + return false; + } + + @Override + public boolean keyboardInput() { + return false; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java index b1581458..3c4e6833 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java @@ -115,6 +115,10 @@ public class ConfigProcessor { ConfigEditorButton configEditorAnnotation = optionField.getAnnotation(ConfigEditorButton.class); editor = new GuiOptionEditorButton(option, configEditorAnnotation.runnableId(), configEditorAnnotation.buttonText(), config); } + if (optionField.isAnnotationPresent(ConfigEditorFSR.class)) { + ConfigEditorFSR configEditorAnnotation = optionField.getAnnotation(ConfigEditorFSR.class); + editor = new GuiOptionEditorFSR(option, configEditorAnnotation.runnableId(), configEditorAnnotation.buttonText(), config); + } if (optionType.isAssignableFrom(boolean.class) && optionField.isAnnotationPresent(ConfigEditorBoolean.class)) { editor = new GuiOptionEditorBoolean(option); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index d1344150..768c316b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -79,6 +79,7 @@ public class CapeManager { new CapeData("sbp", true, false), new CapeData("sharex", true, false), new CapeData("sharex_white", true, false), + new CapeData("dg", true, false), //Content Creator new CapeData("jakethybro", false, true), diff --git a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java index 963c04bf..165e30a5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java @@ -127,6 +127,11 @@ public class NEUItemEditor extends GuiScreen { })); rightOptions.add(new GuiElementButton("Add enchant glint", Color.ORANGE.getRGB(), () -> nbttag.setTag("ench", new NBTTagList()))); + rightOptions.add(new GuiElementButton("Remove timestamp/uuid", Color.RED.getRGB(), () -> { + nbttag.getCompoundTag("ExtraAttributes").removeTag("uuid"); + nbttag.getCompoundTag("ExtraAttributes").removeTag("timestamp"); + })); + resetScrollToTop(); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index e592a503..34b444c6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -556,7 +556,7 @@ public class CustomItemEffects { if (dist != 0) { etherwarpRaycast = raycast(Minecraft.getMinecraft().thePlayer, 1f, dist, 0.1f); - if (etherwarpRaycast != null) { + if (etherwarpRaycast != null && NotEnoughUpdates.INSTANCE.config.itemOverlays.enableEtherwarpBlockOverlay) { AxisAlignedBB bb = etherwarpRaycast.state.getBlock().getSelectedBoundingBox(Minecraft.getMinecraft().theWorld, etherwarpRaycast.pos) .expand(0.01D, 0.01D, 0.01D).offset(-d0, -d1, -d2); drawFilledBoundingBox(bb, 1f, NotEnoughUpdates.INSTANCE.config.itemOverlays.etherwarpHighlightColour); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java index dec3f7d7..629b42d6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java @@ -193,7 +193,6 @@ public class DwarvenMinesWaypoints { if (!SBInfo.getInstance().getLocation().equals("mining_3")) return; int locWaypoint = NotEnoughUpdates.INSTANCE.config.mining.locWaypoints; - if (dynamicLocation != null && dynamicName != null && System.currentTimeMillis() - dynamicMillis < 30 * 1000) { for (Map.Entry<String, Vector3f> entry : waypointsMap.entrySet()) { @@ -203,14 +202,17 @@ public class DwarvenMinesWaypoints { } } } - + String skyblockLocation = SBInfo.getInstance().location.toLowerCase(); if (locWaypoint >= 1) { for (Map.Entry<String, Vector3f> entry : waypointsMap.entrySet()) { if (locWaypoint >= 2) { RenderUtils.renderWayPoint(EnumChatFormatting.AQUA + entry.getKey(), entry.getValue(), event.partialTicks); } else { + String commissionLocation = entry.getKey().toLowerCase(); for (String commissionName : MiningOverlay.commissionProgress.keySet()) { - if (commissionName.toLowerCase().contains(entry.getKey().toLowerCase())) { + if (NotEnoughUpdates.INSTANCE.config.mining.hideWaypointIfAtLocation) + if (commissionLocation.replace("'", "").equals(skyblockLocation)) continue; + if (commissionName.toLowerCase().contains(commissionLocation)) { if (commissionName.contains("Titanium")) { RenderUtils.renderWayPoint(EnumChatFormatting.WHITE + entry.getKey(), entry.getValue(), event.partialTicks); } else { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java index 95dde052..faef1bcf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java @@ -94,7 +94,7 @@ public class FairySouls { } public static void tick() { - if (!enabled) return; + if (!NotEnoughUpdates.INSTANCE.config.misc.fariySoul) return; if (Minecraft.getMinecraft().theWorld == null) { currentSoulList = null; @@ -161,7 +161,7 @@ public class FairySouls { @SubscribeEvent public void onRenderLast(RenderWorldLastEvent event) { - if (!enabled) return; + if (!NotEnoughUpdates.INSTANCE.config.misc.fariySoul) return; String location = SBInfo.getInstance().getLocation(); if (location == null) return; @@ -204,12 +204,12 @@ public class FairySouls { case "on": case "enable": print(EnumChatFormatting.DARK_PURPLE + "Enabled fairy soul waypoints"); - enabled = true; + NotEnoughUpdates.INSTANCE.config.misc.fariySoul = true; return; case "off": case "disable": print(EnumChatFormatting.DARK_PURPLE + "Disabled fairy soul waypoints"); - enabled = false; + NotEnoughUpdates.INSTANCE.config.misc.fariySoul = false; return; case "clear": { String location = SBInfo.getInstance().getLocation(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index 6ba0b34b..87084199 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -10,9 +10,11 @@ import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -31,6 +33,8 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static io.github.moulberry.notenoughupdates.util.GuiTextures.help; + public class GuiEnchantColour extends GuiScreen { public static final ResourceLocation custom_ench_colour = new ResourceLocation("notenoughupdates:custom_ench_colour.png"); @@ -183,6 +187,56 @@ public class GuiEnchantColour extends GuiScreen { yIndex++; } renderSideBar(mouseX, mouseY, partialTicks); + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + List<String> tooltipToDisplay = null; + GlStateManager.color(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(help); + Utils.drawTexturedRect(guiLeft + xSize + 3, guiTopSidebar - 18, 16, 16, GL11.GL_NEAREST); + + if (mouseX >= guiLeft + xSize + 3 && mouseX < guiLeft + xSize + 19) { + if (mouseY >= guiTopSidebar - 18 && mouseY <= guiTopSidebar - 2) { + tooltipToDisplay = Lists.newArrayList( + EnumChatFormatting.AQUA+"NEUEC Colouring Guide", + EnumChatFormatting.GREEN+"", + EnumChatFormatting.GREEN+"How to use the GUI", + EnumChatFormatting.YELLOW+"Type the name of the enchant you want to colour in the left box", + EnumChatFormatting.YELLOW+"Change the comparison: ", + EnumChatFormatting.RED+"> "+EnumChatFormatting.YELLOW+"greater than a level ", + EnumChatFormatting.RED+"= "+EnumChatFormatting.YELLOW+"equals the level ", + EnumChatFormatting.RED+"< "+EnumChatFormatting.YELLOW+"less than a level", + EnumChatFormatting.YELLOW+"Put the level of enchant you want to color in the middle box", + EnumChatFormatting.YELLOW+"Put the color code you want to use here", + EnumChatFormatting.GREEN+"", + EnumChatFormatting.GREEN+"Available colour codes:", + Utils.chromaString("z = Chroma"), + EnumChatFormatting.DARK_BLUE+"1 = Dark Blue", + EnumChatFormatting.DARK_GREEN+"2 = Dark Green", + EnumChatFormatting.DARK_AQUA+"3 = Dark Aqua", + EnumChatFormatting.DARK_RED+"4 = Dark Red", + EnumChatFormatting.DARK_PURPLE+"5 = Dark Purple", + EnumChatFormatting.GOLD+"6 = Gold", + EnumChatFormatting.GRAY+"7 = Gray", + EnumChatFormatting.DARK_GRAY+"8 = Dark Gray", + EnumChatFormatting.BLUE+"9 = Blue", + EnumChatFormatting.GREEN+"a = Green", + EnumChatFormatting.AQUA+"b = Aqua", + EnumChatFormatting.RED+"c = Red", + EnumChatFormatting.LIGHT_PURPLE+"d = Purple", + EnumChatFormatting.YELLOW+"e = Yellow", + EnumChatFormatting.WHITE+"f = White", + "\u00A7ZZ = SBA Chroma"+EnumChatFormatting.RESET+EnumChatFormatting.GRAY+" (Requires SBA)", + "", + EnumChatFormatting.GREEN+"Available formatting:", + EnumChatFormatting.GRAY+""+EnumChatFormatting.BOLD+"B = "+EnumChatFormatting.BOLD+"Bold", + EnumChatFormatting.GRAY+""+EnumChatFormatting.STRIKETHROUGH+"S"+EnumChatFormatting.RESET+EnumChatFormatting.GRAY+" = "+EnumChatFormatting.STRIKETHROUGH+"Strikethrough", + EnumChatFormatting.GRAY+""+EnumChatFormatting.UNDERLINE+"U"+EnumChatFormatting.RESET+EnumChatFormatting.GRAY+" = "+EnumChatFormatting.UNDERLINE+"Underline", + EnumChatFormatting.GRAY+""+EnumChatFormatting.ITALIC+"I"+EnumChatFormatting.RESET+EnumChatFormatting.GRAY+" = "+EnumChatFormatting.ITALIC+"Italic" + ); + Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr); + tooltipToDisplay = null; + } + } + } private void renderSideBar(int mouseX, int mouseY, float partialTicks) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java index d0cb3f92..5678a832 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java @@ -185,7 +185,7 @@ public class GuiItemCustomize extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(GuiTextures.help); GlStateManager.color(1, 1, 1, 1); - int helpX = xCenter+textFieldRename.getWidth()/2-10; + int helpX = xCenter+textFieldRename.getWidth()/2-5; Utils.drawTexturedRect(helpX, yTop, 20, 20, GL11.GL_LINEAR); if(mouseX >= helpX && mouseX <= helpX+20 && mouseY >= yTop && mouseY <= yTop+20) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index abef4db6..da8ac561 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -29,6 +29,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ClientCommandHandler; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -1146,6 +1147,9 @@ public class StorageOverlay extends GuiElement { case 7: vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus ? 1 : 0; break; + case 8: + vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.showEnchantGlint ? 1 : 0; + break; } Utils.drawTexturedRect(buttonX, buttonY, 16, 16, minU, maxU, (vIndex * 16) / 256f, (vIndex * 16 + 16) / 256f, GL11.GL_NEAREST); @@ -1232,6 +1236,21 @@ public class StorageOverlay extends GuiElement { "Off" ); break; + case 8: + tooltipToDisplay = createTooltip( + "Show Enchant Glint", + NotEnoughUpdates.INSTANCE.config.storageGUI.showEnchantGlint ? 0 : 1, + "On", + "Off" + ); + break; + case 9: + tooltipToDisplay = createTooltip( + "Open Full Settings", + 0, + "Click To Open" + ); + break; } } } @@ -1741,6 +1760,13 @@ public class StorageOverlay extends GuiElement { NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus = !NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus; break; + case 8: + NotEnoughUpdates.INSTANCE.config.storageGUI.showEnchantGlint = + !NotEnoughUpdates.INSTANCE.config.storageGUI.showEnchantGlint; + break; + case 9: + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neu storage gui"); + break; } dirty = true; } @@ -1963,7 +1989,9 @@ public class StorageOverlay extends GuiElement { private void renderEnchOverlay(Set<Vector2f> locations) { float f = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F; float f1 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F; - Minecraft.getMinecraft().getTextureManager().bindTexture(RES_ITEM_GLINT); + if (NotEnoughUpdates.INSTANCE.config.storageGUI.showEnchantGlint) { + Minecraft.getMinecraft().getTextureManager().bindTexture(RES_ITEM_GLINT); + } GL11.glPushMatrix(); for (Vector2f loc : locations) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java index 1d7d6876..1a420218 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -83,6 +83,24 @@ public class NEUConfig extends Config { return; case 10: editOverlay(activeConfigCategory, OverlayManager.crystalHollowOverlay, mining.crystalHollowOverlayPosition); + return; + case 11: + editOverlay(activeConfigCategory, OverlayManager.miningSkillOverlay, skillOverlays.miningPosition); + return; + case 12: + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/dn"); + return; + case 13: + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/pv"); + return; + case 14: + editOverlay(activeConfigCategory, OverlayManager.fishingSkillOverlay, skillOverlays.fishingPosition); + return; + case 16: + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neusouls clear"); + return; + case 17: + ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neusouls unclear"); } } @@ -95,6 +113,13 @@ public class NEUConfig extends Config { @Expose @Category( + name = "GUI Locations", + desc = "Edit the GUI locations of everything here" + ) + public LocationEdit locationedit = new LocationEdit(); + + @Expose + @Category( name = "Notifications", desc = "Notifications" ) @@ -240,6 +265,7 @@ public class NEUConfig extends Config { ) public AccessoryBag accessoryBag = new AccessoryBag(); + @Expose @Category( name = "Api Key", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java index 9ba71505..ca1ae0d8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java @@ -10,6 +10,17 @@ public class Dungeons { )
@ConfigEditorAccordion(id = 0)
public boolean dungeonMapAccordion = false;
+ @Expose
+ @ConfigOption(
+ name = "\u00A7cWarning",
+ desc = "If you are on Entrance, Floor 1 or Master 1 the map wont work properly"
+ )
+ @ConfigEditorFSR(
+ runnableId = 12,
+ buttonText = ""
+ )
+ @ConfigAccordionId(id = 0)
+ public boolean dungeonF1Warning = false;
@Expose
@ConfigOption(
@@ -98,8 +109,20 @@ public class Dungeons { name = "Dungeon Block Overlay",
desc = ""
)
+
@ConfigEditorAccordion(id = 2)
public boolean dungeonBlocksAccordion = false;
+ @ConfigOption(
+ name = "\u00A7cWarning",
+ desc = "You need Fast Render and Antialiasing off for these settings to work\n" +
+ "You can find these in your video settings"
+ )
+ @ConfigEditorFSR(
+ runnableId = 12,
+ buttonText = ""
+ )
+ @ConfigAccordionId(id = 2)
+ public boolean dungeonBlockWarning = false;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java index 6b4124ea..1a663467 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java @@ -198,6 +198,15 @@ public class ItemOverlays { @Expose
@ConfigOption(
+ name = "Enable etherwarp block overlay",
+ desc = "Display an overlay that tells you what block you will TP to."
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 7)
+ public boolean enableEtherwarpBlockOverlay = true;
+
+ @Expose
+ @ConfigOption(
name = "Highlight Colour",
desc = "Change the colour of the etherwarp target block outline"
)
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java new file mode 100644 index 00000000..edd0ad46 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java @@ -0,0 +1,138 @@ +package io.github.moulberry.notenoughupdates.options.seperateSections; + +import com.google.gson.annotations.Expose; +import io.github.moulberry.notenoughupdates.core.config.Position; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigAccordionId; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorButton; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; + +public class LocationEdit { + @Expose + @ConfigOption( + name = "Edit Dungeon Map", + desc = "The NEU dungeon map has it's own editor (/neumap).\n" + + "Click the button on the left to open it" + ) + @ConfigEditorButton( + runnableId = 0, + buttonText = "Edit" + ) + public int editDungeonMap = 0; + + @Expose + @ConfigOption( + name = "Overlay Position", + desc = "Change the position of the Dwarven Mines information Overlay (commisions, powder & forge statuses)" + ) + @ConfigEditorButton( + runnableId = 1, + buttonText = "Edit" + ) + public Position overlayPosition = new Position(10, 100); + + @Expose + @ConfigOption( + name = "Fuel Bar Position", + desc = "Set the position of the drill fuel bar" + ) + @ConfigEditorButton( + runnableId = 2, + buttonText = "Edit" + ) + public Position drillFuelBarPosition = new Position(0, -100, true, false); + + @Expose + @ConfigOption( + name = "Farming Position", + desc = "Change the position of the Farming overlay" + ) + @ConfigEditorButton( + runnableId = 3, + buttonText = "Edit" + ) + public Position farmingPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Pet Info Position", + desc = "The position of the pet info." + ) + @ConfigEditorButton( + runnableId = 4, + buttonText = "Edit" + ) + public Position petInfoPosition = new Position(-1, -1); + + @Expose + @ConfigOption( + name = "Todo Position", + desc = "Change the position of the Todo overlay" + ) + @ConfigEditorButton( + runnableId = 5, + buttonText = "Edit" + ) + @ConfigAccordionId(id = 0) + public Position todoPosition = new Position(100, 0); + + @Expose + @ConfigOption( + name = "Edit Toolbar Positions", + desc = "Edit the position of the QuickCommands / Search Bar" + ) + @ConfigEditorButton(runnableId = 6, buttonText = "Edit") + public boolean positionButton = true; + + @Expose + @ConfigOption( + name = "Open Button Editor", + desc = "Open button editor GUI (/neubuttons)" + ) + @ConfigEditorButton(runnableId = 7, buttonText = "Open") + public boolean openEditorButton = true; + + @Expose + @ConfigOption( + name = "Bonemerang Overlay Position", + desc = "The position of the Bonemerang overlay." + ) + @ConfigEditorButton( + runnableId = 9, + buttonText = "Edit" + ) + public Position bonemerangPosition = new Position(-1, -1); + + @Expose + @ConfigOption( + name = "Overlay Position", + desc = "Change the position of the Crystal Hollows Overlay." + ) + @ConfigEditorButton( + runnableId = 10, + buttonText = "Edit" + ) + public Position crystalHollowOverlayPosition = new Position(200, 0); + + @Expose + @ConfigOption( + name = "Mining Position", + desc = "Change the position of the Mining overlay" + ) + @ConfigEditorButton( + runnableId = 11, + buttonText = "Edit" + ) + public Position miningPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Fishing Position", + desc = "Change the position of the Fishing overlay" + ) + @ConfigEditorButton( + runnableId = 14, + buttonText = "Edit" + ) + public Position fishingPosition = new Position(10, 200); + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java index 2c05d553..10cfb9dd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java @@ -31,6 +31,16 @@ public class Mining { @Expose
@ConfigOption(
+ name = "Hide waypoints when at Location",
+ desc = "Hides the Commission Waypoints if you are already at the location of the waypoint.\n" +
+ "Only active if Waypoints are set to \"Commissions Only\""
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean hideWaypointIfAtLocation = true;
+
+ @Expose
+ @ConfigOption(
name = "Emissary Waypoints",
desc = "Show waypoints in the Dwarven mines to emissaries\n" +
"Use \"Commission End\" to only show after finishing commissions"
@@ -489,20 +499,4 @@ public class Mining { )
@ConfigEditorBoolean
public boolean dwarvenTextures = false;
-
- /*@Expose
- @ConfigOption(
- name = "Don't Mine Stone",
- desc = "Prevent mining stone blocks in mining areas"
- )
- @ConfigEditorBoolean
- public boolean dontMineStone = true;
-
- @Expose
- @ConfigOption(
- name = "Reveal Mist Creepers",
- desc = "Make the creepers in the Dwarven Mines mist visible"
- )
- @ConfigEditorBoolean
- public boolean revealMistCreepers = true;*/
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index fddf84e3..295ec5d8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -28,6 +28,45 @@ public class Misc { @ConfigEditorBoolean
public boolean streamerMode = false;
+ @ConfigOption(
+ name = "Fairy Soul Waypoints",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 0)
+ public boolean fariySoulAccordion = false;
+ @Expose
+ @ConfigOption(
+ name = "Fairy Souls Finder",
+ desc = "Shows waypoints to fairy souls (/neusouls)"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean fariySoul = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Clear Fairy Souls",
+ desc = "Clears waypoints to fairy souls (/neusouls clear)"
+ )
+ @ConfigEditorButton(
+ runnableId = 16,
+ buttonText = "Clear"
+ )
+ @ConfigAccordionId(id = 0)
+ public boolean fariySoulClear = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Unclear Fairy Souls",
+ desc = "Shows all waypoints to fairy souls (/neusouls unclear)"
+ )
+ @ConfigEditorButton(
+ runnableId = 17,
+ buttonText = "Unclear"
+ )
+ @ConfigAccordionId(id = 0)
+ public boolean fariySoulUnclear = false;
+
@Expose
@ConfigOption(
name = "GUI Click Sounds",
@@ -39,15 +78,18 @@ public class Misc { @Expose
@ConfigOption(
name = "Replace Chat Social Options",
- desc = "Replace Hypixel's chat social options with NEU's profile viewer."
+ desc = "Replace Hypixel's chat social options with NEU's profile viewer or with /ah"
)
- @ConfigEditorBoolean
- public boolean replaceSocialOptions = true;
+ @ConfigEditorDropdown(
+ values = {"Off", "/pv", "/ah"}
+ )
+ public int replaceSocialOptions1 = 1;
@Expose
@ConfigOption(
name = "Damage Indicator Style",
- desc = "Change the style of Skyblock damage indicators to be easier to read"
+ desc = "Change the style of Skyblock damage indicators to be easier to read\n" +
+ "\u00A7cSome old animations mods break this feature"
)
@ConfigEditorDropdown(
values = {"Off", "Commas", "Shortened"}
@@ -56,8 +98,17 @@ public class Misc { @Expose
@ConfigOption(
+ name = "Profile Viewer",
+ desc = "Brings up the profile viewer (/pv)\n" +
+ "Shows stats and networth of players"
+ )
+ @ConfigEditorButton(runnableId = 13, buttonText = "Open")
+ public boolean openPV = true;
+
+ @Expose
+ @ConfigOption(
name = "Edit Enchant Colours",
- desc = "Change the colours of certain skyblock enchants"
+ desc = "Change the colours of certain skyblock enchants (/neuec)"
)
@ConfigEditorButton(runnableId = 8, buttonText = "Open")
public boolean editEnchantColoursButton = true;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java index ba83fc0c..0ba273ef 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java @@ -3,25 +3,52 @@ package io.github.moulberry.notenoughupdates.options.seperateSections; import com.google.gson.annotations.Expose;
import io.github.moulberry.notenoughupdates.core.config.Position;
import io.github.moulberry.notenoughupdates.core.config.annotations.*;
+import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SkillOverlays {
+ @ConfigOption(
+ name = "Skill Overlay Info",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 2)
+ public boolean infoAccordion = false;
+ @Expose
+ @ConfigOption(
+ name = "Skill display info",
+ desc = "The skill trackers need you to have an \u00A72api key\u00A77 set (if you dont have one set do \u00A72/api new\u00A77)\n" +
+ "For the overlays to show you need a \u00A7bmathematical hoe\u00A77 or an axe with \u00A7bcultivating\u00A77 " +
+ "enchant for farming, a pickaxe with \u00A7bcompact\u00A77 for mining or a rod with \u00A7bexpertise\u00A77"
+ )
+ @ConfigEditorFSR(
+ runnableId = 12,
+ buttonText = ""
+ )
+ @ConfigAccordionId(id = 2)
+ public boolean skillInfo = false;
+ @ConfigOption(
+ name = "Farming",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 0)
+ public boolean farmingAccordion = false;
@Expose
@ConfigOption(
name = "Enable Farming Overlay",
desc = "Show an overlay while farming with useful information"
)
@ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
public boolean farmingOverlay = true;
@Expose
@ConfigOption(
name = "Farming Text",
desc = "\u00a7eDrag text to change the appearance of the overlay\n" +
- "\u00a7rHold a mathematical hoe or use an axe while gaining farming xp to show the overlay"
+ "\u00a7rHold a mathematical hoe or use an axe with cultivating enchantment while gaining farming xp to show the overlay"
)
@ConfigEditorDraggableList(
exampleText = {"\u00a7bCounter: \u00a7e37,547,860",
@@ -31,9 +58,13 @@ public class SkillOverlays { "\u00a7bRemaining XP: \u00a7e3,265",
"\u00a7bXP/h: \u00a7e238,129",
"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52",
- "\u00a7bETA: 13h12m"}
+ "\u00a7bETA: \u00a7e13h12m",
+ "\u00a7bPitch: \u00a7e69.42\u00a7l\u1D52",
+ "\u00a7bCultivating: \u00a7e10,137,945/20,000,000",
+ "\u00a7bCoins/m \u00a7e57,432"}
)
- public List<Integer> farmingText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 7, 6));
+ @ConfigAccordionId(id = 0)
+ public List<Integer> farmingText = new ArrayList<>(Arrays.asList(0, 9, 10, 1, 2, 3, 4, 5, 7, 6));
@Expose
@ConfigOption(
@@ -44,6 +75,7 @@ public class SkillOverlays { runnableId = 3,
buttonText = "Edit"
)
+ @ConfigAccordionId(id = 0)
public Position farmingPosition = new Position(10, 200);
@Expose
@@ -54,5 +86,145 @@ public class SkillOverlays { @ConfigEditorDropdown(
values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
)
+ @ConfigAccordionId(id = 0)
public int farmingStyle = 0;
+ @ConfigOption(
+ name = "Mining",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 1)
+ public boolean miningAccordion = false;
+ @Expose
+ @ConfigOption(
+ name = "Enable Mining Overlay",
+ desc = "Show an overlay while Mining with useful information"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 1)
+ public boolean miningSkillOverlay = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Mining Text",
+ desc = "\u00a7eDrag text to change the appearance of the overlay\n" +
+ "\u00a7rHold a pickaxe with compact while gaining mining xp to show the overlay"
+ )
+ @ConfigEditorDraggableList(
+ exampleText = {"\u00a7bCompact: \u00a7e547,860",
+ "\u00a7bBlocks/m: \u00a7e38.29",
+ "\u00a7bMine: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
+ "\u00a7bCurrent XP: \u00a7e6,734",
+ "\u00a7bRemaining XP: \u00a7e3,265",
+ "\u00a7bXP/h: \u00a7e238,129",
+ "\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52",
+ "\u00a7bETA: \u00a7e13h12m",
+ "\u00a7bCompact Progress: \u00a7e137,945/150,000"}
+ )
+ @ConfigAccordionId(id = 1)
+ public List<Integer> miningText = new ArrayList<>(Arrays.asList(0, 8, 1, 2, 3, 4, 5, 7));
+
+ @Expose
+ @ConfigOption(
+ name = "Mining Position",
+ desc = "Change the position of the Mining overlay"
+ )
+ @ConfigEditorButton(
+ runnableId = 11,
+ buttonText = "Edit"
+ )
+ @ConfigAccordionId(id = 1)
+ public Position miningPosition = new Position(10, 200);
+
+ @Expose
+ @ConfigOption(
+ name = "Mining Style",
+ desc = "Change the style of the Mining overlay"
+ )
+ @ConfigEditorDropdown(
+ values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
+ )
+ @ConfigAccordionId(id = 1)
+ public int miningStyle = 0;
+
+ @ConfigOption(
+ name = "Fishing",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 3)
+ public boolean fishingAccordion = false;
+ @Expose
+ @ConfigOption(
+ name = "Enable Fishing Overlay",
+ desc = "Show an overlay while Fishing with useful information"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 3)
+ public boolean FishingSkillOverlay = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Fishing Text",
+ desc = "\u00a7eDrag text to change the appearance of the overlay\n" +
+ "\u00a7rHold a fishing rod with expertise enchantment while gaining fishing xp to show the overlay"
+ )
+ @ConfigEditorDraggableList(
+ exampleText = {"\u00a7bExpertise: \u00a7e7,945/10,000",
+ //"\u00a7bCatches/m: \u00a7e38.29",
+ "\u00a7bFishing: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
+ "\u00a7bCurrent XP: \u00a7e6,734",
+ "\u00a7bRemaining XP: \u00a7e3,265",
+ "\u00a7bXP/h: \u00a7e238,129",
+ //"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52",
+ "\u00a7bETA: \u00a7e13h12m",
+ //"\u00a7bExpertise Progress: \u00a7e7,945/10,000",
+ "\u00a7bTimer: \u00a7e1m15s"}
+ )
+ @ConfigAccordionId(id = 3)
+ public List<Integer> fishingText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6));
+
+ @Expose
+ @ConfigOption(
+ name = "Fishing Position",
+ desc = "Change the position of the Fishing overlay"
+ )
+ @ConfigEditorButton(
+ runnableId = 14,
+ buttonText = "Edit"
+ )
+ @ConfigAccordionId(id = 3)
+ public Position fishingPosition = new Position(10, 200);
+
+ @Expose
+ @ConfigOption(
+ name = "Fishing Style",
+ desc = "Change the style of the Fishing overlay"
+ )
+ @ConfigEditorDropdown(
+ values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
+ )
+ @ConfigAccordionId(id = 3)
+ public int fishingStyle = 0;
+
+ @Expose
+ @ConfigOption(
+ name = "Toggle Fishing timer",
+ desc = "Start or stop the timer on the fishing overlay\n" +
+ "Also can plays a ding customizable below"
+ )
+ @ConfigEditorKeybind(defaultKey = Keyboard.KEY_END)
+ @ConfigAccordionId(id = 3)
+ public int fishKey = Keyboard.KEY_END;
+
+ @Expose
+ @ConfigOption(
+ name = "Fishing Timer Alert",
+ desc = "Change the amount of time (seconds) until the timer dings"
+ )
+ @ConfigEditorSlider(
+ minValue = 0,
+ maxValue = 600,
+ minStep = 20
+ )
+ @ConfigAccordionId(id = 3)
+ public int customFishTimer = 300;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java index a5b5c2fa..5ec4f9ae 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java @@ -14,7 +14,17 @@ public class StorageGUI { @Expose
public int selectedIndex = 0;
-
+ @ConfigOption(
+ name = "\u00A7cWarning",
+ desc = "You need Fast Render and Antialiasing off for these settings to work\n" +
+ "You can find these in your video settings"
+ )
+ @ConfigEditorFSR(
+ runnableId = 12,
+ buttonText = ""
+ )
+ @ConfigAccordionId(id = 1)
+ public boolean storageGUIWarning = false;
@Expose
@ConfigOption(
name = "Enable Storage GUI",
@@ -98,6 +108,15 @@ public class StorageGUI { @Expose
@ConfigOption(
+ name = "Show Enchant Glint",
+ desc = "Toggle enchant glint in storage GUI"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 1)
+ public boolean showEnchantGlint = true;
+
+ @Expose
+ @ConfigOption(
name = "Selected Storage Colour",
desc = "Change the colour used to draw the selected backpack border"
)
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java index d8ddcbc9..fb1025f4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java @@ -202,7 +202,34 @@ public class AuctionSearchOverlay { } + private static final ExecutorService searchES = Executors.newSingleThreadExecutor(); + private static final AtomicInteger searchId = new AtomicInteger(0); + + private static String getItemIdAtIndex(int i) { + if (!autocompletedItems.isEmpty()) { + if ((i > autocompletedItems.size() - 1) || i < 0 || i > 4) { + return ""; + } + String searchString = autocompletedItems.toArray()[i].toString(); + JsonObject repoObject = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(searchString); + String displayname = repoObject.get("displayname").getAsString(); + if (displayname.contains("Enchanted Book")) { + String lore = repoObject.get("lore").getAsJsonArray().get(0).getAsString(); + String name = lore.substring(0, lore.lastIndexOf(" ")); + return Utils.cleanColour(name); + } else { + return Utils.cleanColour(displayname); + } + } else { + return null; + } + } + public static void close() { + if (tabCompleted) { + tabCompletionIndex = -1; + tabCompleted = false; + } if (NotEnoughUpdates.INSTANCE.config.ahTweaks.keepPreviousSearch) { search(); } else { @@ -277,27 +304,44 @@ public class AuctionSearchOverlay { } } - private static final ExecutorService searchES = Executors.newSingleThreadExecutor(); - private static final AtomicInteger searchId = new AtomicInteger(0); - - private static String getItemIdAtIndex(int i) { - if (!autocompletedItems.isEmpty()) { - if ((i > autocompletedItems.size() - 1) || i < 0 || i > 4) { - return ""; + private static boolean updateTabCompletedSearch(int key) { + String id; + if (key == Keyboard.KEY_DOWN || key == Keyboard.KEY_TAB) { + id = getItemIdAtIndex(tabCompletionIndex + 1); + if (id == null) { + textField.setFocus(true); + textField.setText(searchString); + tabCompleted = false; + tabCompletionIndex = -1; + return true; + } else if (id.equals("")) { + tabCompletionIndex = 0; + return true; + } else { + searchString = id; + tabCompletionIndex += 1; + return true; } - String searchString = autocompletedItems.toArray()[i].toString(); - JsonObject repoObject = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(searchString); - String displayname = repoObject.get("displayname").getAsString(); - if (displayname.contains("Enchanted Book")) { - String lore = repoObject.get("lore").getAsJsonArray().get(0).getAsString(); - String name = lore.substring(0, lore.lastIndexOf(" ")); - return Utils.cleanColour(name); + } else if (key == Keyboard.KEY_UP) { + id = getItemIdAtIndex(tabCompletionIndex - 1); + if (id == null) { + textField.setFocus(true); + textField.setText(searchString); + tabCompleted = false; + tabCompletionIndex = -1; + return true; + } else if (id.equals("")) { + if (autocompletedItems.size() > 4) tabCompletionIndex = 4; + else tabCompletionIndex = autocompletedItems.size() - 1; + tabCompletionIndex = autocompletedItems.size() - 1; + return true; } else { - return Utils.cleanColour(displayname); + searchString = id; + tabCompletionIndex -= 1; + return true; } - } else { - return null; } + return false; } public static void search() { @@ -352,67 +396,47 @@ public class AuctionSearchOverlay { } public static void keyEvent() { + boolean ignoreKey = false; + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { searchStringExtra = ""; close(); if (NotEnoughUpdates.INSTANCE.config.ahTweaks.escFullClose) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(Minecraft.getMinecraft().thePlayer.openContainer.windowId)); } + return; } else if (Keyboard.getEventKey() == Keyboard.KEY_RETURN) { searchStringExtra = ""; close(); + return; } else if (Keyboard.getEventKey() == Keyboard.KEY_TAB) { //autocomplete to first item in the list - tabCompleted = true; - String id = getItemIdAtIndex(0); - if (id == null) { - tabCompleted = false; - textField.setFocus(true); - textField.setText(searchString); - } else { - tabCompletionIndex = 0; - searchString = id; + if (!tabCompleted) { + tabCompleted = true; + ignoreKey = true; + String id = getItemIdAtIndex(0); + if (id == null) { + tabCompleted = false; + textField.setFocus(true); + textField.setText(searchString); + } else { + tabCompletionIndex = 0; + searchString = id; + } } - } else if (Keyboard.getEventKeyState()) { + } + + if (Keyboard.getEventKeyState()) { if (tabCompleted) { - String id; - switch (Keyboard.getEventKey()) { - case Keyboard.KEY_DOWN: - id = getItemIdAtIndex(tabCompletionIndex + 1); - if (id == null) { - textField.setFocus(true); - textField.setText(searchString); - tabCompleted = false; - tabCompletionIndex = -1; - } else if (id.equals("")) { - //At the end of the autocompletion List, do nothing - return; - } else { - searchString = id; - tabCompletionIndex += 1; - return; - } - break; - case Keyboard.KEY_UP: - id = getItemIdAtIndex(tabCompletionIndex - 1); - if (id == null) { - textField.setFocus(true); - textField.setText(searchString); - tabCompleted = false; - tabCompletionIndex = -1; - } else if (id.equals("")) { - //At the end of the autocompletion List, do nothing - return; - } else { - searchString = id; - tabCompletionIndex -= 1; - return; - } - break; - default: - tabCompletionIndex = -1; - tabCompleted = false; - } + if (!ignoreKey) { + boolean success = updateTabCompletedSearch(Keyboard.getEventKey()); + if (success) return; + textField.setFocus(true); + textField.setText(searchString); + tabCompleted = false; + tabCompletionIndex = -1; + } else return; + } textField.setFocus(true); textField.setText(searchString); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java index f3dfa242..e59702ee 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java @@ -13,10 +13,7 @@ import net.minecraft.util.EnumChatFormatting; import org.lwjgl.util.vector.Vector2f; import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -333,54 +330,12 @@ public class CrystalHollowOverlay extends TextOverlay { ItemStack icon = null; String cleaned = Utils.cleanColour(line); String beforeColon = cleaned.split(":")[0]; - switch (beforeColon) { - case "Scavenged Lapis Sword": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_LAPIS_SWORD")); - break; - case "Scavenged Golden Hammer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_GOLD_HAMMER")); - break; - case "Scavenged Diamond Axe": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_DIAMOND_AXE")); - break; - case "Scavenged Emerald Hammer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_EMERALD_HAMMER")); - break; - case "Electron Transmitter": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ELECTRON_TRANSMITTER")); - break; - case "FTX 3070": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("FTX_3070")); - break; - case "Robotron Reflector": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ROBOTRON_REFLECTOR")); - break; - case "Superlite Motor": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SUPERLITE_MOTOR")); - break; - case "Control Switch": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("CONTROL_SWITCH")); - break; - case "Synthetic Heart": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SYNTHETIC_HEART")); - break; - case "Amber": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_AMBER_GEM")); - break; - case "Sapphire": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_SAPPHIRE_GEM")); - break; - case "Jade": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_JADE_GEM")); - break; - case "Amethyst": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_AMETHYST_GEM")); - break; - case "Topaz": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_TOPAZ_GEM")); - break; + if(crystallHollowsIcons == null){ + setupCrystallHollowsIcons(); + } + if (crystallHollowsIcons.containsKey(beforeColon)) { + icon = crystallHollowsIcons.get(beforeColon); } - if (icon != null) { GlStateManager.pushMatrix(); GlStateManager.translate(position.x, position.y, 0); @@ -394,6 +349,26 @@ public class CrystalHollowOverlay extends TextOverlay { super.renderLine(line, position, dummy); } + private static Map<String, ItemStack> crystallHollowsIcons; + private static void setupCrystallHollowsIcons() { + crystallHollowsIcons = new HashMap<String, ItemStack>(){}; + crystallHollowsIcons.put("Scavenged Lapis Sword", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_LAPIS_SWORD"))); + crystallHollowsIcons.put("Scavenged Golden Hammer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_GOLD_HAMMER"))); + crystallHollowsIcons.put("Scavenged Diamond Axe", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_DIAMOND_AXE"))); + crystallHollowsIcons.put("Scavenged Emerald Hammer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DWARVEN_EMERALD_HAMMER"))); + crystallHollowsIcons.put("Electron Transmitter", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ELECTRON_TRANSMITTER"))); + crystallHollowsIcons.put("FTX 3070", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("FTX_3070"))); + crystallHollowsIcons.put("Robotron Reflector", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ROBOTRON_REFLECTOR"))); + crystallHollowsIcons.put("Superlite Motor", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SUPERLITE_MOTOR"))); + crystallHollowsIcons.put("Control Switch", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("CONTROL_SWITCH"))); + crystallHollowsIcons.put("Synthetic Heart", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SYNTHETIC_HEART"))); + crystallHollowsIcons.put("Amber", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_AMBER_GEM"))); + crystallHollowsIcons.put("Sapphire", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_SAPPHIRE_GEM"))); + crystallHollowsIcons.put("Jade", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_JADE_GEM"))); + crystallHollowsIcons.put("Amethyst", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_AMETHYST_GEM"))); + crystallHollowsIcons.put("Topaz", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_TOPAZ_GEM"))); + } + @Override protected Vector2f getSize(List<String> strings) { if (NotEnoughUpdates.INSTANCE.config.mining.crystalHollowIcons) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java index e8ad503e..bfb39465 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java @@ -22,6 +22,13 @@ public class FarmingOverlay extends TextOverlay { private long lastUpdate = -1; private int counterLast = -1; private int counter = -1; + private int cultivatingLast = -1; + private int cultivating = -1; + private int cultivatingTier = -1; + private String cultivatingTierAmount = "1"; + private int Farming = -1; + private int Alch = -1; + private double Coins = -1; private float cropsPerSecondLast = 0; private float cropsPerSecond = 0; private final LinkedList<Integer> counterQueue = new LinkedList<>(); @@ -63,6 +70,7 @@ public class FarmingOverlay extends TextOverlay { lastUpdate = System.currentTimeMillis(); counterLast = counter; + cultivatingLast = cultivating; xpGainHourLast = xpGainHour; counter = -1; @@ -75,20 +83,99 @@ public class FarmingOverlay extends TextOverlay { if (tag.hasKey("ExtraAttributes", 10)) { NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); - if (ea.hasKey("mined_crops", 99)) { + if(ea.hasKey("mined_crops", 99)) { + //TODO make cult show separate gui option counter = ea.getInteger("mined_crops"); + cultivating = ea.getInteger("farmed_cultivating"); counterQueue.add(0, counter); } else if (ea.hasKey("farmed_cultivating", 99)) { counter = ea.getInteger("farmed_cultivating"); + cultivating = ea.getInteger("farmed_cultivating"); counterQueue.add(0, counter); } } } + + if (cultivating < 1000){ + cultivatingTier = 1; + } else if (cultivating < 5000){ + cultivatingTier = 2; + } else if (cultivating < 25000){ + cultivatingTier = 3; + } else if (cultivating < 100000){ + cultivatingTier = 4; + } else if (cultivating < 300000){ + cultivatingTier = 5; + } else if (cultivating < 1500000){ + cultivatingTier = 6; + } else if (cultivating < 5000000){ + cultivatingTier = 7; + } else if (cultivating < 20000000){ + cultivatingTier = 8; + } else if (cultivating < 100000000){ + cultivatingTier = 9; + } else if (cultivating > 100000000){ + cultivatingTier = 10; + } + + switch (cultivatingTier) { + case 1: + cultivatingTierAmount = "1,000"; + break; + case 2: + cultivatingTierAmount = "5,000"; + break; + case 3: + cultivatingTierAmount = "25,000"; + break; + case 4: + cultivatingTierAmount = "100,000"; + break; + case 5: + cultivatingTierAmount = "300,000"; + break; + case 6: + cultivatingTierAmount = "1,500,000"; + break; + case 7: + cultivatingTierAmount = "5,000,000"; + break; + case 8: + cultivatingTierAmount = "20,000,000"; + break; + case 9: + cultivatingTierAmount = "100,000,000"; + break; + case 10: + cultivatingTierAmount = "Maxed"; + break; + } + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { skillType = "Alchemy"; + Farming = 0; + Alch = 1; } else { skillType = "Farming"; + Farming = 1; + Alch = 0; + } + + if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS") || (internalname != null && internalname.equals("COCO_CHOPPER"))) { + Coins = 3; + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO") || (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) + || (internalname != null && internalname.equals("CACTUS_KNIFE")) || (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT"))) { + Coins = 1; + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE") || (internalname != null && internalname.equals("TREECAPITATOR_AXE"))) { + Coins = 2; + } else if ((internalname != null && internalname.equals("PUMPKIN_DICER")) || (internalname != null && internalname.equals("FUNGI_CUTTER"))) { + Coins = 4; + } else if ((internalname != null && internalname.equals("MELON_DICER"))) { + Coins = 0.5; + } + else { + Coins = 0; } skillInfoLast = skillInfo; @@ -171,7 +258,7 @@ public class FarmingOverlay extends TextOverlay { NumberFormat format = NumberFormat.getIntegerInstance(); - if (counter >= 0) { + if (counter >= 0 && cultivating != counter) { int counterInterp = (int) interp(counter, counterLast); lineMap.put(0, EnumChatFormatting.AQUA + "Counter: " + EnumChatFormatting.YELLOW + format.format(counterInterp)); @@ -184,10 +271,30 @@ public class FarmingOverlay extends TextOverlay { float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); lineMap.put(1, EnumChatFormatting.AQUA + "Crops/m: " + EnumChatFormatting.YELLOW + - String.format("%.2f", cpsInterp * 60)); + String.format("%,.2f", cpsInterp * 60)); + } + } + + if (counter >= 0 && Coins > 0) { + if (cropsPerSecondLast == cropsPerSecond && cropsPerSecond <= 0) { + lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); + + lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + + String.format("%,.2f", (cpsInterp * 60) * Coins)); } } + if (cultivatingTier <= 9 && cultivating > 0) { + int counterInterp = (int) interp(cultivating, cultivatingLast); + lineMap.put(9, EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + cultivatingTierAmount); + } + if (cultivatingTier == 10) { + int counterInterp = (int) interp(cultivating, cultivatingLast); + lineMap.put(9, EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp)); + } + float xpInterp = xpGainHour; if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + "N/A"); @@ -198,7 +305,7 @@ public class FarmingOverlay extends TextOverlay { format.format(xpInterp) + (isFarming ? "" : EnumChatFormatting.RED + " (PAUSED)")); } - if (skillInfo != null) { + if (skillInfo != null && skillInfo.level < 60) { StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + skillType.substring(0, 4) + ": "); levelStr.append(EnumChatFormatting.YELLOW) @@ -239,28 +346,50 @@ public class FarmingOverlay extends TextOverlay { lineMap.put(2, levelStr.toString()); lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); - if (remaining < 0) { - lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); - lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); - } else { - lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining)); - if (xpGainHour < 1000) { - lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); + if (remaining < 0) { + lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); } else { - lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp)); + lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining)); + if (xpGainHour < 1000) { + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp)); + } } + + } + + if (skillInfo != null && skillInfo.level == 60 || Alch == 1 && skillInfo != null && skillInfo.level == 50) { + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); } + if (Alch == 0) { + lineMap.put(2, EnumChatFormatting.AQUA + "Farm: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + "(Maxed)"); + } else { + lineMap.put(2, EnumChatFormatting.AQUA + "Alch: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + "(Maxed)"); + } + lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + } float yaw = Minecraft.getMinecraft().thePlayer.rotationYawHead; + float pitch = Minecraft.getMinecraft().thePlayer.rotationPitch; yaw %= 360; if (yaw < 0) yaw += 360; if (yaw > 180) yaw -= 360; + pitch %= 360; + if (pitch < 0) pitch += 360; + if (pitch > 180) pitch -= 360; lineMap.put(6, EnumChatFormatting.AQUA + "Yaw: " + EnumChatFormatting.YELLOW + String.format("%.2f", yaw) + EnumChatFormatting.BOLD + "\u1D52"); + lineMap.put(8, EnumChatFormatting.AQUA + "Pitch: " + EnumChatFormatting.YELLOW + + String.format("%.2f", pitch) + EnumChatFormatting.BOLD + "\u1D52"); + for (int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingText) { if (lineMap.get(strIndex) != null) { overlayStrings.add(lineMap.get(strIndex)); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java new file mode 100644 index 00000000..0438dd1a --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java @@ -0,0 +1,377 @@ +package io.github.moulberry.notenoughupdates.overlays; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; +import io.github.moulberry.notenoughupdates.core.config.Position; +import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; +import io.github.moulberry.notenoughupdates.util.Utils; +import io.github.moulberry.notenoughupdates.util.XPInformation; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSound; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Supplier; + +public class FishingSkillOverlay extends TextOverlay { //Im sure there is a much better way to do this besides making another class ¯\_(ツ)_/¯ + + private long lastUpdate = -1; + private long timer = -1; + private int expertiseLast = -1; + private int expertise = -1; + private int expertiseTier = -1; + private String expertiseTierAmount = "1"; + private float fishedPerSecondLast = 0; + private float fishedPerSecond = 0; + private LinkedList<Integer> expertiseQueue = new LinkedList<>(); + + private XPInformation.SkillInfo skillInfo = null; + private XPInformation.SkillInfo skillInfoLast = null; + + private float lastTotalXp = -1; + private boolean isFishing = false; + private LinkedList<Float> xpGainQueue = new LinkedList<>(); + private float xpGainHourLast = -1; + private float xpGainHour = -1; + + private int xpGainTimer = 0; + + private String skillType = "Fishing"; + + public FishingSkillOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) { + super(position, dummyStrings, styleSupplier); + } + + private float interp(float now, float last) { + float interp = now; + if(last >= 0 && last != now) { + float factor = (System.currentTimeMillis()-lastUpdate)/1000f; + factor = LerpUtils.clampZeroOne(factor); + interp = last + (now - last) * factor; + } + return interp; + } + + @Override + public void update() { + if(!NotEnoughUpdates.INSTANCE.config.skillOverlays.FishingSkillOverlay) { + expertise = -1; + overlayStrings = null; + return; + } + + lastUpdate = System.currentTimeMillis(); + expertiseLast = expertise; + xpGainHourLast = xpGainHour; + expertise = -1; + + if(Minecraft.getMinecraft().thePlayer == null) return; + + ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem(); + if(stack != null && stack.hasTagCompound()) { + NBTTagCompound tag = stack.getTagCompound(); + + if(tag.hasKey("ExtraAttributes", 10)) { + NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); + + if(ea.hasKey("expertise_kills", 99)) { + expertise = ea.getInteger("expertise_kills"); + expertiseQueue.add(0, expertise); + } + } + } + + if (expertise < 50){ + expertiseTier = 1; + } else if (expertise < 100){ + expertiseTier = 2; + } else if (expertise < 250){ + expertiseTier = 3; + } else if (expertise < 500){ + expertiseTier = 4; + } else if (expertise < 1000){ + expertiseTier = 5; + } else if (expertise < 2500){ + expertiseTier = 6; + } else if (expertise < 5500){ + expertiseTier = 7; + } else if (expertise < 10000){ + expertiseTier = 8; + } else if (expertise < 15000){ + expertiseTier = 9; + } else if (expertise > 15000){ + expertiseTier = 10; + } + + switch (expertiseTier) { + case 1: + expertiseTierAmount = "50"; + break; + case 2: + expertiseTierAmount = "100"; + break; + case 3: + expertiseTierAmount = "250"; + break; + case 4: + expertiseTierAmount = "500"; + break; + case 5: + expertiseTierAmount = "1,000"; + break; + case 6: + expertiseTierAmount = "2,500"; + break; + case 7: + expertiseTierAmount = "5,500"; + break; + case 8: + expertiseTierAmount = "10,000"; + break; + case 9: + expertiseTierAmount = "15,000"; + break; + case 10: + expertiseTierAmount = "Maxed"; + break; + } + + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); + + skillInfoLast = skillInfo; + skillInfo = XPInformation.getInstance().getSkillInfo(skillType); + if(skillInfo != null) { + float totalXp = skillInfo.totalXp; + + if(lastTotalXp > 0) { + float delta = totalXp - lastTotalXp; + + if(delta > 0 && delta < 1000) { + xpGainTimer = 3; + + xpGainQueue.add(0, delta); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isFishing = true; + } else if(xpGainTimer > 0) { + xpGainTimer--; + + xpGainQueue.add(0, 0f); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isFishing = true; + } else if(delta <= 0) { + isFishing = false; + } + } + + lastTotalXp = totalXp; + } + + while(expertiseQueue.size() >= 4) { + expertiseQueue.removeLast(); + } + + if(expertiseQueue.isEmpty()) { + fishedPerSecond = -1; + fishedPerSecondLast = 0; + } else { + fishedPerSecondLast = fishedPerSecond; + int last = expertiseQueue.getLast(); + int first = expertiseQueue.getFirst(); + + fishedPerSecond = (first - last)/3f; + } + + if(expertise != -1) { + overlayStrings = new ArrayList<>(); + } else { + overlayStrings = null; + } + + } + + @Override + public void updateFrequent() { + super.updateFrequent(); + + if(expertise < 0) { + overlayStrings = null; + } else { + HashMap<Integer, String> lineMap = new HashMap<>(); + + overlayStrings = new ArrayList<>(); + + NumberFormat format = NumberFormat.getIntegerInstance(); + + /*if(expertise >= 0) { + int counterInterp = (int)interp(expertise, expertiseLast); + + lineMap.put(0, EnumChatFormatting.AQUA+"Expertise Kills: "+EnumChatFormatting.YELLOW+format.format(counterInterp)); + }*/ + + //TODO make this not be interp + /*if(expertise >= 0) { + if(fishedPerSecondLast == fishedPerSecond && fishedPerSecond <= 0) { + lineMap.put(7, EnumChatFormatting.AQUA+"Catches/m: "+EnumChatFormatting.YELLOW + "N/A"); + } else { + //float cpsInterp = interp(fishedPerSecond, fishedPerSecondLast); + + lineMap.put(7, EnumChatFormatting.AQUA+"Catches/m: "+EnumChatFormatting.YELLOW + + fishedPerSecond); + //String.format("%.2f", cpsInterp*60)); + } + }*/ + + if (expertiseTier <= 9) { + int counterInterp = (int) interp(expertise, expertiseLast); + lineMap.put(0, EnumChatFormatting.AQUA + "Expertise: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + expertiseTierAmount); + } + if (expertiseTier == 10) { + int counterInterp = (int) interp(expertise, expertiseLast); + lineMap.put(0, EnumChatFormatting.AQUA + "Expertise: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + " " + EnumChatFormatting.RED + expertiseTierAmount); + } + + float xpInterp = xpGainHour; + if(xpGainHourLast == xpGainHour && xpGainHour <= 0) { + lineMap.put(4, EnumChatFormatting.AQUA+"XP/h: "+EnumChatFormatting.YELLOW+"N/A"); + } else { + xpInterp = interp(xpGainHour, xpGainHourLast); + + lineMap.put(4, EnumChatFormatting.AQUA+"XP/h: "+EnumChatFormatting.YELLOW+ + format.format(xpInterp)+(isFishing ? "" : EnumChatFormatting.RED + " (PAUSED)")); + } + + if(skillInfo != null && skillInfo.level < 50) { + StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + skillType + ": "); + + levelStr.append(EnumChatFormatting.YELLOW) + .append(skillInfo.level) + .append(EnumChatFormatting.GRAY) + .append(" ["); + + float progress = skillInfo.currentXp / skillInfo.currentXpMax; + if(skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + progress = interp(progress, skillInfoLast.currentXp / skillInfoLast.currentXpMax); + } + + float lines = 25; + for(int i=0; i<lines; i++) { + if(i/lines < progress) { + levelStr.append(EnumChatFormatting.YELLOW); + } else { + levelStr.append(EnumChatFormatting.DARK_GRAY); + } + levelStr.append('|'); + } + + levelStr.append(EnumChatFormatting.GRAY) + .append("] ") + .append(EnumChatFormatting.YELLOW) + .append((int)(progress*100)) + .append("%"); + + int current = (int)skillInfo.currentXp; + if(skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int)interp(current, skillInfoLast.currentXp); + } + + int remaining = (int)(skillInfo.currentXpMax - skillInfo.currentXp); + if(skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + remaining = (int)interp(remaining, (int)(skillInfoLast.currentXpMax - skillInfoLast.currentXp)); + } + + lineMap.put(1, levelStr.toString()); + lineMap.put(2, EnumChatFormatting.AQUA+"Current XP: " + EnumChatFormatting.YELLOW+ format.format(current)); + if(remaining < 0) { + lineMap.put(3, EnumChatFormatting.AQUA+"Remaining XP: " + EnumChatFormatting.YELLOW+ "MAXED!"); + lineMap.put(5, EnumChatFormatting.AQUA+"ETA: "+EnumChatFormatting.YELLOW+ "MAXED!"); + } else { + lineMap.put(3, EnumChatFormatting.AQUA+"Remaining XP: " + EnumChatFormatting.YELLOW+ format.format(remaining)); + if(xpGainHour < 1000) { + lineMap.put(5, EnumChatFormatting.AQUA+"ETA: "+EnumChatFormatting.YELLOW+ "N/A"); + } else { + lineMap.put(5, EnumChatFormatting.AQUA+"ETA: "+EnumChatFormatting.YELLOW+ Utils.prettyTime((long)(remaining)*1000*60*60/(long)xpInterp)); + } + } + + } + + if (skillInfo != null && skillInfo.level == 50) { + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + lineMap.put(1, EnumChatFormatting.AQUA + "Fishing: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + "(Maxed)"); + lineMap.put(2, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + + } + + /*float yaw = Minecraft.getMinecraft().thePlayer.rotationYawHead; + yaw %= 360; + if(yaw < 0) yaw += 360; + if(yaw > 180) yaw -= 360; + + lineMap.put(6, EnumChatFormatting.AQUA+"Yaw: "+EnumChatFormatting.YELLOW+ + String.format("%.2f", yaw)+EnumChatFormatting.BOLD+"\u1D52");*/ + int key = NotEnoughUpdates.INSTANCE.config.skillOverlays.fishKey; + + ISound sound = new PositionedSound(new ResourceLocation("random.orb")) {{ + volume = 50; + repeat = false; + repeatDelay = 0; + attenuationType = ISound.AttenuationType.NONE; + }}; + + int funnyCustomTimer = 1000*NotEnoughUpdates.INSTANCE.config.skillOverlays.customFishTimer; + if (KeybindHelper.isKeyPressed(key) && timer != 0 && System.currentTimeMillis() - timer > 1000) { + timer = 0; + } else if (KeybindHelper.isKeyPressed(key) && timer == 0) { + timer = System.currentTimeMillis(); + } + if (timer >= 1) { + lineMap.put(6, EnumChatFormatting.AQUA + "Timer: " + EnumChatFormatting.YELLOW + Utils.prettyTime(System.currentTimeMillis() - (timer))); + } if (timer <= 0) { + lineMap.put(6, EnumChatFormatting.AQUA + "Timer: " + EnumChatFormatting.RED + "(Stopped)"); + } if (System.currentTimeMillis() - timer > funnyCustomTimer && System.currentTimeMillis() - timer < (funnyCustomTimer + 100) && funnyCustomTimer != 0) { + float oldLevel = Minecraft.getMinecraft().gameSettings.getSoundLevel(SoundCategory.PLAYERS); + Minecraft.getMinecraft().gameSettings.setSoundLevel(SoundCategory.PLAYERS, 1); + Minecraft.getMinecraft().getSoundHandler().playSound(sound); + Minecraft.getMinecraft().gameSettings.setSoundLevel(SoundCategory.PLAYERS, oldLevel); + } + + for(int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingText) { + if(lineMap.get(strIndex) != null) { + overlayStrings.add(lineMap.get(strIndex)); + } + } + if(overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; + } + } + + +}
\ No newline at end of file diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index 57a97161..a077f6d2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -261,10 +261,10 @@ public class MiningOverlay extends TextOverlay { } }*/ - if (!NotEnoughUpdates.INSTANCE.config.mining.dwarvenOverlay && NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0) - return; - if (SBInfo.getInstance().getLocation() == null) return; - if (SBInfo.getInstance().getLocation().equals("mining_3") || SBInfo.getInstance().getLocation().equals("crystal_hollows")) { + if(!NotEnoughUpdates.INSTANCE.config.mining.dwarvenOverlay && NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0 && !NotEnoughUpdates.INSTANCE.config.mining.titaniumAlert && NotEnoughUpdates.INSTANCE.config.mining.locWaypoints == 0) return; + //thanks to "Pure Genie#7250" for helping with this (makes tita alert and waypoints work without mine overlay) + if(SBInfo.getInstance().getLocation() == null) return; + if(SBInfo.getInstance().getLocation().equals("mining_3") || SBInfo.getInstance().getLocation().equals("crystal_hollows")) { overlayStrings = new ArrayList<>(); commissionProgress.clear(); @@ -617,77 +617,38 @@ public class MiningOverlay extends TextOverlay { ItemStack icon = null; String cleaned = Utils.cleanColour(line); String beforeColon = cleaned.split(":")[0]; - switch (beforeColon) { - case "Mithril Powder": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("INK_SACK-10")); - break; - case "Gemstone Powder": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("INK_SACK-9")); - break; - case "Lucky Raffle": - case "Raffle": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MINING_RAFFLE_TICKET")); - break; - case "Pickaxe CD": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DIAMOND_PICKAXE")); - break; - case "Thyst Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("THYST_MONSTER")); - break; - case "Hard Stone Miner": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("HARD_STONE")); - break; - case "Ice Walker Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_ICE")); - break; - case "Goblin Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("GOBLIN_MONSTER")); - break; - case "Star Sentry Puncher": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("NETHER_STAR")); - break; - case "Goblin Raid": - case "Goblin Raid Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_GOLD")); - break; - case "Golden Goblin Slayer": - icon = new ItemStack(Items.golden_helmet, 1, 0); - break; - case "2x Mithril Powder Collector": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_GLOWSTONE_DUST")); - break; - case "Automaton Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("AUTOMATON_MONSTER")); - break; - case "Sludge Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SLUDGE_MONSTER")); - break; - case "Team Treasurite Member Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("EXECUTIVE_WENDY_MONSTER")); - break; - case "Yog Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("YOG_MONSTER")); - break; - case "Boss Corleone Slayer": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("BOSS_CORLEONE_BOSS")); - break; - case "Chest Looter": - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("CHEST")); - break; + + if(miningOverlayCommisionItems == null){ + setupMiningOverlayCommisionItems(); } - if (icon == null) { + + if (miningOverlayCommisionItems.containsKey(beforeColon)) { + icon = miningOverlayCommisionItems.get(beforeColon); + } else { if (beforeColon.startsWith("Forge")) { - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ANVIL")); + icon = miningOverlayCommisionItems.get("Forge"); } else if (beforeColon.contains("Mithril")) { - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MITHRIL_ORE")); + icon = miningOverlayCommisionItems.get("Mithril"); } else if (beforeColon.endsWith(" Gemstone Collector")) { - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ROUGH_" - + beforeColon.replace(" Gemstone Collector", "").toUpperCase() + "_GEM")); + String gemName = "ROUGH_" + + beforeColon.replace(" Gemstone Collector", "").toUpperCase() + "_GEM"; + if(miningOverlayRoughGems.containsKey(gemName)){ + icon = miningOverlayRoughGems.get(gemName); + } else { + icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(gemName)); + miningOverlayRoughGems.put(gemName, icon); + } } else if (beforeColon.endsWith(" Crystal Hunter")) { - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_" - + beforeColon.replace(" Crystal Hunter", "").toUpperCase() + "_GEM")); + String gemName = "PERFECT_" + + beforeColon.replace(" Crystal Hunter", "").toUpperCase() + "_GEM"; + if(miningOverlayPerfectGems.containsKey(gemName)){ + icon = miningOverlayPerfectGems.get(gemName); + } else { + icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(gemName)); + miningOverlayPerfectGems.put(gemName, icon); + } } else if (beforeColon.contains("Titanium")) { - icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("TITANIUM_ORE")); + icon = miningOverlayCommisionItems.get("Titanium"); } } @@ -703,4 +664,37 @@ public class MiningOverlay extends TextOverlay { super.renderLine(line, position, dummy); } + + private static HashMap<String, ItemStack> miningOverlayRoughGems = new HashMap<String, ItemStack>() {}; + private static HashMap<String, ItemStack> miningOverlayPerfectGems = new HashMap<String, ItemStack>() {}; + + + private static HashMap<String, ItemStack> miningOverlayCommisionItems; + private static void setupMiningOverlayCommisionItems(){ + miningOverlayCommisionItems = new HashMap<String, ItemStack>() {}; + miningOverlayCommisionItems.put("Mithril Powder", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("INK_SACK-10"))); + miningOverlayCommisionItems.put("Gemstone Powder", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("INK_SACK-9"))); + miningOverlayCommisionItems.put("Lucky Raffle", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MINING_RAFFLE_TICKET"))); + miningOverlayCommisionItems.put("Raffle", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MINING_RAFFLE_TICKET"))); + miningOverlayCommisionItems.put("Pickaxe CD", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("DIAMOND_PICKAXE"))); + miningOverlayCommisionItems.put("Thyst Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("THYST_MONSTER"))); + miningOverlayCommisionItems.put("Hard Stone Miner", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("HARD_STONE"))); + miningOverlayCommisionItems.put("Ice Walker Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_ICE"))); + miningOverlayCommisionItems.put("Goblin Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("GOBLIN_MONSTER"))); + miningOverlayCommisionItems.put("Star Sentry Puncher", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("NETHER_STAR"))); + miningOverlayCommisionItems.put("Goblin Raid", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_GOLD"))); + miningOverlayCommisionItems.put("Goblin Raid Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_GOLD"))); + miningOverlayCommisionItems.put("Golden Goblin Slayer", new ItemStack(Items.golden_helmet, 1, 0)); + miningOverlayCommisionItems.put("2x Mithril Powder Collector", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ENCHANTED_GLOWSTONE_DUST"))); + miningOverlayCommisionItems.put("Automaton Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("AUTOMATON_MONSTER"))); + miningOverlayCommisionItems.put("Sludge Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SLUDGE_MONSTER"))); + miningOverlayCommisionItems.put("Team Treasurite Member Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("EXECUTIVE_WENDY_MONSTER"))); + miningOverlayCommisionItems.put("Yog Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("YOG_MONSTER"))); + miningOverlayCommisionItems.put("Boss Corleone Slayer", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("BOSS_CORLEONE_BOSS"))); + miningOverlayCommisionItems.put("Chest Looter", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("CHEST"))); + miningOverlayCommisionItems.put("Titanium", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("TITANIUM_ORE"))); + miningOverlayCommisionItems.put("Mithril", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MITHRIL_ORE"))); + miningOverlayCommisionItems.put("Forge", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ANVIL"))); + } + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java new file mode 100644 index 00000000..43d6ab70 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java @@ -0,0 +1,344 @@ +package io.github.moulberry.notenoughupdates.overlays; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.config.Position; +import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; +import io.github.moulberry.notenoughupdates.util.Utils; +import io.github.moulberry.notenoughupdates.util.XPInformation; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Supplier; + +public class MiningSkillOverlay extends TextOverlay { //Im sure there is a much better way to do this besides making another class ¯\_(ツ)_/¯ + + private long lastUpdate = -1; + private int compactLast = -1; + private int compact = -1; + private int compactTier = -1; + private String compactTierAmount = "1"; + private float minedPerSecondLast = 0; + private float minedPerSecond = 0; + private LinkedList<Integer> compactQueue = new LinkedList<>(); + + private XPInformation.SkillInfo skillInfo = null; + private XPInformation.SkillInfo skillInfoLast = null; + + private float lastTotalXp = -1; + private boolean isMining = false; + private LinkedList<Float> xpGainQueue = new LinkedList<>(); + private float xpGainHourLast = -1; + private float xpGainHour = -1; + + private int xpGainTimer = 0; + + private String skillType = "Mining"; + + public MiningSkillOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) { + super(position, dummyStrings, styleSupplier); + } + + private float interp(float now, float last) { + float interp = now; + if(last >= 0 && last != now) { + float factor = (System.currentTimeMillis()-lastUpdate)/1000f; + factor = LerpUtils.clampZeroOne(factor); + interp = last + (now - last) * factor; + } + return interp; + } + + @Override + public void update() { + if(!NotEnoughUpdates.INSTANCE.config.skillOverlays.miningSkillOverlay) { + compact = -1; + overlayStrings = null; + return; + } + + lastUpdate = System.currentTimeMillis(); + compactLast = compact; + xpGainHourLast = xpGainHour; + compact = -1; + + if(Minecraft.getMinecraft().thePlayer == null) return; + + ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem(); + if(stack != null && stack.hasTagCompound()) { + NBTTagCompound tag = stack.getTagCompound(); + + if(tag.hasKey("ExtraAttributes", 10)) { + NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); + + if(ea.hasKey("compact_blocks", 99)) { + compact = ea.getInteger("compact_blocks"); + compactQueue.add(0, compact); + } + } + } + if (compact < 100){ + compactTier = 1; + } else if (compact < 500){ + compactTier = 2; + } else if (compact < 1500){ + compactTier = 3; + } else if (compact < 5000){ + compactTier = 4; + } else if (compact < 15000){ + compactTier = 5; + } else if (compact < 50000){ + compactTier = 6; + } else if (compact < 150000){ + compactTier = 7; + } else if (compact < 500000){ + compactTier = 8; + } else if (compact < 1000000){ + compactTier = 9; + } else if (compact > 1000000){ + compactTier = 10; + } + + switch (compactTier) { + case 1: + compactTierAmount = "100"; + break; + case 2: + compactTierAmount = "500"; + break; + case 3: + compactTierAmount = "1,500"; + break; + case 4: + compactTierAmount = "5,000"; + break; + case 5: + compactTierAmount = "15,000"; + break; + case 6: + compactTierAmount = "50,000"; + break; + case 7: + compactTierAmount = "150,000"; + break; + case 8: + compactTierAmount = "500,000"; + break; + case 9: + compactTierAmount = "1,000,000"; + break; + case 10: + compactTierAmount = "Maxed"; + break; + } + + + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); + + skillInfoLast = skillInfo; + skillInfo = XPInformation.getInstance().getSkillInfo(skillType); + if(skillInfo != null) { + float totalXp = skillInfo.totalXp; + + if(lastTotalXp > 0) { + float delta = totalXp - lastTotalXp; + + if(delta > 0 && delta < 1000) { + xpGainTimer = 3; + + xpGainQueue.add(0, delta); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isMining = true; + } else if(xpGainTimer > 0) { + xpGainTimer--; + + xpGainQueue.add(0, 0f); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isMining = true; + } else if(delta <= 0) { + isMining = false; + } + } + + lastTotalXp = totalXp; + } + + while(compactQueue.size() >= 4) { + compactQueue.removeLast(); + } + + if(compactQueue.isEmpty()) { + minedPerSecond = -1; + minedPerSecondLast = 0; + } else { + minedPerSecondLast = minedPerSecond; + int last = compactQueue.getLast(); + int first = compactQueue.getFirst(); + + minedPerSecond = (first - last)/3f; + } + + if(compact != -1) { + overlayStrings = new ArrayList<>(); + } else { + overlayStrings = null; + } + + } + + @Override + public void updateFrequent() { + super.updateFrequent(); + + if(compact < 0) { + overlayStrings = null; + } else { + HashMap<Integer, String> lineMap = new HashMap<>(); + + overlayStrings = new ArrayList<>(); + + NumberFormat format = NumberFormat.getIntegerInstance(); + + if (compact >= 0) { + int counterInterp = (int) interp(compact, compactLast); + + lineMap.put(0, EnumChatFormatting.AQUA + "Compact: " + EnumChatFormatting.YELLOW + format.format(counterInterp)); + } + + if (compact >= 0) { + if (minedPerSecondLast == minedPerSecond && minedPerSecond <= 0) { + lineMap.put(1, EnumChatFormatting.AQUA + "Blocks/m: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + float cpsInterp = interp(minedPerSecond, minedPerSecondLast); + + lineMap.put(1, EnumChatFormatting.AQUA + "Blocks/m: " + EnumChatFormatting.YELLOW + + String.format("%,.2f", cpsInterp * 60)); + } + } + + if (compactTier <= 9) { + int counterInterp = (int) interp(compact, compactLast); + lineMap.put(8, EnumChatFormatting.AQUA + "Compact Progress: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + compactTierAmount); + } + if (compactTier == 10) { + lineMap.put(8, EnumChatFormatting.AQUA + "Compact Progress: " + EnumChatFormatting.RED + compactTierAmount); + } + + float xpInterp = xpGainHour; + if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { + lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + xpInterp = interp(xpGainHour, xpGainHourLast); + + lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + + format.format(xpInterp) + (isMining ? "" : EnumChatFormatting.RED + " (PAUSED)")); + } + + if (skillInfo != null && skillInfo.level < 60) { + StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + "Mining" + ": "); //yes ik its spelt wrong + + levelStr.append(EnumChatFormatting.YELLOW) + .append(skillInfo.level) + .append(EnumChatFormatting.GRAY) + .append(" ["); + + float progress = skillInfo.currentXp / skillInfo.currentXpMax; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + progress = interp(progress, skillInfoLast.currentXp / skillInfoLast.currentXpMax); + } + + float lines = 25; + for (int i = 0; i < lines; i++) { + if (i / lines < progress) { + levelStr.append(EnumChatFormatting.YELLOW); + } else { + levelStr.append(EnumChatFormatting.DARK_GRAY); + } + levelStr.append('|'); + } + + levelStr.append(EnumChatFormatting.GRAY) + .append("] ") + .append(EnumChatFormatting.YELLOW) + .append((int) (progress * 100)) + .append("%"); + + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + int remaining = (int) (skillInfo.currentXpMax - skillInfo.currentXp); + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + remaining = (int) interp(remaining, (int) (skillInfoLast.currentXpMax - skillInfoLast.currentXp)); + } + + lineMap.put(2, levelStr.toString()); + lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + if (remaining < 0) { + lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); + } else { + lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining)); + if (xpGainHour < 1000) { + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp)); + } + } + + } + + if (skillInfo != null && skillInfo.level == 60) { + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + lineMap.put(2, EnumChatFormatting.AQUA + "Mine: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + "(Maxed)"); + lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + + } + + + float yaw = Minecraft.getMinecraft().thePlayer.rotationYawHead; + yaw %= 360; + if(yaw < 0) yaw += 360; + if(yaw > 180) yaw -= 360; + + lineMap.put(6, EnumChatFormatting.AQUA+"Yaw: "+EnumChatFormatting.YELLOW+ + String.format("%.2f", yaw)+EnumChatFormatting.BOLD+"\u1D52"); + + for(int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.miningText) { + if(lineMap.get(strIndex) != null) { + overlayStrings.add(lineMap.get(strIndex)); + } + } + if(overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; + } + } + + +}
\ No newline at end of file diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java index a9349865..aa52d874 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -13,6 +13,8 @@ public class OverlayManager { public static MiningOverlay miningOverlay; public static FarmingOverlay farmingOverlay; + public static FishingSkillOverlay fishingSkillOverlay; + public static MiningSkillOverlay miningSkillOverlay; public static PetInfoOverlay petInfoOverlay; public static TimersOverlay timersOverlay; public static BonemerangOverlay bonemerangOverlay; @@ -87,7 +89,48 @@ public class OverlayManager { } return TextOverlayStyle.BACKGROUND; }); - + List<String> miningSkillDummy = Lists.newArrayList( + "\u00a7bCompact: \u00a7e547,860", + "\u00a7bBlocks/m: \u00a7e38.29", + "\u00a7bMine: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%", + "\u00a7bCurrent XP: \u00a7e6,734", + "\u00a7bRemaining XP: \u00a7e3,265", + "\u00a7bXP/h: \u00a7e238,129", + "\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52"); + miningSkillOverlay = new MiningSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.miningPosition, () -> { + List<String> strings = new ArrayList<>(); + for(int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.miningText) { + if(i >= 0 && i < miningSkillDummy.size()) strings.add(miningSkillDummy.get(i)); + } + return strings; + }, () -> { + int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.miningStyle; + if(style >= 0 && style < TextOverlayStyle.values().length) { + return TextOverlayStyle.values()[style]; + } + return TextOverlayStyle.BACKGROUND; + }); + List<String> fishingDummy = Lists.newArrayList("\u00a7bCatches: \u00a7e37,547,860", + //"\u00a7bCatches/m: \u00a7e38.29", + "\u00a7bFish: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%", + "\u00a7bCurrent XP: \u00a7e6,734", + "\u00a7bRemaining XP: \u00a7e3,265", + "\u00a7bXP/h: \u00a7e238,129" + //"\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52" + ); + fishingSkillOverlay = new FishingSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingPosition, () -> { + List<String> strings = new ArrayList<>(); + for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingText) { + if (i >= 0 && i < fishingDummy.size()) strings.add(fishingDummy.get(i)); + } + return strings; + }, () -> { + int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingStyle; + if (style >= 0 && style < TextOverlayStyle.values().length) { + return TextOverlayStyle.values()[style]; + } + return TextOverlayStyle.BACKGROUND; + }); List<String> petInfoDummy = Lists.newArrayList("\u00a7a[Lvl 37] \u00a7fRock", "\u00a7b2,312.9/2,700\u00a7e (85.7%)", "\u00a7b2.3k/2.7k\u00a7e (85.7%)", @@ -170,6 +213,8 @@ public class OverlayManager { textOverlays.add(miningOverlay); textOverlays.add(farmingOverlay); + textOverlays.add(miningSkillOverlay); + textOverlays.add(fishingSkillOverlay); textOverlays.add(petInfoOverlay); textOverlays.add(bonemerangOverlay); textOverlays.add(crystalHollowOverlay); 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 1eb8f1c0..9dcac181 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -7,7 +7,6 @@ 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; @@ -24,7 +23,6 @@ import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; 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; @@ -67,6 +65,7 @@ public class GuiProfileViewer extends GuiScreen { 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_mining = new ResourceLocation("notenoughupdates:pv_mining.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"); @@ -106,7 +105,8 @@ public class GuiProfileViewer extends GuiScreen { EXTRA(new ItemStack(Items.book)), INVS(new ItemStack(Item.getItemFromBlock(Blocks.ender_chest))), COLS(new ItemStack(Items.painting)), - PETS(new ItemStack(Items.bone)); + PETS(new ItemStack(Items.bone)), + MINING(new ItemStack(Items.iron_pickaxe)); public final ItemStack stack; @@ -263,6 +263,9 @@ public class GuiProfileViewer extends GuiScreen { case PETS: drawPetsPage(mouseX, mouseY, partialTicks); break; + case MINING: + drawMiningPage(mouseX, mouseY, partialTicks); + break; case LOADING: String str = EnumChatFormatting.YELLOW + "Loading player profiles."; long currentTimeMod = System.currentTimeMillis() % 1000; @@ -777,9 +780,11 @@ public class GuiProfileViewer extends GuiScreen { } private static final ItemStack DEADBUSH = new ItemStack(Item.getItemFromBlock(Blocks.deadbush)); + private static final ItemStack iron_pick = new ItemStack(Items.iron_pickaxe); private static final ItemStack[] BOSS_HEADS = new ItemStack[7]; private final HashMap<String, ProfileViewer.Level> levelObjCatas = new HashMap<>(); + private final HashMap<String, ProfileViewer.Level> levelObjhotms = new HashMap<>(); private final HashMap<String, HashMap<String, ProfileViewer.Level>> levelObjClasseses = new HashMap<>(); private final GuiElementTextField dungeonLevelTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); @@ -887,12 +892,21 @@ public class GuiProfileViewer extends GuiScreen { Utils.renderAlignedString(EnumChatFormatting.YELLOW + "Until Cata " + floorLevelTo + ": ", EnumChatFormatting.WHITE + 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)) { + if(mouseX > x && mouseX < x + sectionWidth && mouseY > y+16 && mouseY < y+24 && !onMasterMode) { + float F5 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.tier_completions."+5), 0)); //this can prob be done better + float F6 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.tier_completions."+6), 0)); + float F7 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.tier_completions."+7), 0)); + if (F5 > 150){ + F5 = 150; + } if (F6 > 100){ + F6 = 100; + } if (F7 > 50){ + F7 = 50; + } + float xpF5 = 2000*(F5/100+1); + float xpF6 = 4000*(F6/100+1); + float xpF7 = 20000*(F7/100+1); + if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { xpF5 *= 1.1; xpF6 *= 1.1; xpF7 *= 1.1; @@ -938,9 +952,91 @@ public class GuiProfileViewer extends GuiScreen { 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%"); + 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 Fastest S+ x 120%"); + } else { + tooltipToDisplay.add("[Hold "+EnumChatFormatting.YELLOW+"CTRL"+EnumChatFormatting.GRAY+" to see details]"); + } + } + + if(mouseX > x && mouseX < x + sectionWidth && mouseY > y+16 && mouseY < y+24 && onMasterMode) { + float M3 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.tier_completions."+3), 0)); + float M4 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.tier_completions."+4), 0)); + float M5 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.tier_completions."+5), 0)); //this can prob be done better + float M6 = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.tier_completions."+6), 0)); + if (M3 > 50){ + M3 = 50; + } if (M4 > 50){ + M4 = 50; + } if (M5 > 50){ + M5 = 50; + } if (M6 > 50){ + M6 = 50; + } + float xpM3 = 36500*(M3/100+1); + float xpM4 = 48500*(M4/100+1); + float xpM5 = 70000*(M5/100+1); + float xpM6 = 100000*(M6/100+1); + //No clue if M3 or M4 xp values are right + if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + xpM3 *= 1.1; + xpM4 *= 1.1; + xpM5 *= 1.1; + xpM6 *= 1.1; + } + + long runsM3 = (int)Math.ceil(floorLevelToXP/xpM3); + long runsM4 = (int)Math.ceil(floorLevelToXP/xpM4); + long runsM5 = (int)Math.ceil(floorLevelToXP/xpM5); + long runsM6 = (int)Math.ceil(floorLevelToXP/xpM6); + + float timeM3 = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.3"), 0); + float timeM4 = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.4"), 0); + float timeM5 = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.5"), 0); + float timeM6 = Utils.getElementAsFloat(Utils.getElement(profileInfo, + "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.6"), 0); + + tooltipToDisplay = Lists.newArrayList( + String.format("# M3 Runs (%s xp) : %d", shortNumberFormat(xpM3, 0), runsM3), + String.format("# M4 Runs (%s xp) : %d", shortNumberFormat(xpM4, 0), runsM4), + String.format("# M5 Runs (%s xp) : %d", shortNumberFormat(xpM5, 0), runsM5), + String.format("# M6 Runs (%s xp) : %d", shortNumberFormat(xpM6, 0), runsM6), + "" + ); + boolean hasTime = false; + if(timeM3 > 1000) { + tooltipToDisplay.add(String.format("Expected Time (M3) : %s", Utils.prettyTime(runsM3*(long)(timeM3*1.2)))); + hasTime = true; + } + if(timeM4 > 1000) { + tooltipToDisplay.add(String.format("Expected Time (M4) : %s", Utils.prettyTime(runsM4*(long)(timeM4*1.2)))); + hasTime = true; + } + if(timeM5 > 1000) { + tooltipToDisplay.add(String.format("Expected Time (M5) : %s", Utils.prettyTime(runsM5*(long)(timeM5*1.2)))); + hasTime = true; + } + if(timeM6 > 1000) { + tooltipToDisplay.add(String.format("Expected Time (M6) : %s", Utils.prettyTime(runsM6*(long)(timeM6*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 Fastest S+ x 120%"); } else { tooltipToDisplay.add("[Hold " + EnumChatFormatting.YELLOW + "CTRL" + EnumChatFormatting.GRAY + " to see details]"); } @@ -2602,9 +2698,9 @@ public class GuiProfileViewer extends GuiScreen { guiLeft + xStart + xOffset * 2, guiTop + yStartBottom + yOffset * 0, 76); Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA + "Sven T4", EnumChatFormatting.WHITE.toString() + (int) wolf_boss_kills_tier_3, guiLeft + xStart + xOffset * 2, guiTop + yStartBottom + yOffset * 1, 76); - Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA + "Voidgloom Seraph T3", EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_2, + Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA + "Voidgloom T3", EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_2, guiLeft + xStart + xOffset * 2, guiTop + yStartBottom + yOffset * 2, 76); - Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA + "Voidgloom Seraph T4", EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_3, + Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA + "Voidgloom T4", EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_3, guiLeft + xStart + xOffset * 2, guiTop + yStartBottom + yOffset * 3, 76); float pet_milestone_ores_mined = Utils.getElementAsFloat(Utils.getElement(profileInfo, "stats.pet_milestone_ores_mined"), 0); @@ -2683,6 +2779,1090 @@ public class GuiProfileViewer extends GuiScreen { } } + private void drawMiningPage(int mouseX, int mouseY, float partialTicks) { + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_mining); + Utils.drawTexturedRect(guiLeft, guiTop, sizeX, sizeY, GL11.GL_NEAREST); + + JsonObject profileInfo = profile.getProfileInformation(profileId); + if (profileInfo == null) return; + JsonObject skillInfo = profile.getSkillInfo(profileId); + + float xStart = 22; + float xOffset = 103; + float yStartTop = 27; + float yStartBottom = 105; + float yOffset = 10; + + int x = guiLeft + 23; + int y = guiTop + 25; + int sectionWidth = 110; + JsonObject leveling = Constants.LEVELING; + ProfileViewer.Level levelObjhotm = levelObjhotms.get(profileId); + if (levelObjhotm == null) { + float hotmXp = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.experience"), 0); + levelObjhotm = ProfileViewer.getLevel(Utils.getElement(leveling, "HOTM").getAsJsonArray(), + hotmXp, 7, false); + levelObjhotms.put(profileId, levelObjhotm); + } + + String skillName = EnumChatFormatting.RED + "HOTM"; + //The stats that show + float mithrilPowder = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_mithril"), 0); + float gemstonePowder = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_gemstone"), 0); + float mithrilPowderTotal = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_spent_mithril"), 0); + float gemstonePowderTotal = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_spent_gemstone"), 0)); + String jadeCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.jade_crystal.state"), "Not Found")); + float crystalPlacedAmount = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.crystals.jade_crystal.total_placed"), 0)); + String jadeCrystalString = "§c✖"; + String amethystCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.amethyst_crystal.state"), "Not Found")); + String amethystCrystalString = "§c✖"; + String amberCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.amber_crystal.state"), "Not Found")); + String amberCrystalString = "§c✖"; + String sapphireCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.sapphire_crystal.state"), "Not Found")); + String sapphireCrystalString = "§c✖"; + String topazCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.topaz_crystal.state"), "Not Found")); + String topazCrystalString = "§c✖"; + String jasperCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.jasper_crystal.state"), "Not Found")); + String jasperCrystalString = "§c✖"; + String rubyCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.ruby_crystal.state"), "Not Found")); + String rubyCrystalString = "§c✖"; + int miningFortune = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune"), 0))); + int miningFortuneStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune"), 0)) * 5); + int miningSpeed = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed"), 0))); + int miningSpeedStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed"), 0)) * 20); + int dailyPowder = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_powder"), 0))); + int dailyPowderStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_powder"), 0)) * 36 + 364); + int effMiner = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0))); + float effMinerStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0)) * 0.4 + 10.4); + float effMinerStat2 = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0)) * .06 + 0.31); + int tittyInsane = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.titanium_insanium"), 0))); + float tittyInsaneStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.titanium_insanium"), 0)) * .1 + 2); + int luckofcave = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.random_event"), 0))); + int luckofcaveStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.random_event"), 0))); + int madMining = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_madness"), 0))); + int skyMall = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_effect"), 0))); + int goblinKiller = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.goblin_killer"), 0))); + int seasonMine = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_experience"), 0))); + float seasonMineStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.mining_experience"), 0)) * 0.1 + 5); + int quickForge = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.forge_time"), 0))); + float quickForgeStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.forge_time"), 0)) * .5 + 10); + int frontLoad = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.front_loaded"), 0))); + int orbit = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.experience_orbs"), 0))); + float orbitStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.experience_orbs"), 0)) * .01 + 0.2); + int crystallized = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), 0))); + int crystallizedStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), 0)) * 6 + 14); + int professional = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.professional"), 0))); + int professionalStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.professional"), 0)) * 5 + 50); + int greatExplorer = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.great_explorer"), 0))); + int greatExplorerStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.great_explorer"), 0)) * 4 + 16); + int fortunate = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fortunate"), 0))); + int fortunateStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fortunate"), 0)) * 4 + 20); + int lonesomeMiner = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.lonesome_miner"), 0))); + float lonesomeMinerStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.lonesome_miner"), 0)) * .5 + 5); + int miningFortune2 = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune_2"), 0))); + int miningFortune2Stat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune_2"), 0)) * 5); + int miningSpeed2 = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_2"), 0))); + int miningSpeed2Stat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_2"), 0)) * 40); + int miningSpeedBoost = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_boost"), 0))); + int veinSeeker = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.vein_seeker"), 0))); + int powderBuff = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.powder_buff"), 0))); + int potm = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.special_0"), 0))); + int fortnite = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.precision_mining"), 0))); + int starPowder = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.star_powder"), 0))); + int pickoblus = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.pickaxe_toss"), 0))); + int maniacMiner = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.maniac_miner"), 0))); + + if (effMinerStat2 < 1) { + effMinerStat2 = 1; + } + int moul = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mole"), 0))); + float moulStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.mole"), 0)) * 0.051); + double moleperkstat = (double) moul / 20 - 0.55 + 50; + double moleperkstat2 = (double) Math.round(moleperkstat * 100) / 100; + float output = (float) (moleperkstat2 % 1) * 100; + if (output == 0) { + output = 100; + } + + //The logic for some of the stats + if (Objects.equals(jadeCrystal, "NOT_FOUND")) { + jadeCrystalString = "§c✖"; + } else if (Objects.equals(jadeCrystal, "FOUND")) { + jadeCrystalString = "§a✔"; + } + if (Objects.equals(amethystCrystal, "NOT_FOUND")) { + amethystCrystalString = "§c✖"; + } else if (Objects.equals(amethystCrystal, "FOUND")) { + amethystCrystalString = "§a✔"; + } + if (Objects.equals(amberCrystal, "NOT_FOUND")) { + amberCrystalString = "§c✖"; + } else if (Objects.equals(amberCrystal, "FOUND")) { + amberCrystalString = "§a✔"; + } + if (Objects.equals(sapphireCrystal, "NOT_FOUND")) { + sapphireCrystalString = "§c✖"; + } else if (Objects.equals(sapphireCrystal, "FOUND")) { + sapphireCrystalString = "§a✔"; + } + if (Objects.equals(topazCrystal, "NOT_FOUND")) { + topazCrystalString = "§c✖"; + } else if (Objects.equals(topazCrystal, "FOUND")) { + topazCrystalString = "§a✔"; + } + if (Objects.equals(jasperCrystal, "NOT_FOUND")) { + jasperCrystalString = "§c✖"; + } else if (Objects.equals(jasperCrystal, "FOUND")) { + jasperCrystalString = "§a✔"; + } + if (Objects.equals(rubyCrystal, "NOT_FOUND")) { + rubyCrystalString = "§c✖"; + } else if (Objects.equals(rubyCrystal, "FOUND")) { + rubyCrystalString = "§a✔"; + } + + //The rendering of the stats + //hotm level + renderXpBar(skillName, iron_pick, x, y, sectionWidth, levelObjhotm, mouseX, mouseY); + //Powder + Utils.renderAlignedString(EnumChatFormatting.DARK_GREEN + "Mithril Powder", EnumChatFormatting.WHITE + shortNumberFormat(mithrilPowder, 0), + guiLeft + xStart, guiTop + yStartTop + 24, 115); + Utils.renderAlignedString(EnumChatFormatting.LIGHT_PURPLE + "Gemstone Powder", EnumChatFormatting.WHITE + shortNumberFormat(gemstonePowder, 0), + guiLeft + xStart, guiTop + yStartTop + 44, 115); + Utils.renderAlignedString(EnumChatFormatting.DARK_GREEN + "Total Mithril Powder", EnumChatFormatting.WHITE + shortNumberFormat(mithrilPowderTotal + mithrilPowder, 0), + guiLeft + xStart, guiTop + yStartTop + 34, 115); + Utils.renderAlignedString(EnumChatFormatting.LIGHT_PURPLE + "Total Gemstone Powder", EnumChatFormatting.WHITE + shortNumberFormat(gemstonePowderTotal + gemstonePowder, 0), + guiLeft + xStart, guiTop + yStartTop + 54, 115); + //Crystals + Utils.renderAlignedString(EnumChatFormatting.GREEN + "Jade Crystal:", EnumChatFormatting.WHITE + jadeCrystalString, + guiLeft + xStart, guiTop + yStartTop + 74, 110); + Utils.renderAlignedString(EnumChatFormatting.GOLD + "Amber Crystal:", EnumChatFormatting.WHITE + amberCrystalString, + guiLeft + xStart, guiTop + yStartTop + 84, 110); + Utils.renderAlignedString(EnumChatFormatting.DARK_PURPLE + "Amethyst Crystal:", EnumChatFormatting.WHITE + amethystCrystalString, + guiLeft + xStart, guiTop + yStartTop + 94, 110); + Utils.renderAlignedString(EnumChatFormatting.AQUA + "Sapphire Crystal:", EnumChatFormatting.WHITE + sapphireCrystalString, + guiLeft + xStart, guiTop + yStartTop + 104, 110); + Utils.renderAlignedString(EnumChatFormatting.YELLOW + "Topaz Crystal:", EnumChatFormatting.WHITE + topazCrystalString, + guiLeft + xStart, guiTop + yStartTop + 114, 110); + Utils.renderAlignedString(EnumChatFormatting.LIGHT_PURPLE + "Jasper Crystal:", EnumChatFormatting.WHITE + jasperCrystalString, + guiLeft + xStart, guiTop + yStartTop + 124, 110); + Utils.renderAlignedString(EnumChatFormatting.RED + "Ruby Crystal:", EnumChatFormatting.WHITE + rubyCrystalString, + guiLeft + xStart, guiTop + yStartTop + 134, 110); + Utils.renderAlignedString(EnumChatFormatting.BLUE + "Total Placed Crystals:", EnumChatFormatting.WHITE + shortNumberFormat(crystalPlacedAmount, 0), + guiLeft + xStart, guiTop + yStartTop + 149, 110); + + //hotm render + //Pain + //if (miningSpeed == 0) { + + boolean miningSpeedunlocked = (miningSpeed > 0); + List<String> miningSpeedTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((miningSpeedunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 138)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 138 && mouseY <= guiTop + yStartTop + 154) { + miningSpeedTooltip = Lists.newArrayList( + (miningSpeedunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mining Speed", + EnumChatFormatting.GRAY + "Level " + miningSpeed + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "+" + miningSpeedStat + EnumChatFormatting.GOLD + " ⸕ Mining", + EnumChatFormatting.GOLD + "Speed" + EnumChatFormatting.GRAY + "." + ); + Utils.drawHoveringText(miningSpeedTooltip, mouseX, mouseY, width, height, -1, fr); + miningSpeedTooltip = null; + } + } + boolean miningFortuneunlocked = (miningFortune > 0); + List<String> miningFortuneTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((miningFortuneunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + miningFortuneTooltip = Lists.newArrayList( + (miningSpeedunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mining Fortune", + EnumChatFormatting.GRAY + "Level " + miningFortune + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "+" + miningFortuneStat + EnumChatFormatting.GOLD + " ☘ Mining", + EnumChatFormatting.GOLD + "Fortune" + EnumChatFormatting.GRAY + "." + ); + Utils.drawHoveringText(miningFortuneTooltip, mouseX, mouseY, width, height, -1, fr); + miningFortuneTooltip = null; + } + } + boolean tittyInsaneunlocked = (tittyInsane > 0); + List<String> tittyInsaneTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((tittyInsaneunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 231), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 231 && mouseX < guiLeft + xStart + 247) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + tittyInsaneTooltip = Lists.newArrayList( + (tittyInsaneunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Titanium Insanium", + EnumChatFormatting.GRAY + "Level " + tittyInsane + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "When mining Mithril Ore, you", + EnumChatFormatting.GRAY + "have a " + EnumChatFormatting.GREEN + tittyInsaneStat + "% " + EnumChatFormatting.GRAY + "chance to", + EnumChatFormatting.GRAY + "convert the block into Titanium", + EnumChatFormatting.GRAY + "Ore." + ); + Utils.drawHoveringText(tittyInsaneTooltip, mouseX, mouseY, width, height, -1, fr); + tittyInsaneTooltip = null; + } + } + if (miningSpeedBoost == 0) { + if (potm == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Mining Speed Boost", + "", + EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "200% " + EnumChatFormatting.GOLD + "⸕ Mining", + EnumChatFormatting.GOLD + "Speed " + EnumChatFormatting.GRAY + "for " + EnumChatFormatting.GREEN + "15s" + EnumChatFormatting.GRAY, + EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (potm > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Mining Speed Boost", + "", + EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "300% " + EnumChatFormatting.GOLD + "⸕ Mining", + EnumChatFormatting.GOLD + "Speed " + EnumChatFormatting.GRAY + "for " + EnumChatFormatting.GREEN + "20s" + EnumChatFormatting.GRAY, + EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + } + if (miningSpeedBoost > 0) { + if (potm == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Mining Speed Boost", + "", + EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "200% " + EnumChatFormatting.GOLD + "⸕ Mining", + EnumChatFormatting.GOLD + "Speed " + EnumChatFormatting.GRAY + "for " + EnumChatFormatting.GREEN + "15s" + EnumChatFormatting.GRAY, + EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (potm > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Mining Speed Boost", + "", + EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "300% " + EnumChatFormatting.GOLD + "⸕ Mining", + EnumChatFormatting.GOLD + "Speed " + EnumChatFormatting.GRAY + "for " + EnumChatFormatting.GREEN + "20s" + EnumChatFormatting.GRAY, + EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + } + if (veinSeeker == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 183), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 183 && mouseX < guiLeft + xStart + 199) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Vein Seeker", + "", + "§6Pickaxe Ability: Vein Seeker", + "§7Points in the direction of the", + "§7nearest vein and grants §a+§a3§7", + "§7§6Mining Spread §7for §a14s§7§7.", + "§8Cooldown: §a60s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (veinSeeker > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 183), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 183 && mouseX < guiLeft + xStart + 199) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Vein Seeker", + "", + "§6Pickaxe Ability: Vein Seeker", + "§7Points in the direction of the", + "§7nearest vein and grants §a+§a3§7", + "§7§6Mining Spread §7for §a14s§7§7.", + "§8Cooldown: §a60s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + boolean luckofcaveunlocked = (luckofcave > 0); + List<String> luckofcaveTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((luckofcaveunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 90)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 90 && mouseY <= guiTop + yStartTop + 106) { + luckofcaveTooltip = Lists.newArrayList( + (luckofcaveunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Luck of the Cave", + "§7Level " + luckofcave + EnumChatFormatting.DARK_GRAY + "/45", + "", + "§7Increases the chance for you to", + "§7trigger rare occurrences im", + "§2Dwarven Mines by " + EnumChatFormatting.GREEN + luckofcaveStat + "%§7." + ); + Utils.drawHoveringText(luckofcaveTooltip, mouseX, mouseY, width, height, -1, fr); + luckofcaveTooltip = null; + } + } + boolean dailyPowderunlocked = (dailyPowder > 0); + List<String> dailyPowderTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((dailyPowderunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 90)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 90 && mouseY <= guiTop + yStartTop + 106) { + dailyPowderTooltip = Lists.newArrayList( + (dailyPowderunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Daily Powder", + EnumChatFormatting.GRAY + "Level " + dailyPowder + EnumChatFormatting.DARK_GRAY + "/100", + "", + EnumChatFormatting.GRAY + "Gains " + EnumChatFormatting.GREEN + dailyPowderStat + " Powder" + EnumChatFormatting.GRAY + " from the", + EnumChatFormatting.GRAY + "first ore you mine every day.", + EnumChatFormatting.GRAY + "Works for all Powder types." + ); + Utils.drawHoveringText(dailyPowderTooltip, mouseX, mouseY, width, height, -1, fr); + dailyPowderTooltip = null; + } + } + boolean effMinerunlocked = (effMiner > 0); + List<String> effMinerTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((effMinerunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + effMinerTooltip = Lists.newArrayList( + (effMinerunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Efficient Miner", + EnumChatFormatting.GRAY + "Level " + effMiner + EnumChatFormatting.DARK_GRAY + "/100", + "", + EnumChatFormatting.GRAY + "When mining ores, you have a", + EnumChatFormatting.GREEN + "" + effMinerStat + "%" + EnumChatFormatting.GRAY + " chance to mine " + EnumChatFormatting.GREEN + Math.round(effMinerStat2), + EnumChatFormatting.GRAY + "adjacent ores." + ); + Utils.drawHoveringText(effMinerTooltip, mouseX, mouseY, width, height, -1, fr); + effMinerTooltip = null; + } + } + //AAAAAAAAA + //AaaaaaaAaaAaA + //AAAAAA + if (potm == 5) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.redstone_block), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + //Minecraft.getMinecraft().getTextureManager().bindTexture(potmUnlocked); + //Utils.drawTexturedRect(guiLeft + xStart + 255, guiTop + yStartTop + 42, 16, 16, GL11.GL_NEAREST); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot", + "§7§8+§a1 Commission Slot", + "§7§8+§21 Mithril Powder §7when", + "§7mining §fMithril", + "§7§8+§51 Token of the Mountain" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + if (potm == 4) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.redstone_block), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.YELLOW + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot", + "§7§8+§a1 Commission Slot", + "§7§8+§21 Mithril Powder §7when", + "§7mining §fMithril" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + if (potm == 3) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.redstone_block), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.YELLOW + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot", + "§7§8+§a1 Commission Slot" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + if (potm == 2) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.redstone_block), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.YELLOW + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + if (potm == 1) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.redstone_block), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.YELLOW + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + if (potm == 0) { + List<String> potmTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.bedrock), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + potmTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5" + ); + Utils.drawHoveringText(potmTooltip, mouseX, mouseY, width, height, -1, fr); + potmTooltip = null; + } + } + } + //aaaaa + //aaa + boolean moulunlocked = (moul > 0); + List<String> moulTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((moulunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + moulTooltip = Lists.newArrayList( + (moulunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mole", + EnumChatFormatting.GRAY + "Level " + moul + EnumChatFormatting.DARK_GRAY + "/190", + "", + EnumChatFormatting.GRAY + "When mining hard stone, you have", + EnumChatFormatting.GRAY + "a " + EnumChatFormatting.GREEN + output + "% " + EnumChatFormatting.GRAY + "chance to mine " + EnumChatFormatting.GREEN + "", + EnumChatFormatting.GREEN + "" + Math.round(moulStat) + EnumChatFormatting.GRAY + " adjacent hard stone blocks." + ); + Utils.drawHoveringText(moulTooltip, mouseX, mouseY, width, height, -1, fr); + moulTooltip = null; + } + } + boolean powderBuffunlocked = (powderBuff > 0); + List<String> powderBuffTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((powderBuffunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 255), (int) (guiTop + yStartTop - 6)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 255 && mouseX < guiLeft + xStart + 271) { + if (mouseY >= guiTop + yStartTop - 6 && mouseY <= guiTop + yStartTop + 10) { + powderBuffTooltip = Lists.newArrayList( + (powderBuffunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Powder Buff", + EnumChatFormatting.GRAY + "Level " + powderBuff + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Gain " + EnumChatFormatting.GREEN + powderBuff + "% " + EnumChatFormatting.GRAY + "more Mithril", + EnumChatFormatting.GRAY + "Powder and Gemstone Powder§7." + ); + Utils.drawHoveringText(powderBuffTooltip, mouseX, mouseY, width, height, -1, fr); + powderBuffTooltip = null; + } + } + boolean skyMallunlocked = (skyMall > 0); + List<String> skyMallTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((skyMallunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 183), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 183 && mouseX < guiLeft + xStart + 199) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + skyMallTooltip = Lists.newArrayList( + (skyMallunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Sky Mall", + "§7Every SkyBlock day, you receive", + "§7a random buff in the §2Dwarven", + "§2Mines§7.", + "", + "§7Possible Buffs", + "§8 ■ §7Gain §a+100 §6⸕ Mining Speed.", + "§8 ■ §7Gain §a+50 §6☘ Mining Fortune.", + "§8 ■ §7Gain §a+15% §7chance to gain", + " §7extra Powder while mining.", + "§8 ■ §7Reduce Pickaxe Ability cooldown", + " §7by §a20%", "§8 ■ §7§a10x §7chance to find Goblins", + " §7while mining.", + "§8 ■ §7Gain §a5x §9Titanium §7drops." + ); + Utils.drawHoveringText(skyMallTooltip, mouseX, mouseY, width, height, -1, fr); + skyMallTooltip = null; + } + } + boolean goblinKillerunlocked = (goblinKiller > 0); + List<String> goblinKillerTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((goblinKillerunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + goblinKillerTooltip = Lists.newArrayList( + (goblinKillerunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Goblin Killer", + "§7Killing a §6Golden Goblin", + "§6§7gives §2200 §7extra §2Mithril", + "§2Powder§7, while killing other", + "§7Goblins gives some based on", + "§7their wits." + ); + Utils.drawHoveringText(goblinKillerTooltip, mouseX, mouseY, width, height, -1, fr); + goblinKillerTooltip = null; + } + } + boolean seasonMineunlocked = (seasonMine > 0); + List<String> seasonMineTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((seasonMineunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 231), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 231 && mouseX < guiLeft + xStart + 247) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + seasonMineTooltip = Lists.newArrayList( + (seasonMineunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Seasoned Mineman", + "§7Level " + seasonMine + "§8/100", + "", + "§7Increases your Mining", + "§7experience gain by " + EnumChatFormatting.GREEN + seasonMineStat + "%§7." + ); + Utils.drawHoveringText(seasonMineTooltip, mouseX, mouseY, width, height, -1, fr); + seasonMineTooltip = null; + } + } + boolean madMiningunlocked = (madMining > 0); + List<String> madMiningTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((madMiningunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + madMiningTooltip = Lists.newArrayList( + (madMiningunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mining Madness", + "§7Grants §a+50 §6⸕ Mining Speed", + "§7and §6☘ Mining Fortune§7." + ); + Utils.drawHoveringText(madMiningTooltip, mouseX, mouseY, width, height, -1, fr); + madMiningTooltip = null; + } + } + boolean lonesomeMinerunlocked = (lonesomeMiner > 0); + List<String> lonesomeMinerTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((lonesomeMinerunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + lonesomeMinerTooltip = Lists.newArrayList( + (lonesomeMinerunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Lonesome Miner", + "§7Level " + lonesomeMiner + EnumChatFormatting.DARK_GRAY + "/45", + "", + "§7Increases §c❁ Strength, §9☣ Crit", + "§9Chance, §9☠ Crit Damage, §a❈", + "§aDefense, and §c❤ Health", + "§c§7statistics gain by " + EnumChatFormatting.GREEN + lonesomeMinerStat + "%§7", + "§7while in the Crystal Hollows." + ); + Utils.drawHoveringText(lonesomeMinerTooltip, mouseX, mouseY, width, height, -1, fr); + lonesomeMinerTooltip = null; + } + } + boolean professionalunlocked = (professional > 0); + List<String> professionalTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((professionalunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 231), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 231 && mouseX < guiLeft + xStart + 247) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + professionalTooltip = Lists.newArrayList( + (professionalunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Professional", + "§7Level " + professional + EnumChatFormatting.DARK_GRAY + "/140", + "", + "§7Gain §a+" + professionalStat + "§6 ⸕ Mining", + "§6Speed§7 when mining Gemstones." + ); + Utils.drawHoveringText(professionalTooltip, mouseX, mouseY, width, height, -1, fr); + professionalTooltip = null; + } + } + boolean miningSpeed2unlocked = (miningSpeed2 > 0); + List<String> miningSpeed2Tooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((miningSpeed2unlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 207), (int) (guiTop + yStartTop - 6)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 207 && mouseX < guiLeft + xStart + 223) { + if (mouseY >= guiTop + yStartTop - 6 && mouseY <= guiTop + yStartTop + 10) { + miningSpeed2Tooltip = Lists.newArrayList( + (miningSpeed2unlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mining Speed 2", + "§7Level " + miningSpeed2 + EnumChatFormatting.DARK_GRAY + "/50", + "", + "§7Grants " + EnumChatFormatting.GREEN + "+" + miningSpeed2Stat + EnumChatFormatting.GOLD + " ⸕ Mining", + "§6Speed§7." + ); + Utils.drawHoveringText(miningSpeed2Tooltip, mouseX, mouseY, width, height, -1, fr); + miningSpeed2Tooltip = null; + } + } + boolean quickForgeunlocked = (quickForge > 0); + List<String> quickForgeTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((quickForgeunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 279), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 279 && mouseX < guiLeft + xStart + 295) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + quickForgeTooltip = Lists.newArrayList( + (quickForgeunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Quick Forge", + "§7Level " + quickForge + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Decreases the time it takes to", + "§7forge by §a" + quickForgeStat + "%§7." + ); + Utils.drawHoveringText(quickForgeTooltip, mouseX, mouseY, width, height, -1, fr); + quickForgeTooltip = null; + } + } + boolean fortunateunlocked = (fortunate > 0); + List<String> fortunateTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((fortunateunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 279), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 279 && mouseX < guiLeft + xStart + 295) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + fortunateTooltip = Lists.newArrayList( + (fortunateunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Fortunate", + "§7Level " + fortunate + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Gain " + EnumChatFormatting.GREEN + "+" + fortunateStat + " §6☘ Mining", + "§6Fortune§7 when mining Gemstones." + ); + Utils.drawHoveringText(fortunateTooltip, mouseX, mouseY, width, height, -1, fr); + fortunateTooltip = null; + } + } + boolean greatExplorerunlocked = (greatExplorer > 0); + List<String> greatExplorerTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((greatExplorerunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 302), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + greatExplorerTooltip = Lists.newArrayList( + (greatExplorerunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Great Explorer", + "§7Level " + greatExplorer + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Grants " + EnumChatFormatting.GREEN + greatExplorerStat + "% " + EnumChatFormatting.GRAY + "chance to", + "§7find treasure." + ); + Utils.drawHoveringText(greatExplorerTooltip, mouseX, mouseY, width, height, -1, fr); + greatExplorerTooltip = null; + } + } + boolean miningFortune2unlocked = (miningFortune2 > 0); + List<String> miningFortune2Tooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((miningFortune2unlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop - 6)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop - 6 && mouseY <= guiTop + yStartTop + 10) { + miningFortune2Tooltip = Lists.newArrayList( + (miningFortune2unlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Mining Fortune 2", + "§7Level " + miningFortune2 + EnumChatFormatting.DARK_GRAY + "/50", + "", + "§7Grants §a+§a" + miningFortune2Stat + "§7 §6☘ Mining", "§6Fortune§7." + ); + Utils.drawHoveringText(miningFortune2Tooltip, mouseX, mouseY, width, height, -1, fr); + miningFortune2Tooltip = null; + } + } + boolean orbitunlocked = (orbit > 0); + List<String> orbitTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((orbitunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 279), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 279 && mouseX < guiLeft + xStart + 295) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + orbitTooltip = Lists.newArrayList( + (orbitunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Orbiter", + "§7Level " + orbit + EnumChatFormatting.DARK_GRAY + "/80", + "", + "§7When mining ores, you have a", + EnumChatFormatting.GREEN + "" + orbitStat + "%" + EnumChatFormatting.GRAY + " chance to get a random", + "§7amount of experience orbs." + ); + Utils.drawHoveringText(orbitTooltip, mouseX, mouseY, width, height, -1, fr); + orbitTooltip = null; + } + } + boolean frontLoadunlocked = (frontLoad > 0); + List<String> frontLoadTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((frontLoadunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + frontLoadTooltip = Lists.newArrayList( + (frontLoadunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Front Loaded", + "§7Grants §a+100 §6⸕ Mining Speed", + "§7and §6☘ Mining Fortune §7for", + "§7the first §e2,500 §7ores you", + "§7mine in a day." + ); + Utils.drawHoveringText(frontLoadTooltip, mouseX, mouseY, width, height, -1, fr); + frontLoadTooltip = null; + } + } + boolean starPowderunlocked = (starPowder > 0); + List<String> starPowderTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((starPowderunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 42)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 42 && mouseY <= guiTop + yStartTop + 58) { + starPowderTooltip = Lists.newArrayList( + (starPowderunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Star Powder", + "§7Mining Mithril Ore near §5Fallen", + "§5Crystals §7gives §a+3 §7extra", + "§7Mithril Powder§7." + ); + Utils.drawHoveringText(starPowderTooltip, mouseX, mouseY, width, height, -1, fr); + starPowderTooltip = null; + } + } + boolean fortniteunlocked = (fortnite > 0); + List<String> fortniteTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((fortniteunlocked ? Items.diamond : Items.coal)), (int) (guiLeft + xStart + 327), (int) (guiTop + yStartTop + 66)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 327 && mouseX < guiLeft + xStart + 343) { + if (mouseY >= guiTop + yStartTop + 66 && mouseY <= guiTop + yStartTop + 82) { + fortniteTooltip = Lists.newArrayList( + (fortniteunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Precision Mining", + "§7When mining ore, a particle", + "§7target appears on the block that", + "§7increases your §6⸕ Mining Speed", + "§7by §a30% §7when aiming at it." + ); + Utils.drawHoveringText(fortniteTooltip, mouseX, mouseY, width, height, -1, fr); + fortniteTooltip = null; + } + } + boolean crystallizedunlocked = (crystallized > 0); + List<String> crystallizedTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack((crystallizedunlocked ? Items.emerald : Items.coal)), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 90)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 90 && mouseY <= guiTop + yStartTop + 106) { + crystallizedTooltip = Lists.newArrayList( + (crystallizedunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Crystallized", + "§7Level " + crystallized + EnumChatFormatting.DARK_GRAY + "/30", + "", + "§7Grants §a+§a" + crystallizedStat + "§7 §6⸕ Mining", + "§6Speed §7and a §a" + crystallizedStat + "%§7 §7chance", + "§7to deal §a+1 §7extra damage near", + "§7§5Fallen Stars§7." + ); + Utils.drawHoveringText(crystallizedTooltip, mouseX, mouseY, width, height, -1, fr); + crystallizedTooltip = null; + } + } + if (pickoblus == 0) { + if (potm == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + (miningSpeedunlocked ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + "Pickobulus", + "", + "§6Pickaxe Ability: Pickobulus", + "§7Throw your pickaxe to create an", + "§7explosion on impact, mining all", + "§7ores within a §a2§7 block", + "§7radius.", + "§8Cooldown: §a120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (potm > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Pickobulus", + "", + "§6Pickaxe Ability: Pickobulus", + "§7Throw your pickaxe to create an", + "§7explosion on impact, mining all", + "§7ores within a §a2§7 block", + "§7radius.", + "§8Cooldown: §a110s" + + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + } + if (pickoblus > 0) { + if (potm == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Pickobulus", + "", + "§6Pickaxe Ability: Pickobulus", + "§7Throw your pickaxe to create an", + "§7explosion on impact, mining all", + "§7ores within a §a2§7 block", + "§7radius.", + "§8Cooldown: §a120s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (potm > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 303), (int) (guiTop + yStartTop + 114)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 303 && mouseX < guiLeft + xStart + 319) { + if (mouseY >= guiTop + yStartTop + 114 && mouseY <= guiTop + yStartTop + 130) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Pickobulus", + "", + "§6Pickaxe Ability: Pickobulus", + "§7Throw your pickaxe to create an", + "§7explosion on impact, mining all", + "§7ores within a §a2§7 block", + "§7radius.", + "§8Cooldown: §a110s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + } + if (maniacMiner == 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.coal_block), (int) (guiLeft + xStart + 327), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 327 && mouseX < guiLeft + xStart + 343) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.RED + "Maniac Miner", + "", + "§6Pickaxe Ability: Maniac Miner", + "§7Spends all your Mana and grants", + "§7§a+1 §6⸕ Mining Speed §7for", + "§7every 10 Mana spent, for", + "§7§a§a15s§7§7.", + "§8Cooldown: §a59s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + if (maniacMiner > 0) { + List<String> mngspeedBoostTooltip = null; + GlStateManager.color(1, 1, 1, 1); + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.emerald_block), (int) (guiLeft + xStart + 327), (int) (guiTop + yStartTop + 18)); + GlStateManager.enableLighting(); + if (mouseX >= guiLeft + xStart + 327 && mouseX < guiLeft + xStart + 343) { + if (mouseY >= guiTop + yStartTop + 18 && mouseY <= guiTop + yStartTop + 34) { + mngspeedBoostTooltip = Lists.newArrayList( + EnumChatFormatting.GREEN + "Maniac Miner", + "", + "§6Pickaxe Ability: Maniac Miner", + "§7Spends all your Mana and grants", + "§7§a+1 §6⸕ Mining Speed §7for", + "§7every 10 Mana spent, for", + "§7§a§a15s§7§7.", + "§8Cooldown: §a59s" + ); + Utils.drawHoveringText(mngspeedBoostTooltip, mouseX, mouseY, width, height, -1, fr); + mngspeedBoostTooltip = null; + } + } + } + } + + private String getTimeSinceString(JsonObject profileInfo, String path) { JsonElement lastSaveElement = Utils.getElement(profileInfo, path); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index 1de24257..de6dc467 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -692,6 +692,7 @@ public class ProfileViewer { float experience_skill_fishing = Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_fishing"), 0); float experience_skill_alchemy = Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_alchemy"), 0); float experience_skill_runecrafting = Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_runecrafting"), 0); + float experience_skill_hotm = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.experience"), 0); float experience_skill_catacombs = Utils.getElementAsFloat(Utils.getElement(profileInfo, "dungeons.dungeon_types.catacombs.experience"), 0); @@ -721,6 +722,7 @@ public class ProfileViewer { skillInfo.addProperty("experience_skill_fishing", experience_skill_fishing); skillInfo.addProperty("experience_skill_alchemy", experience_skill_alchemy); skillInfo.addProperty("experience_skill_runecrafting", experience_skill_runecrafting); + skillInfo.addProperty("experience_skill_hotm", experience_skill_hotm); skillInfo.addProperty("experience_skill_catacombs", experience_skill_catacombs); @@ -741,9 +743,9 @@ public class ProfileViewer { Level level_skill_combat = getLevel(levelingArray, experience_skill_combat, getCap(leveling, "combat"), false); Level level_skill_fishing = getLevel(levelingArray, experience_skill_fishing, getCap(leveling, "fishing"), false); Level level_skill_alchemy = getLevel(levelingArray, experience_skill_alchemy, getCap(leveling, "alchemy"), false); + Level level_skill_hotm = getLevel(levelingArray, experience_skill_hotm, getCap(leveling, "HOTM"), false); Level level_skill_runecrafting = getLevel(Utils.getElement(leveling, "runecrafting_xp").getAsJsonArray(), experience_skill_runecrafting, getCap(leveling, "runecrafting"), false); - Level level_skill_catacombs = getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), experience_skill_catacombs, getCap(leveling, "catacombs"), false); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java index 5a3e55aa..8b9376f4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java @@ -32,6 +32,7 @@ public class GuiTextures { public static final ResourceLocation item_mask = new ResourceLocation("notenoughupdates:item_mask.png"); public static final ResourceLocation item_haschild = new ResourceLocation("notenoughupdates:item_haschild.png"); public static final ResourceLocation button_tex = new ResourceLocation("notenoughupdates:button.png"); + public static final ResourceLocation button_fsr = new ResourceLocation("notenoughupdates:FSR_do_not_texture_this_please.png"); public static final ResourceLocation setting_border = new ResourceLocation("notenoughupdates:setting_border.png"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index 0845c7f6..b965c0c4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -455,21 +455,22 @@ public class Utils { return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase(); } - public static String[] rarityArr = new String[]{ - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME", "DIVINE" + public static String[] rarityArr = new String[] { + "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", "SUPREME", "^^ THAT ONE IS DIVINE ^^"//, "DIVINE" }; - public static String[] rarityArrC = new String[]{ - EnumChatFormatting.WHITE + EnumChatFormatting.BOLD.toString() + "COMMON", - EnumChatFormatting.GREEN + EnumChatFormatting.BOLD.toString() + "UNCOMMON", - EnumChatFormatting.BLUE + EnumChatFormatting.BOLD.toString() + "RARE", - EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD.toString() + "EPIC", - EnumChatFormatting.GOLD + EnumChatFormatting.BOLD.toString() + "LEGENDARY", - EnumChatFormatting.LIGHT_PURPLE + EnumChatFormatting.BOLD.toString() + "MYTHIC", - EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "SPECIAL", - EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "VERY SPECIAL", - EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD.toString() + "SUPREME", - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD.toString() + "DIVINE", + public static String[] rarityArrC = new String[] { + EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", + EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", + EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", + EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", + EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", + EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", + EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", + EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", + EnumChatFormatting.AQUA+EnumChatFormatting.BOLD.toString()+"DIVINE", + EnumChatFormatting.AQUA+EnumChatFormatting.BOLD.toString()+"DIVINE", + //EnumChatFormatting.AQUA+EnumChatFormatting.BOLD.toString()+"DIVINE", }; public static final HashMap<String, String> rarityArrMap = new HashMap<>(); @@ -483,8 +484,8 @@ public class Utils { rarityArrMap.put("MYTHIC", rarityArrC[5]); rarityArrMap.put("SPECIAL", rarityArrC[6]); rarityArrMap.put("VERY SPECIAL", rarityArrC[7]); - rarityArrMap.put("SUPREME", rarityArrC[8]); - rarityArrMap.put("DIVINE", rarityArrC[9]); + rarityArrMap.put("DIVINE", rarityArrC[8]); + //rarityArrMap.put("DIVINE", rarityArrC[9]); } @@ -1033,6 +1034,14 @@ public class Utils { return prim.getAsFloat(); } + public static int getElementAsInt(JsonElement element, int def) { + if (element == null) return def; + if (!element.isJsonPrimitive()) return def; + JsonPrimitive prim = element.getAsJsonPrimitive(); + if (!prim.isNumber()) return def; + return prim.getAsInt(); + } + public static String getElementAsString(JsonElement element, String def) { if (element == null) return def; if (!element.isJsonPrimitive()) return def; diff --git a/src/main/resources/assets/notenoughupdates/FSR_do_not_texture_this_please.png b/src/main/resources/assets/notenoughupdates/FSR_do_not_texture_this_please.png Binary files differnew file mode 100644 index 00000000..6c001940 --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/FSR_do_not_texture_this_please.png diff --git a/src/main/resources/assets/notenoughupdates/capes/dg.png b/src/main/resources/assets/notenoughupdates/capes/dg.png Binary files differnew file mode 100644 index 00000000..8625fbfc --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/capes/dg.png diff --git a/src/main/resources/assets/notenoughupdates/capes/dg_preview.png b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png Binary files differnew file mode 100644 index 00000000..0ef73797 --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png diff --git a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png Binary files differindex 2b152b15..d65f8fbe 100644 --- a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png +++ b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png diff --git a/src/main/resources/assets/notenoughupdates/capes/space.png b/src/main/resources/assets/notenoughupdates/capes/space.png Binary files differindex ba239e22..76d4a42c 100644 --- a/src/main/resources/assets/notenoughupdates/capes/space.png +++ b/src/main/resources/assets/notenoughupdates/capes/space.png diff --git a/src/main/resources/assets/notenoughupdates/pv_mining.png b/src/main/resources/assets/notenoughupdates/pv_mining.png Binary files differnew file mode 100644 index 00000000..a0f99931 --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/pv_mining.png diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png Binary files differindex 8e435046..be569369 100644 --- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png +++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png |