From f29ebcc6cdf202a69f267a4dbdbfc9239929fd8a Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Sun, 20 Mar 2022 08:47:29 +0100 Subject: dungeons and pv bingo tab (#93) --- src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 4bf1d6aa..5b7bd055 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -293,7 +293,7 @@ public class SBInfo { String cleanLine = Utils.cleanColour(line); - if (cleanLine.contains("Dungeon") && cleanLine.contains("Cleared:") && cleanLine.contains("%")) { + if (cleanLine.contains("Cleared:") && cleanLine.contains("%")) { tempIsInDungeon = true; } -- cgit From e202e4adf979073921455083f5e737bc4fcf5f14 Mon Sep 17 00:00:00 2001 From: CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> Date: Thu, 24 Mar 2022 14:55:20 -0500 Subject: Refactor Hollows solvers, add tests, add Vec3Comparable, fix bugs (#95) --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 5b7bd055..a557eb12 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -18,6 +18,8 @@ import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiOpenEvent; @@ -57,7 +59,7 @@ public class SBInfo { public String slayer = ""; public boolean stranded = false; - public String mode = ""; + public String mode = null; public Date currentTimeDate = null; @@ -120,6 +122,16 @@ public class SBInfo { } } + public boolean checkForSkyblockLocation() { + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() || getLocation() == null) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + + "[NEU] This command is not available outside SkyBlock")); + return false; + } + + return true; + } + private static final Pattern PROFILE_PATTERN = Pattern.compile("(?(โ™ฒ Ironman)|(โ˜€ Stranded)|()) *Profile: (?[^ ]+)"); -- cgit From 5e7a8a02fe836c1e635faf067fbe8913549bc0e0 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Sun, 27 Mar 2022 12:13:08 -0500 Subject: Add NBT Data to Profile Viewer Tabs and XP Bars (#94) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed what hypxiel broke in dungeons * Added Longswords to Tools Tab (Itemlist) * Set max cata level to 70 * ups * why is it now E * YEP the cap is 99 not 70 * long cata xp BatChest + remove crash check because hypixel profile is null and i havent fixed that yet * Added checks for chat messages for dungeon win overlay - i think ive got them all but 4Shrug * Added an option to alert you if you put something for too much onto ah (default 50%) + Lowest bin alert triggers if lowest bin isnt found * IMPORTANT * fix dungeon page in /pv * show minions from coop in /pv * (BREAKING CHANGE) remove whitespace in changelog * fix crash with minion check * initial draft * tooltip * important changes * progress related things progress bar for community goals total collected points and personal goals display * only show bingo tab on Bingo profiles * make goals display gold when completed * Added MM7 button to dungeon preset * wart go not stonks * fix percents and added stack size * use code nopo in fortnite shop โ€” Today at 17:29 The capitalisation * config option for always showing bingo page * ๐Ÿ™‚ * movble pv tabs * 2.1.md ๐Ÿ™‚ * oops * der Kabel * import * Added powder amount to level up perk * Made it only show if the perk isnt maxed / level 0 * fix /pv crash when pet is not in repo * 2.1.md ๐Ÿ™‚ * web editor my beloved * Add NBT Data to Profile Viewer Tabs and XP Bars Add NBT Data Support for Resources in Tabs Add NBT Data Support for Resources in XP Bars Optimize renderTabs function Optimize mouseClicked Function Optimize ProfileViewerPage Enum * Update Style Co-authored-by: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> * Update GuiProfileViewer Rebased on pvbingo Updated formatting with IntelliJ reformatting tool (hopefully that matches now, let me know if you want me to try again but I think I did it right) * dungeons and pv bingo tab (#93) * add custom skull loading back (#96) * Refactor Hollows solvers, add tests, add Vec3Comparable, fix bugs (#95) * Rebase on master * Fix conflicts and rebase on master Add changes to change log * Oops Co-authored-by: nopo Co-authored-by: jani270 Co-authored-by: Lulonaut Co-authored-by: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Co-authored-by: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Co-authored-by: CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index a557eb12..5b7bd055 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -18,8 +18,6 @@ import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiOpenEvent; @@ -59,7 +57,7 @@ public class SBInfo { public String slayer = ""; public boolean stranded = false; - public String mode = null; + public String mode = ""; public Date currentTimeDate = null; @@ -122,16 +120,6 @@ public class SBInfo { } } - public boolean checkForSkyblockLocation() { - if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() || getLocation() == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "[NEU] This command is not available outside SkyBlock")); - return false; - } - - return true; - } - private static final Pattern PROFILE_PATTERN = Pattern.compile("(?(โ™ฒ Ironman)|(โ˜€ Stranded)|()) *Profile: (?[^ ]+)"); -- cgit From 4afcd516ffc58d55da24c5f4db14db7922f61121 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Sun, 27 Mar 2022 14:21:41 -0500 Subject: Blaze slayer (#102) --- src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 5b7bd055..95a3539a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -311,6 +311,8 @@ public class SBInfo { slayer = "Sven"; } else if (line.contains("Voidgloom Seraph")) { slayer = "Enderman"; + } else if (line.contains("Inferno Demonlord")) { + slayer = "Blaze"; } if (lines.contains("Slayer Quest") && SlayerOverlay.unloadOverlayTimer == -1 || lines.contains("Slayer Quest") && System.currentTimeMillis() - SlayerOverlay.unloadOverlayTimer > 500) { -- cgit From f237ae4cecdfa5c00ee83bd0176a591a2b174913 Mon Sep 17 00:00:00 2001 From: CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> Date: Sun, 27 Mar 2022 23:07:57 -0500 Subject: Restore metal detector and wishing compass changes that were nuked by #94 (#104) --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 95a3539a..f1e40671 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -18,6 +18,8 @@ import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiOpenEvent; @@ -57,7 +59,7 @@ public class SBInfo { public String slayer = ""; public boolean stranded = false; - public String mode = ""; + public String mode = null; public Date currentTimeDate = null; @@ -120,6 +122,16 @@ public class SBInfo { } } + public boolean checkForSkyblockLocation() { + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() || getLocation() == null) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + + "[NEU] This command is not available outside SkyBlock")); + return false; + } + + return true; + } + private static final Pattern PROFILE_PATTERN = Pattern.compile("(?(โ™ฒ Ironman)|(โ˜€ Stranded)|()) *Profile: (?[^ ]+)"); -- cgit From 79bc28639e966415a97b1f21dd11617c6a4e0215 Mon Sep 17 00:00:00 2001 From: Cobble8 <41165207+Cobble8@users.noreply.github.com> Date: Wed, 27 Apr 2022 14:56:23 -0400 Subject: HEAVY PEARL TODO TIMER THING (#120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HEAVY PEARL TODO TIMER THING yay hopefully this works idk don't wanna wait 21 hours to test it again but Im pretty confident it works * fix bad change thing hopefully idk maybe * fix formatting + 2.1.md ๐Ÿ™‚ * fix formatting * fixed heavy pearls overriding gemstone powder Co-authored-by: NopoTheGamer --- src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index f1e40671..6519d547 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -3,6 +3,7 @@ package io.github.moulberry.notenoughupdates.util; import com.google.common.reflect.TypeToken; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeListener; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; @@ -367,7 +368,9 @@ public class SBInfo { //Replaced with for loop because in crystal hollows with events the line it's on can shift. for (String line : lines) { if (line.contains("โฃ")) { - location = Utils.cleanColour(line).replaceAll("[^A-Za-z0-9() ]", "").trim(); + String l = Utils.cleanColour(line).replaceAll("[^A-Za-z0-9() ]", "").trim(); + if(!l.equals(location)) { new ScoreboardLocationChangeListener(location, l); } + location = l; break; } } -- cgit From 50dc2122462642a0c3a00b3a3ae6389825dc04df Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 9 Jun 2022 18:04:22 -0400 Subject: Re-license project as LGPL (#157) * add licence files & a few misc chores * add license notices & run auto formatter --- .../moulberry/notenoughupdates/util/SBInfo.java | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 6519d547..9419be4f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + package io.github.moulberry.notenoughupdates.util; import com.google.common.reflect.TypeToken; @@ -37,7 +56,12 @@ import java.nio.file.Files; import java.nio.file.Path; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -369,7 +393,9 @@ public class SBInfo { for (String line : lines) { if (line.contains("โฃ")) { String l = Utils.cleanColour(line).replaceAll("[^A-Za-z0-9() ]", "").trim(); - if(!l.equals(location)) { new ScoreboardLocationChangeListener(location, l); } + if (!l.equals(location)) { + new ScoreboardLocationChangeListener(location, l); + } location = l; break; } -- cgit From 5d2aa40fdee044c0579f426bff279b9d631e306f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:38:24 +0200 Subject: Probably fixing Lag spikes (#229) * using method getOpenChestName instead of field lastOpenContainerName * probably fixing lag spikes in power stone stats display * using new getOpenChestName in EnchantingSolvers --- .../moulberry/notenoughupdates/util/SBInfo.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 9419be4f..8bd7c581 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -88,7 +88,11 @@ public class SBInfo { public Date currentTimeDate = null; - public String lastOpenContainerName = ""; + /** + * Use Utils.getOpenChestName() instead + */ + @Deprecated + public String currentlyOpenChestName = ""; private long lastManualLocRaw = -1; private long lastLocRaw = -1; @@ -131,19 +135,18 @@ public class SBInfo { GuiChest chest = (GuiChest) event.gui; ContainerChest container = (ContainerChest) chest.inventorySlots; - lastOpenContainerName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); + currentlyOpenChestName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); + } else { + currentlyOpenChestName = ""; } } @SubscribeEvent public void onGuiTick(TickEvent event) { if (tickCount++ % 10 != 0) return; - GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen; - if (currentScreen instanceof GuiChest) { - ContainerChest container = (ContainerChest) ((GuiChest) currentScreen).inventorySlots; - if ("Profile Management".equals(container.getLowerChestInventory().getDisplayName().getUnformattedText())) { - updateProfileInformation(container); - } + if (Utils.getOpenChestName().equals("Profile Management")) { + ContainerChest container = (ContainerChest) ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots; + updateProfileInformation(container); } } @@ -226,7 +229,7 @@ public class SBInfo { locraw = null; this.setLocation(null); joinedWorld = System.currentTimeMillis(); - lastOpenContainerName = ""; + currentlyOpenChestName = ""; hasNewTab = false; } -- cgit From b2d35428ac089ac104a2ea8212d8332c27a6cbee Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:05:33 +0200 Subject: Dumb bugs (#232) * fixing experimentation solver * fixing neu buttons not resetting properly after disabling trophy reward overlay or accessory bag overlay * fixed ah overlay --- .../java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 8bd7c581..74409648 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -26,7 +26,6 @@ import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeLis import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.init.Blocks; @@ -93,6 +92,7 @@ public class SBInfo { */ @Deprecated public String currentlyOpenChestName = ""; + public String lastOpenChestName = ""; private long lastManualLocRaw = -1; private long lastLocRaw = -1; @@ -127,7 +127,8 @@ public class SBInfo { private int tickCount = 0; public String currentProfile = null; - @SubscribeEvent + //Set the priority HIGH to allow other GuiOpenEvent's to use the new currentlyOpenChestName data + @SubscribeEvent(priority = EventPriority.HIGH) public void onGuiOpen(GuiOpenEvent event) { if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; @@ -136,6 +137,7 @@ public class SBInfo { ContainerChest container = (ContainerChest) chest.inventorySlots; currentlyOpenChestName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); + lastOpenChestName = currentlyOpenChestName; } else { currentlyOpenChestName = ""; } @@ -230,6 +232,7 @@ public class SBInfo { this.setLocation(null); joinedWorld = System.currentTimeMillis(); currentlyOpenChestName = ""; + lastOpenChestName = ""; hasNewTab = false; } -- cgit From 013abf6525c39b99afdeba62d33dbeac9b9f766e Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Sun, 21 Aug 2022 10:37:00 +0000 Subject: misc dungeon profit changes (#240) --- .../moulberry/notenoughupdates/util/SBInfo.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 74409648..4e920aea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -61,6 +61,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -87,6 +89,8 @@ public class SBInfo { public Date currentTimeDate = null; + private JsonObject mayorJson = new JsonObject(); + /** * Use Utils.getOpenChestName() instead */ @@ -97,6 +101,7 @@ public class SBInfo { private long lastManualLocRaw = -1; private long lastLocRaw = -1; public long joinedWorld = -1; + private long lastMayorUpdate; public long unloadedWorld = -1; private JsonObject locraw = null; public boolean isInDungeon = false; @@ -297,7 +302,10 @@ public class SBInfo { lastLocRaw = System.currentTimeMillis(); NotEnoughUpdates.INSTANCE.sendChatMessage("/locraw"); } - + if (currentTime - lastMayorUpdate > 300 * 1000) { + updateMayor(); + lastMayorUpdate = currentTime; + } try { for (NetworkPlayerInfo info : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { String name = Minecraft.getMinecraft().ingameGUI.getTabList().getPlayerName(info); @@ -421,4 +429,17 @@ public class SBInfo { e.printStackTrace(); } } + + public void updateMayor() { + NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( + NotEnoughUpdates.INSTANCE.config.apiData.apiKey, + "resources/skyblock/election", + new HashMap<>() + ).thenAcceptAsync(newJson -> mayorJson = newJson); + } + + + public JsonObject getMayorJson() { + return mayorJson; + } } -- cgit From 2dd4a2b36211c380c0bf4e231859dfafd3c04a5b Mon Sep 17 00:00:00 2001 From: Roman / Linnea Grรคf Date: Thu, 29 Sep 2022 17:25:37 +0200 Subject: Add custom keystore and refactor HypixelApi.java (#318) * Add custom keystore and refactor HypixelApi.java * Fix inputstream leak (+ less console spam) * Fix HOTM crash * Use api selected variable to find best profile * Number formatting * Make old profiles show again Co-authored-by: nopo --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 4e920aea..f3a09fcc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -61,8 +61,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -431,11 +429,10 @@ public class SBInfo { } public void updateMayor() { - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "resources/skyblock/election", - new HashMap<>() - ).thenAcceptAsync(newJson -> mayorJson = newJson); + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newHypixelApiRequest("resources/skyblock/election") + .requestJson() + .thenAccept(newJson -> mayorJson = newJson); } -- cgit