From dd91ed7db4a4323126a04ac88bd8a4c6d6c9c82d Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:29:58 +0000 Subject: Added Highest Wave completed to Kuudra stats in pv (#489) --- .../profileviewer/CrimsonIslePage.java | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java index f9d91935..87548f5e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java @@ -32,6 +32,7 @@ import org.lwjgl.opengl.GL11; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.LinkedHashMap; @@ -129,7 +130,7 @@ public class CrimsonIslePage extends GuiProfileViewerPage { drawDojoStats(netherIslandPlayerData, guiLeft, guiTop); // Kuudra stats - drawKuudraStats(netherIslandPlayerData, guiLeft, guiTop); + drawKuudraStats(netherIslandPlayerData, guiLeft, guiTop, mouseX, mouseY); // Last matriarch attempt drawLastMatriarchAttempt(netherIslandPlayerData, guiLeft, guiTop); @@ -138,7 +139,7 @@ public class CrimsonIslePage extends GuiProfileViewerPage { drawFactionReputation(netherIslandPlayerData, guiLeft, guiTop); } - public void drawKuudraStats(JsonObject data, int guiLeft, int guiTop) { + public void drawKuudraStats(JsonObject data, int guiLeft, int guiTop, int mouseX, int mouseY) { Utils.drawStringCentered( EnumChatFormatting.RED + "Kuudra Stats", Minecraft.getMinecraft().fontRendererObj, @@ -161,26 +162,48 @@ public class CrimsonIslePage extends GuiProfileViewerPage { int completions = kuudraCompletedTiers.has(kuudraTiers[i]) ? kuudraCompletedTiers.get(kuudraTiers[i]).getAsInt() : 0; + // Get the highest wave for this tier of kuudra if they have completed a run + // since infernal kuudra was released + int highestWaveCompleted = kuudraCompletedTiers.has("highest_wave_" + kuudraTiers[i]) ? + kuudraCompletedTiers.get("highest_wave_" + kuudraTiers[i]).getAsInt() : 0; + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI( KUUDRA_KEYS[i], guiLeft + 8, - guiTop + 25 + (i * 12) + guiTop + 30 + (i * 30) ); Utils.renderAlignedString( EnumChatFormatting.RED + KUUDRA_TIERS[i] + ": ", EnumChatFormatting.WHITE + String.valueOf(completions), guiLeft + 23, - guiTop + 30 + (i * 12), + guiTop + 30 + (i * 30), + 110 + ); + + Utils.renderAlignedString( + EnumChatFormatting.RED + "Highest Wave: ", + EnumChatFormatting.WHITE + (highestWaveCompleted != 0 ? String.valueOf(highestWaveCompleted) : "N/A"), + guiLeft + 23, + guiTop + 42 + (i * 30), 110 ); + + if (highestWaveCompleted == 0) { + if (mouseX > guiLeft + 23 && mouseX < guiLeft + 133 && mouseY < guiTop + 50 + (i*30) && mouseY > guiTop + 42 + (i*30)) { + getInstance().tooltipToDisplay = new ArrayList<>(); + getInstance().tooltipToDisplay.add(EnumChatFormatting.RED + "N/A will only show for highest wave"); + getInstance().tooltipToDisplay.add(EnumChatFormatting.RED + "if you have not completed a run for"); + getInstance().tooltipToDisplay.add(EnumChatFormatting.RED + "this tier since Infernal tier was released."); + } + } } Utils.renderAlignedString( - EnumChatFormatting.RED + "Total: ", + EnumChatFormatting.RED + "Total runs: ", EnumChatFormatting.WHITE + String.valueOf(getTotalKuudraRuns(kuudraCompletedTiers)), guiLeft + 23, - guiTop + 40 + (5 * 12), + guiTop + 30 + (5 * 30), 110 ); } -- cgit From 21fa3b25bd2956e5fec89c508bf8ed61fc5cdc06 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:13:22 +1100 Subject: Fix open in skycrypt button not working on linux with some jdks (#490) --- .../commands/help/FeaturesCommand.java | 17 +++++---------- .../notenoughupdates/options/NEUConfigEditor.java | 7 +----- .../profileviewer/GuiProfileViewer.java | 25 +++++----------------- .../moulberry/notenoughupdates/util/Utils.java | 20 +++++++++++++++++ 4 files changed, 31 insertions(+), 38 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java index bc389ad4..bbabc172 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java @@ -29,11 +29,6 @@ import net.minecraft.event.ClickEvent; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; -import java.awt.*; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - public class FeaturesCommand extends ClientCommandBase { public FeaturesCommand() { super("neufeatures"); @@ -48,13 +43,11 @@ public class FeaturesCommand extends ClientCommandBase { } String url = Constants.MISC.get("featureslist").getAsString(); - Desktop desk = Desktop.getDesktop(); - try { - desk.browse(new URI(url)); - Utils.addChatMessage( EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + - EnumChatFormatting.GOLD + "> Opening Feature List in browser."); - } catch (URISyntaxException | IOException ignored) { - + if (Utils.openUrl(url)) { + Utils.addChatMessage( + EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + + EnumChatFormatting.GOLD + "> Opening Feature List in browser."); + } else { ChatComponentText clickTextFeatures = new ChatComponentText( EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "> Click here to open the Feature List in your browser."); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java index e3881f44..fe1f0af4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java @@ -44,8 +44,6 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -import java.awt.*; -import java.net.URI; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -737,10 +735,7 @@ public class NEUConfigEditor extends GuiElement { if (mouseX >= socialLeft && mouseX <= socialLeft + 16 && mouseY >= y + 6 && mouseY <= y + 23) { - try { - Desktop.getDesktop().browse(new URI(socialsLink[socialIndex])); - } catch (Exception ignored) { - } + Utils.openUrl(socialsLink[socialIndex]); return true; } } 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 63717093..4bf65cc6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -20,19 +20,16 @@ package io.github.moulberry.notenoughupdates.profileviewer; import com.google.gson.JsonArray; -import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.cosmetics.ShaderManager; import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField; -import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.profileviewer.bestiary.BestiaryPage; import io.github.moulberry.notenoughupdates.profileviewer.trophy.TrophyFishPage; import io.github.moulberry.notenoughupdates.profileviewer.weight.weight.DungeonsWeight; import io.github.moulberry.notenoughupdates.profileviewer.weight.weight.SkillsWeight; import io.github.moulberry.notenoughupdates.util.AsyncDependencyLoader; -import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.PronounDB; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -58,8 +55,6 @@ import org.lwjgl.opengl.GL20; import java.awt.*; import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; @@ -843,21 +838,11 @@ public class GuiProfileViewer extends GuiScreen { profileId != null ) { if (mouseY > guiTop + sizeY + 3 && mouseY < guiTop + sizeY + 23) { - try { - Desktop desk = Desktop.getDesktop(); - desk.browse( - new URI( - "https://sky.shiiyu.moe/stats/" + profile.getHypixelProfile().get("displayname").getAsString() + "/" + - profileId - ) - ); - Utils.playPressSound(); - return; - } catch (UnsupportedOperationException | IOException | URISyntaxException ignored) { - //no idea how this sounds, but ya know just in case - Utils.playSound(new ResourceLocation("game.player.hurt"), true); - return; - } + String url = "https://sky.shiiyu.moe/stats/" + profile.getHypixelProfile().get("displayname").getAsString() + "/" + + profileId; + Utils.openUrl(url); + Utils.playPressSound(); + return; } } 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 a3f2296c..0ea1dafb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -71,10 +71,13 @@ import java.awt.*; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigInteger; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.FloatBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -2037,4 +2040,21 @@ public class Utils { System.out.println(message); } } + + public static boolean openUrl(String url) { + try { + Desktop desk = Desktop.getDesktop(); + desk.browse(new URI(url)); + return true; + } catch (UnsupportedOperationException | IOException | URISyntaxException ignored) { + Runtime runtime = Runtime.getRuntime(); + try { + runtime.exec("xdg-open " + url); + return true; + } catch (IOException e) { + Utils.playSound(new ResourceLocation("game.player.hurt"), true); + return false; + } + } + } } -- cgit From c6330fc85211706ee6a3c212bfa50005981e3799 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sun, 18 Dec 2022 22:34:08 +0100 Subject: Sh (#496) --- .../io/github/moulberry/notenoughupdates/listener/RenderListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index e1fb8586..f15a26a7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -965,7 +965,7 @@ public class RenderListener { mayor.getAsJsonObject().get("name").getAsString().equals("Derpy") && NotEnoughUpdates.INSTANCE.config.dungeons.shouldWarningDerpy) { Utils.drawStringScaled( - EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "shMayor Derpy active!", + EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "Mayor Derpy active!", Minecraft.getMinecraft().fontRendererObj, guiLeft + xSize + 4 + 10, guiTop + 85, -- cgit From 4a9e1c462e4bc757c00813bab1944d42fc479d0e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Thu, 22 Dec 2022 07:22:06 +1100 Subject: Added essence shop tooltip to pv (#488) --- .../notenoughupdates/profileviewer/ExtraPage.java | 25 ++++++++++++++++++++-- .../moulberry/notenoughupdates/util/Constants.java | 2 ++ 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 21ccc683..5f477196 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -39,6 +39,7 @@ import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -108,7 +109,9 @@ public class ExtraPage extends GuiProfileViewerPage { float xStart, float yStartTop, float xOffset, - float yOffset + float yOffset, + float mouseX, + float mouseY ) { int guiLeft = GuiProfileViewer.getGuiLeft(); int guiTop = GuiProfileViewer.getGuiTop(); @@ -143,6 +146,24 @@ public class ExtraPage extends GuiProfileViewerPage { guiTop + yStartTop + (yOffset - 1) * i, 76 ); + if (Constants.ESSENCESHOPS == null) return; + JsonObject essenceShops = Constants.ESSENCESHOPS; + if (mouseX >= guiLeft + xStart + xOffset && mouseX <= guiLeft + xStart + xOffset + 76 && + mouseY >= guiTop + yStartTop + (yOffset - 1) * i && + mouseY <= guiTop + yStartTop + (yOffset - 1) * i + 10) { + getInstance().tooltipToDisplay = new ArrayList<>(); + if (essenceShops.get(essenceName) == null) continue; + + for (Map.Entry entry : essenceShops.get(essenceName).getAsJsonObject().entrySet()) { + int perkTier = + (profileInfo.has("perks") && profileInfo.get("perks").getAsJsonObject().has(entry.getKey()) ? profileInfo.get("perks").getAsJsonObject().get(entry.getKey()).getAsInt() : 0); + getInstance().tooltipToDisplay.add( + EnumChatFormatting.GOLD + entry.getValue().getAsJsonObject().get("name").getAsString() + ": " + EnumChatFormatting.AQUA + + perkTier + "/" + entry.getValue().getAsJsonObject().get("costs").getAsJsonArray().size() + ); + } + + } } } @@ -414,7 +435,7 @@ public class ExtraPage extends GuiProfileViewerPage { 76 ); - drawEssence(profileInfo, xStart, yStartTop, xOffset, yOffset); + drawEssence(profileInfo, xStart, yStartTop, xOffset, yOffset, mouseX, mouseY); if (topKills == null) { topKills = new TreeMap<>(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java index e7674aa9..0105ba1f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java @@ -77,6 +77,7 @@ public class Constants { public static JsonObject WEIGHT; public static JsonObject RNGSCORE; public static JsonObject ABIPHONE; + public static JsonObject ESSENCESHOPS; private static final ReentrantLock lock = new ReentrantLock(); @@ -100,6 +101,7 @@ public class Constants { WEIGHT = Utils.getConstant("weight", gson); RNGSCORE = Utils.getConstant("rngscore", gson); ABIPHONE = Utils.getConstant("abiphone", gson); + ESSENCESHOPS = Utils.getConstant("essenceshops", gson); parseEssenceCosts(); } catch (Exception ex) { -- cgit From 2bb3cb42e890a80205928d19fef6538860f142fe Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:36:42 +0100 Subject: Merge pull request #502 * maxed stats are green --- .../notenoughupdates/profileviewer/ExtraPage.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 5f477196..4c58e57a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -156,11 +156,15 @@ public class ExtraPage extends GuiProfileViewerPage { for (Map.Entry entry : essenceShops.get(essenceName).getAsJsonObject().entrySet()) { int perkTier = - (profileInfo.has("perks") && profileInfo.get("perks").getAsJsonObject().has(entry.getKey()) ? profileInfo.get("perks").getAsJsonObject().get(entry.getKey()).getAsInt() : 0); - getInstance().tooltipToDisplay.add( - EnumChatFormatting.GOLD + entry.getValue().getAsJsonObject().get("name").getAsString() + ": " + EnumChatFormatting.AQUA + - perkTier + "/" + entry.getValue().getAsJsonObject().get("costs").getAsJsonArray().size() - ); + (profileInfo.has("perks") && profileInfo.get("perks").getAsJsonObject().has(entry.getKey()) ? profileInfo + .get("perks") + .getAsJsonObject() + .get(entry.getKey()) + .getAsInt() : 0); + int max = entry.getValue().getAsJsonObject().get("costs").getAsJsonArray().size(); + EnumChatFormatting formatting = perkTier == max ? EnumChatFormatting.GREEN : EnumChatFormatting.AQUA; + String name = entry.getValue().getAsJsonObject().get("name").getAsString(); + getInstance().tooltipToDisplay.add(EnumChatFormatting.GOLD + name + ": " + formatting + perkTier + "/" + max); } } -- cgit From a9c58929460830662f28a2ebb5b3d09c687bd21d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:38:21 +0100 Subject: Merge pull request #501 * ArrayIndexOutOfBoundsException * just change the condition to >= instead of == --- .../notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java index d3b9c04d..ef2a52bb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java @@ -118,6 +118,7 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { int i = 0; int yOff = 0; for (int strIndex : activeText) { + if (strIndex >= exampleText.length) continue; String str = exampleText[strIndex]; String[] multilines = str.split("\n"); -- cgit From a7a2293d000a0ff16ddd2413989801a63868da52 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:25:00 +0100 Subject: [TRIVIAL] "Fixed" smallest neu bug in history (#505) (wanna know what else is small) --- .../io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java index e4b4269d..aa977413 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @@ -232,7 +232,7 @@ public class GuiItemRecipe extends GuiScreen { int row = i / hotbarSize; int col = i % hotbarSize; if (row == 0) - slots.add(new RecipeSlot(HOTBAR_SLOT_X + i * SLOT_SPACING, HOTBAR_SLOT_Y, item)); + slots.add(new RecipeSlot(HOTBAR_SLOT_X + i * SLOT_SPACING, HOTBAR_SLOT_Y + 1, item)); else slots.add(new RecipeSlot( PLAYER_INVENTORY_X + col * SLOT_SPACING, -- cgit From 7535b1f9c24d56522fd9526a8b9ad8940d130995 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Fri, 23 Dec 2022 17:27:23 +0100 Subject: RepoEditing: Allow opening files in the external editor (#487) --- .../moulberry/notenoughupdates/NEUManager.java | 8 ++++-- .../moulberry/notenoughupdates/NEUOverlay.java | 29 ++++++++++++++++++++-- .../commands/dev/DevTestCommand.java | 13 +++++++--- .../notenoughupdates/options/NEUConfig.java | 3 +++ .../notenoughupdates/overlays/TimersOverlay.java | 1 + 5 files changed, 47 insertions(+), 7 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index ca0d91d2..ce15b09a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -288,7 +288,7 @@ public class NEUManager { public void loadItem(String internalName) { itemstackCache.remove(internalName); try { - JsonObject json = getJsonFromFile(new File(new File(repoLocation, "items"), internalName + ".json")); + JsonObject json = getJsonFromFile(getItemFileForInternalName(internalName)); if (json == null) { return; } @@ -971,6 +971,10 @@ public class NEUManager { return getUUIDFromNBT(tag); } + public File getItemFileForInternalName(String internalName) { + return new File(new File(repoLocation, "items"), internalName + ".json"); + } + public void writeItemToFile(ItemStack stack) { String internalname = getInternalNameForItem(stack); @@ -984,7 +988,7 @@ public class NEUManager { json.addProperty("modver", NotEnoughUpdates.VERSION); try { - writeJson(json, new File(new File(repoLocation, "items"), internalname + ".json")); + writeJson(json, getItemFileForInternalName(internalname)); } catch (IOException ignored) { } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index cff83cca..686f6a27 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -46,6 +46,7 @@ import io.github.moulberry.notenoughupdates.util.LerpingFloat; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; +import lombok.var; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -84,8 +85,10 @@ import org.lwjgl.opengl.GL14; import org.lwjgl.util.vector.Vector2f; import java.awt.*; +import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -1156,8 +1159,30 @@ public class NEUOverlay extends Gui { manager.jsonToStack(item)); } } else if (NotEnoughUpdates.INSTANCE.config.apiData.repositoryEditing && - Keyboard.getEventCharacter() == 'k') { - Minecraft.getMinecraft().displayGuiScreen(new NEUItemEditor(internalname.get(), item)); + keyPressed == Keyboard.KEY_K) { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + var externalEditorCommand = NotEnoughUpdates.INSTANCE.config.hidden.externalEditor; + if (externalEditorCommand == null) { + Utils.addChatMessage( + "§e[NEU] §3No external editor set! Run §b/neudevtest exteditor §3 " + + "to set your external editor. Optionally use {} as a placeholder for the filename."); + } else { + var externalFileName = manager.getItemFileForInternalName(internalname.get()).getAbsolutePath(); + if (externalEditorCommand.contains("{}")) { + externalEditorCommand = externalEditorCommand.replace("{}", externalFileName); + } else { + externalEditorCommand += " " + externalFileName; + } + try { + Runtime.getRuntime().exec(externalEditorCommand); + } catch (IOException e) { + Utils.addChatMessage("§e[NEU]§4 Could not open external editor."); + e.printStackTrace(); + } + } + } else { + Minecraft.getMinecraft().displayGuiScreen(new NEUItemEditor(internalname.get(), item)); + } return true; } else if (keyPressed == manager.keybindItemSelect.getKeyCode() && NotEnoughUpdates.INSTANCE.config.toolbar.searchBar) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index 69033345..cf266dca 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -19,20 +19,17 @@ package io.github.moulberry.notenoughupdates.commands.dev; -import com.google.gson.Gson; import io.github.moulberry.notenoughupdates.BuildFlags; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.commands.ClientCommandBase; import io.github.moulberry.notenoughupdates.core.config.GuiPositionEditor; import io.github.moulberry.notenoughupdates.core.util.MiscUtils; import io.github.moulberry.notenoughupdates.miscfeatures.FishingHelper; -import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.SpecialBlockZone; import io.github.moulberry.notenoughupdates.miscgui.GuiPriceGraph; import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager; -import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.PronounDB; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.TabListUtils; @@ -142,6 +139,16 @@ public class DevTestCommand extends ClientCommandBase { .collect(Collectors.joining("\n")))); return; } + if (args.length >= 1 && args[0].equalsIgnoreCase("exteditor")) { + if (args.length > 1) { + NotEnoughUpdates.INSTANCE.config.hidden.externalEditor = String.join( + " ", + Arrays.copyOfRange(args, 1, args.length) + ); + } + Utils.addChatMessage("§e[NEU] §fYour external editor is: §Z" + NotEnoughUpdates.INSTANCE.config.hidden.externalEditor); + return; + } if (args.length >= 1 && args[0].equalsIgnoreCase("pricetest")) { if (args.length == 1) { NotEnoughUpdates.INSTANCE.manager.auctionManager.updateBazaar(); 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 f936ceb1..b5237a46 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -456,6 +456,9 @@ public class NEUConfig extends Config { @Expose public boolean hasOpenedWaypointMenu = false; + @Expose + public String externalEditor = null; + } public static ArrayList createDefaultEnchantColours() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java index 7edbee6b..8db06651 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -357,6 +357,7 @@ public class TimersOverlay extends TextTabOverlay { String clean = line.replaceAll("(\u00a7.)", ""); String[] cleanSplit = clean.split(" "); hidden.cookieBuffRemaining = 0; + if (line.contains("Not")) break; for (int i = 0; i + 1 < cleanSplit.length; i++) { if (i % 2 == 1) continue; -- cgit From df8663e5958fe43d0c68fde3f4d31e45b2f15da1 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 24 Dec 2022 03:48:50 +1100 Subject: Gui element scale (#485) --- .../core/config/gui/GuiPositionEditor.java | 36 +++++++++++----------- .../miscfeatures/PetInfoOverlay.java | 8 +++-- .../options/seperateSections/LocationEdit.java | 12 ++++++++ .../notenoughupdates/overlays/FuelBar.java | 5 ++- .../notenoughupdates/overlays/TextOverlay.java | 22 +++++++++---- 5 files changed, 55 insertions(+), 28 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java index 6fb8f353..1b71e3ce 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java @@ -19,6 +19,7 @@ package io.github.moulberry.notenoughupdates.core.config.gui; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; @@ -27,6 +28,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -45,10 +47,9 @@ public class GuiPositionEditor extends GuiScreen { private int grabbedX = 0; private int grabbedY = 0; private int clickedPos = -1; - + private int oldGuiScale = -1; public static boolean renderDrill = false; - private int guiScaleOverride = -1; public GuiPositionEditor( LinkedHashMap overlayPositions, @@ -83,6 +84,16 @@ public class GuiPositionEditor extends GuiScreen { this.elementHeights = height; this.positionChangedCallback = positionChangedCallback; this.closedCallback = closedCallback; + int newGuiScale = NotEnoughUpdates.INSTANCE.config.locationedit.guiScale; + if (newGuiScale != 0) { + if (Minecraft.getMinecraft().gameSettings.guiScale != 0) { + this.oldGuiScale = Minecraft.getMinecraft().gameSettings.guiScale; + } else { + this.oldGuiScale = 4; + } + if (newGuiScale == 4) Minecraft.getMinecraft().gameSettings.guiScale = 0; + else Minecraft.getMinecraft().gameSettings.guiScale = NotEnoughUpdates.INSTANCE.config.locationedit.guiScale; + } } @Override @@ -91,17 +102,14 @@ public class GuiPositionEditor extends GuiScreen { closedCallback.run(); renderDrill = false; clickedPos = -1; + if (this.oldGuiScale != -1) Minecraft.getMinecraft().gameSettings.guiScale = this.oldGuiScale; } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); - ScaledResolution scaledResolution; - if (guiScaleOverride >= 0) { - scaledResolution = Utils.pushGuiScale(guiScaleOverride); - } else { - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - } + GlStateManager.pushMatrix(); + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); this.width = scaledResolution.getScaledWidth(); this.height = scaledResolution.getScaledHeight(); @@ -127,9 +135,6 @@ public class GuiPositionEditor extends GuiScreen { if (position.isCenterY()) y -= elementHeight / 2; Gui.drawRect(x, y, x + elementWidth, y + elementHeight, 0x80404040); - Utils.pushGuiScale(-1); - - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); Utils.drawStringCentered("Position Editor", Minecraft.getMinecraft().fontRendererObj, scaledResolution.getScaledWidth() / 2, 8, true, 0xffffff ); @@ -137,6 +142,7 @@ public class GuiPositionEditor extends GuiScreen { scaledResolution.getScaledWidth() / 2, 18, true, 0xffffff ); } + GlStateManager.popMatrix(); } @Override @@ -144,12 +150,7 @@ public class GuiPositionEditor extends GuiScreen { super.mouseClicked(mouseX, mouseY, mouseButton); if (mouseButton == 0) { - ScaledResolution scaledResolution; - if (guiScaleOverride >= 0) { - scaledResolution = Utils.pushGuiScale(guiScaleOverride); - } else { - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - } + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; for (int i = positions.size() - 1; i >= 0; i--) { @@ -171,7 +172,6 @@ public class GuiPositionEditor extends GuiScreen { } } - Utils.pushGuiScale(-1); } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java index 61ebf7b5..13179179 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -661,7 +661,7 @@ public class PetInfoOverlay extends TextOverlay { JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ROCK;0"); if (petItem != null) { - Vector2f position = getPosition(overlayWidth, overlayHeight); + Vector2f position = getPosition(overlayWidth, overlayHeight, false); int x = (int) position.x; int y = (int) position.y; @@ -700,16 +700,18 @@ public class PetInfoOverlay extends TextOverlay { } if (petItem != null) { - Vector2f position = getPosition(overlayWidth, overlayHeight); + Vector2f position = getPosition(overlayWidth, overlayHeight, true); int x = (int) position.x; int y = (int) position.y; ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem); GlStateManager.enableDepth(); GlStateManager.pushMatrix(); + Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale); GlStateManager.translate(x - 2, y - 2, 0); GlStateManager.scale(2, 2, 1); Utils.drawItemStack(stack, 0, 0); + Utils.pushGuiScale(0); GlStateManager.popMatrix(); } @@ -718,7 +720,7 @@ public class PetInfoOverlay extends TextOverlay { JsonObject petItem2 = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( currentPet2.skin != null ? currentPet2.skin : (currentPet2.petType + ";" + currentPet2.rarity.petId)); if (petItem2 != null) { - Vector2f position = getPosition(overlayWidth, overlayHeight); + Vector2f position = getPosition(overlayWidth, overlayHeight, false); int x = (int) position.x; int y = (int) position.y + NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayText.size() * 10 + 10; 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 index fdfb6f93..52fd0c4a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java @@ -19,10 +19,12 @@ 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.ConfigEditorAccordion; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorButton; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorDropdown; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; public class LocationEdit { @@ -37,6 +39,16 @@ public class LocationEdit { ) public Position positions = new Position(-1, -1); + @Expose + @ConfigOption( + name = "Edit Gui Scale", + desc = "Change the size of NEU's overlays" + ) + @ConfigEditorDropdown( + values = {"Default", "Small", "Normal", "Large", "Auto"} + ) + public int guiScale = 0; + @ConfigOption( name = "Edit Dungeon Map", desc = "The NEU dungeon map has it's own editor (/neumap).\n" + diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java index a70035f1..f2e485f2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java @@ -100,7 +100,8 @@ public class FuelBar { fuelAmount = .3f; } if (event.type == RenderGameOverlayEvent.ElementType.ALL) { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + GlStateManager.pushMatrix(); + ScaledResolution scaledResolution = Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale); Position position = NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarPosition; int x = position.getAbsX(scaledResolution, NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarWidth); @@ -139,6 +140,8 @@ public class FuelBar { Minecraft.getMinecraft().fontRendererObj.drawString(str, x + 2, y, 0xffffff, false ); + Utils.pushGuiScale(0); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextOverlay.java index 7884b2ac..2fbbe27d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextOverlay.java @@ -19,6 +19,7 @@ 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.util.Utils; import net.minecraft.client.Minecraft; @@ -120,12 +121,15 @@ public abstract class TextOverlay { return new Vector2f(); } - protected Vector2f getPosition(int overlayWidth, int overlayHeight) { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + protected Vector2f getPosition(int overlayWidth, int overlayHeight, boolean scaled) { + GlStateManager.pushMatrix(); + ScaledResolution scaledResolution; + if (!scaled) scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + else scaledResolution = Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale); int x = position.getAbsX(scaledResolution, overlayWidth); int y = position.getAbsY(scaledResolution, overlayHeight); - + GlStateManager.popMatrix(); return new Vector2f(x, y); } @@ -138,17 +142,19 @@ public abstract class TextOverlay { private void render(List strings, boolean dummy) { if (strings == null) return; - + if (!dummy) { + GlStateManager.pushMatrix(); + Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale); + } Vector2f size = getSize(strings); overlayHeight = (int) size.y; overlayWidth = (int) size.x; - Vector2f position = getPosition(overlayWidth, overlayHeight); + Vector2f position = getPosition(overlayWidth, overlayHeight, !dummy); int x = (int) position.x; int y = (int) position.y; TextOverlayStyle style = styleSupplier.get(); - if (style == TextOverlayStyle.BACKGROUND) Gui.drawRect(x, y, x + overlayWidth, y + overlayHeight, 0x80000000); GlStateManager.enableBlend(); @@ -204,5 +210,9 @@ public abstract class TextOverlay { } } } + if (!dummy) { + Utils.pushGuiScale(0); + GlStateManager.popMatrix(); + } } } -- cgit From bd96ab7fcbdba398022686df9ad6ec2acf7a7281 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 24 Dec 2022 04:23:46 +1100 Subject: fix farming overlay showing the wrong skill sometimes (#500) --- .../moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java index 08cbb189..51f3d351 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java @@ -167,6 +167,9 @@ public class FarmingSkillOverlay extends TextOverlay { //Set default skilltype to Farming and get BZprice config value boolean useBZPrice = NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice; skillType = "Farming"; + Farming = 1; + Alch = 0; + Foraging = 0; //WARTS if (internalname.startsWith("THEORETICAL_HOE_WARTS")) { -- cgit From 3a00eb285c9f46ee8a0cd615e325c8723a3aa15d Mon Sep 17 00:00:00 2001 From: heyngra Date: Sat, 24 Dec 2022 02:16:00 +0100 Subject: Fix NullPointerException in ItemTooltipRngListener (#510) --- .../moulberry/notenoughupdates/listener/ItemTooltipRngListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java index 2b7a9bef..d6d7087f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java @@ -210,7 +210,8 @@ public class ItemTooltipRngListener { dungeonData.clear(); JsonObject leveling = Constants.LEVELING; - if (!leveling.has("slayer_boss_xp") || + if (leveling == null || + !leveling.has("slayer_boss_xp") || !leveling.has("slayer_highest_tier") || !leveling.has("slayer_tier_colors") || !leveling.has("rng_meter_dungeon_score")) { -- cgit From 5b1c9f4959ff16be963217917a72d5bf669c4d8b Mon Sep 17 00:00:00 2001 From: GodOfPro <59516901+GodOfProDev@users.noreply.github.com> Date: Sat, 24 Dec 2022 04:46:40 +0330 Subject: Fixed total highest waves being included in total runs (#509) --- .../github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java index 87548f5e..95009b1d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java @@ -211,6 +211,7 @@ public class CrimsonIslePage extends GuiProfileViewerPage { public int getTotalKuudraRuns(JsonObject completedRuns) { int totalRuns = 0; for (Map.Entry runs : completedRuns.entrySet()) { + if (runs.getKey().startsWith("highest_wave")) continue; totalRuns += runs.getValue().getAsInt(); } return totalRuns; -- cgit From 4fd32fb0575fbb698b2c7611f357595255ce2635 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Sat, 24 Dec 2022 02:19:54 +0100 Subject: allow coin ingredients with decimal places (#506) --- .../moulberry/notenoughupdates/recipes/Ingredient.java | 12 ++++++------ .../io/github/moulberry/notenoughupdates/util/ItemUtils.java | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/recipes/Ingredient.java b/src/main/java/io/github/moulberry/notenoughupdates/recipes/Ingredient.java index c973f8c0..38d2447b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/recipes/Ingredient.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/recipes/Ingredient.java @@ -32,7 +32,7 @@ import java.util.Set; public class Ingredient { public static final String SKYBLOCK_COIN = "SKYBLOCK_COIN"; - private final int count; + private final double count; private final String internalItemId; private final NEUManager manager; private ItemStack itemStack; @@ -42,7 +42,7 @@ public class Ingredient { String[] parts = ingredientIdentifier.split(":"); internalItemId = parts[0]; if (parts.length == 2) { - count = Integer.parseInt(parts[1]); + count = Double.parseDouble(parts[1]); } else if (parts.length == 1) { count = 1; } else { @@ -50,13 +50,13 @@ public class Ingredient { } } - public Ingredient(NEUManager manager, String internalItemId, int count) { + public Ingredient(NEUManager manager, String internalItemId, double count) { this.manager = manager; this.count = count; this.internalItemId = internalItemId; } - private Ingredient(NEUManager manager, int coinValue) { + private Ingredient(NEUManager manager, double coinValue) { this.manager = manager; this.internalItemId = SKYBLOCK_COIN; this.count = coinValue; @@ -82,7 +82,7 @@ public class Ingredient { return "SKYBLOCK_COIN".equals(internalItemId); } - public int getCount() { + public double getCount() { return count; } @@ -97,7 +97,7 @@ public class Ingredient { } JsonObject itemInfo = manager.getItemInformation().get(internalItemId); itemStack = manager.jsonToStack(itemInfo); - itemStack.stackSize = count; + itemStack.stackSize = (int) count; return itemStack; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index 2ff9692d..bc44f656 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -42,13 +42,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.function.BiFunction; public class ItemUtils { - public static ItemStack getCoinItemStack(long coinAmount) { + public static ItemStack getCoinItemStack(double coinAmount) { String uuid = "2070f6cb-f5db-367a-acd0-64d39a7e5d1b"; String texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTM4MDcxNzIxY2M1YjRjZDQwNmNlNDMxYTEzZjg2MDgzYTg5NzNlMTA2NGQyZjg4OTc4Njk5MzBlZTZlNTIzNyJ9fX0="; @@ -63,7 +62,7 @@ public class ItemUtils { "ewogICJ0aW1lc3RhbXAiIDogMTYzNTk1NzQ4ODQxNywKICAicHJvZmlsZUlkIiA6ICJmNThkZWJkNTlmNTA0MjIyOGY2MDIyMjExZDRjMTQwYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJ1bnZlbnRpdmV0YWxlbnQiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2I5NTFmZWQ2YTdiMmNiYzIwMzY5MTZkZWM3YTQ2YzRhNTY0ODE1NjRkMTRmOTQ1YjZlYmMwMzM4Mjc2NmQzYiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9"; } ItemStack skull = Utils.createSkull( - "\u00A7r\u00A76" + NumberFormat.getInstance(Locale.US).format(coinAmount) + " Coins", + "§r§6" + NumberFormat.getInstance().format(coinAmount) + " Coins", uuid, texture ); -- cgit From 978e084c4a9f3d8899ccbfa9894b42e5bbf0aa3a Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 24 Dec 2022 21:07:25 +1100 Subject: fix "an" where should be "a" (#516) --- .../notenoughupdates/options/seperateSections/TooltipTweaks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java index 5c320db1..8539c3c4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java @@ -227,7 +227,7 @@ public class TooltipTweaks { @Expose @ConfigOption( name = "Abiphone NPC Location", - desc = "Click on an NPC to set an marker at the location" + desc = "Click on an NPC to set a marker at the location" ) @ConfigEditorBoolean public boolean abiphoneContactMarker = true; -- cgit From 0cba03b165fc66cf2c56e1a5669024f2976d2f9c Mon Sep 17 00:00:00 2001 From: GodOfPro <59516901+GodOfProDev@users.noreply.github.com> Date: Sun, 25 Dec 2022 14:18:51 +0330 Subject: Fix total kills, deaths not being reset on profile switch (#512) Override the reset cache --- .../github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 4c58e57a..a1b15b82 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -590,4 +590,10 @@ public class ExtraPage extends GuiProfileViewerPage { } return null; } + + @Override + public void resetCache() { + topDeaths = null; + topKills = null; + } } -- cgit From 1ce926e405392b03eb6c6afd6f7cc7996f461ce7 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 27 Dec 2022 02:06:02 +1100 Subject: set combat overlay to be off by default (#523) --- .../notenoughupdates/options/seperateSections/SkillOverlays.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java') 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 db0a0e94..f9dbe69e 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 @@ -24,7 +24,6 @@ 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.ConfigEditorAccordion; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorBoolean; -import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorButton; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorDraggableList; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorDropdown; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorFSR; @@ -303,7 +302,7 @@ public class SkillOverlays { ) @ConfigEditorBoolean @ConfigAccordionId(id = 4) - public boolean combatSkillOverlay = true; + public boolean combatSkillOverlay = false; @Expose @ConfigOption( -- cgit From 95d6a0c52af4511a90ebde2fe339f3f31cc5b9ae Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Mon, 26 Dec 2022 23:44:23 +0100 Subject: No More Guessing - Find Out Exactly How Much Time is Left in Star Cult Events (#513) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../io/github/moulberry/notenoughupdates/util/StarCultCalculator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/StarCultCalculator.java b/src/main/java/io/github/moulberry/notenoughupdates/util/StarCultCalculator.java index 02ec5ad3..4c4fe02d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/StarCultCalculator.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/StarCultCalculator.java @@ -101,7 +101,7 @@ public class StarCultCalculator { } if (active && activeTill != 0) { - return "Active!"; + return "Active! (" + Utils.prettyTime(activeTill - System.currentTimeMillis()) + ")"; } return Utils.prettyTime(cultStart.toEpochMilli() - l); -- cgit From de2b44e25e513592e36689cd2f50e932082dc37c Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 28 Dec 2022 05:39:57 +1100 Subject: Fix aucion profit taking too much tax (#525) 1% tax added for auctions collected above 1M coins --- .../github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java index 88ca0cc8..82c392e4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java @@ -104,7 +104,7 @@ public class AuctionProfit { int coins = tryParse(EnumChatFormatting.getTextWithoutFormattingCodes(coinsString.trim())); if (coins != 0) { if (coins > 1000000) { - coins /= 1.1; + coins /= 1.01; } coinsToCollect += coins; } @@ -113,7 +113,7 @@ public class AuctionProfit { if (line.contains("§7Status: §aSold!") || line.contains("§7Status: §aEnded!")) { if (coinsToCheck != 0) { if (coinsToCheck > 1000000) { - coinsToCheck /= 1.1; + coinsToCheck /= 1.01; } coinsToCollect += coinsToCheck; coinsToCheck = 0; -- cgit From d9c0192761734a9cf4595f990df408a278b1e430 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 28 Dec 2022 05:41:05 +1100 Subject: explain better how to use colour codes in /neurename (#526) explain better how to use colour codes --- .../io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') 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 7d541296..674e4068 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java @@ -221,7 +221,7 @@ public class GuiItemCustomize extends GuiScreen { tooltipToDisplay = Lists.newArrayList( EnumChatFormatting.AQUA + "Set a custom name for the item", EnumChatFormatting.GREEN + "", - EnumChatFormatting.GREEN + "Type \"&&\" to use colour codes", + EnumChatFormatting.GREEN + "Type \"&&\" for \u00B6", EnumChatFormatting.GREEN + "Type \"**\" for \u272A", EnumChatFormatting.GREEN + "Type \"*1-9\" for \u278A-\u2792", EnumChatFormatting.GREEN + "", -- cgit From fa7abebe73f629c17e7a43d8c50307d2f8aa588e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Tue, 27 Dec 2022 19:56:24 +0100 Subject: Craft cost price calculation improved (#511) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../io/github/moulberry/notenoughupdates/auction/APIManager.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java index 53e72dc1..e606fc49 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java @@ -27,6 +27,7 @@ import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.miscgui.GuiPriceGraph; import io.github.moulberry.notenoughupdates.recipes.Ingredient; +import io.github.moulberry.notenoughupdates.recipes.ItemShopRecipe; import io.github.moulberry.notenoughupdates.recipes.NeuRecipe; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; @@ -902,6 +903,11 @@ public class APIManager { if (recipes != null) RECIPE_ITER: for (NeuRecipe recipe : recipes) { + if (recipe instanceof ItemShopRecipe) { + if (vanillaItem) { + continue; + } + } if (recipe.hasVariableCost() || !recipe.shouldUseForCraftCost()) continue; float craftPrice = 0; for (Ingredient i : recipe.getIngredients()) { -- cgit From 354aed689ae3d5d7bfd8ab1d7ce9002127b8c526 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 28 Dec 2022 03:19:19 +0100 Subject: Issue with "god pot" in Todo list resolved (#521) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../github/moulberry/notenoughupdates/overlays/TimersOverlay.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java index 8db06651..74c64972 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -37,7 +37,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.input.Keyboard; import org.lwjgl.util.vector.Vector2f; import java.time.ZoneId; @@ -302,10 +301,14 @@ public class TimersOverlay extends TextTabOverlay { boolean foundCookieBuffText = false; boolean foundGodPotText = false; + boolean foundEffectsText = false; if (SBInfo.getInstance().getLocation() != null && !SBInfo.getInstance().getLocation().equals("dungeon") && SBInfo.getInstance().footer != null) { String formatted = SBInfo.getInstance().footer.getFormattedText(); for (String line : formatted.split("\n")) { + if (line.contains("Active Effects")) { + foundEffectsText = true; + } Matcher activeEffectsMatcher = PATTERN_ACTIVE_EFFECTS.matcher(line); if (activeEffectsMatcher.matches()) { foundGodPotText = true; @@ -411,7 +414,7 @@ public class TimersOverlay extends TextTabOverlay { } } - if (!foundGodPotText) { + if (!foundGodPotText && foundEffectsText) { hidden.godPotionDuration = 0; } -- cgit From 400033abc97a281b3ca71a771734f139b7949875 Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Sat, 31 Dec 2022 00:48:37 +0000 Subject: show neu nw if soopy doesn't work (#532) --- .../notenoughupdates/profileviewer/BasicPage.java | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index 30ac269b..873ee9f2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -265,6 +265,16 @@ public class BasicPage extends GuiProfileViewerPage { networth = profile.getNetWorth(profileId); } + //Networth is under 0 + //If = -1 -> an error occurred + //If = -2 -> still loading networth + String stateStr = EnumChatFormatting.RED + "An error occurred"; + if (networth == -2) { + stateStr = EnumChatFormatting.YELLOW + "Loading..."; + } else if (networth == -1) { + networth = profile.getNetWorth(profileId); + } + if (networth > 0) { Utils.drawStringCentered( EnumChatFormatting.GREEN + "Net Worth: " + EnumChatFormatting.GOLD + @@ -302,16 +312,16 @@ public class BasicPage extends GuiProfileViewerPage { EnumChatFormatting.GOLD + networthIRLMoney ); - getInstance().tooltipToDisplay.add(""); if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth && profile.getSoopyNetworthLeaderboardPosition() >= 0 && profile.isProfileMaxSoopyWeight(profile, profileId)) { - + getInstance().tooltipToDisplay.add(""); String lbPosStr = EnumChatFormatting.DARK_GREEN + "#" + EnumChatFormatting.GOLD + GuiProfileViewer.numberFormat.format( profile.getSoopyNetworthLeaderboardPosition()); - getInstance().tooltipToDisplay.add(lbPosStr + EnumChatFormatting.GREEN + " on soopy's networth leaderboard!"); + getInstance().tooltipToDisplay.add( + lbPosStr + EnumChatFormatting.GREEN + " on soopy's networth leaderboard!"); } if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { @@ -336,15 +346,6 @@ public class BasicPage extends GuiProfileViewerPage { } } } else { - //Networth is under 0 - //If = -1 -> an error occured - //If = -2 -> still loading networth - - String stateStr = EnumChatFormatting.RED + "An error occured"; - if (networth == -2) { - stateStr = EnumChatFormatting.YELLOW + "Loading..."; - } - Utils.drawStringCentered( EnumChatFormatting.GREEN + "Net Worth: " + stateStr, fr, @@ -886,14 +887,14 @@ public class BasicPage extends GuiProfileViewerPage { EnumChatFormatting.DARK_GREEN + "#" + EnumChatFormatting.GOLD + GuiProfileViewer.numberFormat.format( profile.getSoopyWeightLeaderboardPosition()); getInstance().tooltipToDisplay.add(""); - String stateStr = EnumChatFormatting.RED + "An error occured"; + String stateStr = EnumChatFormatting.RED + "An error occurred"; if (weight == -2) { stateStr = EnumChatFormatting.YELLOW + "Loading"; } if (weight > 0) getInstance().tooltipToDisplay.add(lbPosStr + EnumChatFormatting.GREEN + " on soopy's weight leaderboard!"); else - getInstance().tooltipToDisplay.add(stateStr + " soopy's weight leaderboard"); + getInstance().tooltipToDisplay.add(stateStr + " on soopy's weight leaderboard"); } } } -- cgit From ac34faf4ad240448a8906ab4cc1acd0d4f0614ce Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sat, 31 Dec 2022 03:07:01 +0100 Subject: Probably fixing the cookie buff timer problem (#527) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: nopo --- .../note