From 7c00af18febf6c0b833c7633b4fb60a9a1bb93af Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 16 Oct 2021 15:50:41 -0400 Subject: Code Clean Up (#2) * intellij code clean up * optimize imports * format * intellij suggestions * fix empty catch issues --- .../notenoughupdates/commands/StatsCommand.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index b61c58ed..e0743162 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -36,7 +36,7 @@ public class StatsCommand extends ClientCommandBase { @Override public void processCommand(ICommandSender sender, String[] args) { - if (args.length > 0){ + if (args.length > 0) { switch (args[0].toLowerCase(Locale.ROOT)) { case "modlist": clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); @@ -49,7 +49,7 @@ public class StatsCommand extends ClientCommandBase { final ObjectName objectName = ObjectName.getInstance("com.sun.management:type=DiagnosticCommand"); final DiagnosticCommandMXBean proxy = JMX.newMXBeanProxy(server, objectName, DiagnosticCommandMXBean.class); clipboardAndSendMessage(HastebinUploader.upload(proxy.gcClassHistogram(new String[0]).replace("[", "[]"), HastebinUploader.Mode.NORMAL)); - }catch (Exception e){ + } catch (Exception e) { clipboardAndSendMessage(null); } }); @@ -103,8 +103,8 @@ public class StatsCommand extends ClientCommandBase { builder.append("Display", String.format("%dx%d (%s)", Display.getWidth(), Display.getHeight(), GL11.glGetString(GL11.GL_VENDOR))); builder.append("GPU", GL11.glGetString(GL11.GL_RENDERER)); builder.append("GPU Driver", GL11.glGetString(GL11.GL_VERSION)); - if(getMemorySize() > 0) builder.append("Maximum Memory", (getMemorySize() / 1024L / 1024L) + "MB"); - builder.append("Shaders", (""+OpenGlHelper.isFramebufferEnabled()).toUpperCase()); + if (getMemorySize() > 0) builder.append("Maximum Memory", (getMemorySize() / 1024L / 1024L) + "MB"); + builder.append("Shaders", ("" + OpenGlHelper.isFramebufferEnabled()).toUpperCase()); builder.category("Java Stats"); builder.append("Java", String.format("%s %dbit", System.getProperty("java.version"), Minecraft.getMinecraft().isJava64bit() ? 64 : 32)); builder.append("Memory", String.format("% 2d%% %03d/%03dMB", currentMemory * 100L / maxMemory, currentMemory / 1024L / 1024L, maxMemory / 1024L / 1024L)); @@ -113,7 +113,7 @@ public class StatsCommand extends ClientCommandBase { builder.append("FPS", String.valueOf(Minecraft.getDebugFPS())); builder.append("Loaded Mods", String.valueOf(activeModCount)); builder.append("Forge", ForgeVersion.getVersion()); - builder.category("Neu Settings"); + builder.category("Neu Settings"); builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiKey.apiKey.isEmpty() ? "FALSE" : "TRUE"); builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getSource().getName()); @@ -132,13 +132,13 @@ public class StatsCommand extends ClientCommandBase { return builder; } - private static long getMemorySize(){ + private static long getMemorySize() { try { return ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize(); - } catch(Exception e){ + } catch (Exception e) { try { return ((com.sun.management.UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize(); - } catch(Exception ignored){/*IGNORE*/} + } catch (Exception ignored) {/*IGNORE*/} } return -1; } -- cgit From 9475677afdb86078f3c014b52ef1b0a414f3c5e5 Mon Sep 17 00:00:00 2001 From: nopothegamer <40329022+nopothegamer@users.noreply.github.com> Date: Fri, 10 Dec 2021 22:54:22 +1100 Subject: Slayer overlay (#28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * idk where im commiting to * idk where im commiting to * made tita overlay and waypoints work with dwarven overlay off "fixed" divan rarity in neuah made eitherwarp block overlay turn off able * Added change notes * i stopped being pepega and worked out how neu config works * Added mining skill overlay * fixed mining overlay * add option to hide Mining waypoints in Dwarven mines when at location * better check location * Make cata xp in /pv be calculated on how many runs you have * Added master cata xp rates * Make gitignore not show as changed * Added warnings to some things in /neu * maybe fix hiding waypoints * Added a fishing skill overlay its kinda scuffed because of the interp stuff * Hopefully fix Rampart's quarry (for real now) * Moul said i could no one leak in general or smth * Cache itemstacks in miningoverlay and crystalhollows overlay (untested) * Fix preinit crash due to manager not existing yet * Make tab do the same as down button while in tab completion mode * remove debug print * Added pitch to farming overlay * Changed the panoramas back to the old one because ery is scuffed * isnt finished but should work for ery * Made it so if ur mining 60 it just says maxed level instead of b u g * Made skills not show int limit when at max level in skill overlays * wh :omegalul: made neu * sad you cant type that long in search bar * Hello don't mind me just improving your workflow * æ * Oh also this * Added the cata xp scaling(idk if m3 and 4 values are right) * Added Expertise Progress * Fix farming overlay * Added cult/crops to next cult level * Go to the other end of the tab-completion List when hitting the end * remove debug prints * added combat skill overlay and some changes to the others (combat doesnt work rn could someone look into it :prayge:) * Added cooldown to god pot showing in todo overlay * comment * Added option to remove enchant glint in storage gui * Added option to remove enchant glint in storage gui * please fix * please fix * Fixed the placement of help.png * Added fairy soul waypoints to misc * unclear not clear * Added dg partner cape * fix space cape * Fix space cape * Make it so you can hold down keys in sign GUIs * Added a button in storage menu to open the settings Added an option to change the click names for /pv to /ah * Made it so ur config doesnt reset * Added bhop (shhh dont tell anyone) * Added a help menu to /neuec * changed fisgifis overlay button no work * make working fishing tiemr * jani can you test this out for us * Added a gui locations tab * very important feature * Fixed wart hoe overlay if not alch 50 * Make it so the ding time is customizable * Added coins/m to farming overlay * Basic mining tab in pv * Just for jani * Just for jani v2 * works ig * my balls * hotm pv is mostly done missing some perks * hotm pv done * message goes here * push so i can pr jani * Final hotm pv texture + fix m3 and m4 cata xp * edit: didnt work * fixed up stuff dokm said * added image for hotm pv * Fixed previews for furf and dg capes * removed combat overlay from location gui menu in /neu * Start of a custom pv page * Removed custom pv because -2 people would use it Removed neubhop (found out bhop is bannable) * update build gradle * - Made it so treecap shows foraging xp instead of farming xp on the farming overlay - Made it so a jungle axe with cult will show the "farming" overlay * Added entrance + made blur limit at 100 * Added blocking clicks back to the enchanting minigames * update patch notes * Fixed rounding issue * let you use screenshot in et overlay * Added /neurepomode to toggle item editing and dev mode * Changed "NEUAH is DISABLED! Enable in /neusettings." to /neu * Changed misc overlays tab to todo overlays * Added config option for npc retexture (idk if it works i dont have a pack to test it with) * update patch note * Fixed api key autofill with dg copy chat feature * Fixed api key autofill with dg copy chat feature v2 * Made missing enchants not show on an item if its not missing any enchants * remove todo because pepega * Added a config option for dirt wand overlay Added a config option for hoe of tilling * patch notes * Fix pet getlorereplacements crash (im guessing) (#21) * Added an option to use short numbers (1.5mil) for price tooltips * Added warning to slotlocking + short prices default to off * make it not dungeon map * Fixed pet overlay not updating when going into /pets * Dokm after not making his own patch notes * Fixed capital letter * Refactor miscoverlays to todooverlays * idk man make the short number prices use like 5 less lines * Added an option to show next click in chronomatron * added bz price to farming overlay coins/m (only wart rn) * added bz price to farming overlay coins/m * me when cactus price was divided by 1296 :pepela: * unrefactor todo overlay because it resets the config * Fixed fetchur for the 765754465th time * Fixed time that experiment table resets + Made prevent missclicks off by default * Added slayer overlay * fixed quickforge level 20 because it goes up +0.5% every level... and randomly the last level gives + 10.5% * ery wanted to texture himself so i made a hidden toggle for it * made it so if your modlist is under 15 and you do /neustats modlist it will just show /neustats * Finished slayer overlay * Auto turn off search mode after 2 minutes * i forgor bout patch notes * Added setting jani wanted * removed hide incompatible enchants because no workie * i forgor to make it build :skull: * Added max enchant book to /neuec - Dokm * Fixed the slayer overlay when ping * edit: didnt work * Made a lil error if you have new tab list off * Fixed fishing overlay for lava fishing * Fix spelling + comments * Added bingo profile icon to /pv * comments * istg people are pepega * ery made good texture for pv bingo * making the pr fricked me (please build) * Fixed pet overlay not resetting pet when making new profile * Fixed pet overlay not resetting pet when making new profile * i forgor to add to LocationEdit neu page + last commit was added combat overlay * Fix comments because either me or intellij was on crack * comments stuff * ok de duimon no0b Co-authored-by: Lulonaut Co-authored-by: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Co-authored-by: DoKM Co-authored-by: TymanWasTaken Co-authored-by: MicrocontrollersDev Co-authored-by: jani270 Co-authored-by: DoKM <54663875+DoKM@users.noreply.github.com> Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com> --- .../github/moulberry/notenoughupdates/commands/StatsCommand.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index e0743162..3888e3ea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -34,12 +34,18 @@ public class StatsCommand extends ClientCommandBase { super("neustats"); } + private static int activeModCount = Loader.instance().getActiveModList().size(); + @Override public void processCommand(ICommandSender sender, String[] args) { if (args.length > 0) { switch (args[0].toLowerCase(Locale.ROOT)) { case "modlist": - clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); + if (activeModCount > 15) { + clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); + } else { + clipboardAndSendMessage(createStats()); + } break; case "dump": modPrefixedMessage(EnumChatFormatting.GREEN + "This will upload a dump of the java classes your game has loaded how big they are and how many there are. This can take a few seconds as it is uploading to HasteBin."); @@ -95,7 +101,6 @@ public class StatsCommand extends ClientCommandBase { long totalMemory = Runtime.getRuntime().totalMemory(); long freeMemory = Runtime.getRuntime().freeMemory(); long currentMemory = totalMemory - freeMemory; - int activeModCount = Loader.instance().getActiveModList().size(); builder.category("System Stats"); builder.append("OS", System.getProperty("os.name")); -- cgit From ea3ec354ba3bb5b4ac64b8032816b8e4c407f099 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 28 Dec 2021 00:49:28 -0500 Subject: more code clean up (#38) --- .../io/github/moulberry/notenoughupdates/commands/StatsCommand.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index 3888e3ea..99bfe368 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -27,7 +27,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class StatsCommand extends ClientCommandBase { - private final ExecutorService threadPool = Executors.newFixedThreadPool(1); public StatsCommand() { @@ -147,5 +146,4 @@ public class StatsCommand extends ClientCommandBase { } return -1; } - } -- cgit From 0f3cfc259f89c22840b761931e238d699f17acc7 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 2 Jan 2022 09:07:24 +1100 Subject: Added custom wardrobe display for the new stuff they have put on the alpha (#36) * istg if you give me 170 commits i will end someone(added stranded pv icon + added an icon for gamemodes that neu doesnt know about) * Change the mines of divan waypoints to blue because it was hard to see the gold waypoint gold blocks everywhere * Added a custom armor stuff for the alpha content * Made it so it doesnt show if you dont have hide potion effects on * very cool and epic armor display (dont look at the code its bad) ((not finished)) * hello yes please test armor hud (finished but i will clean it up a lil) * clean up code + show thingy when no items cached + fix neu buttons placement + fixed crash * fixed neubutton placment but the fix works (i hope) * i see no reason for this to work outside skyblock soo * ery wanted it to be possible for an on texture to be different to an off texture in /neu * Added "Has Advanced Tab" to /neustats * Added "Has Advanced Tab" to /neustats * https://cdn.discordapp.com/attachments/896407218151366687/924981162714234900/unknown.png https://cdn.discordapp.com/attachments/896407218151366687/924981203319263232/unknown.png (fixed storage menu if you have new tab off) * tried to fix the gui being offset * Add a pet display for your inventory * tries to show your pet stats in the inv display * skyblock check * Fix texture * try to lower file size by unused assets * patch notes ! * remove some random code that wasnt doing anything * added a repo check to see if the wardrobe stuff has come out yet * fixed it showing wrong pet * fixed caching --- .../java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index 99bfe368..525e8aea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -122,6 +122,7 @@ public class StatsCommand extends ClientCommandBase { builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getSource().getName()); builder.append("SB Profile", SBInfo.getInstance().currentProfile); + builder.append("Has Advanced Tab", SBInfo.getInstance().hasNewTab ? "TRUE" : "FALSE"); builder.category("Repo Stats"); builder.append("Last Commit", NotEnoughUpdates.INSTANCE.manager.latestRepoCommit); builder.append("Loaded Items", String.valueOf(NotEnoughUpdates.INSTANCE.manager.getItemInformation().size())); -- cgit From 3a21023cdaf23f51ad27e0ec769adc47c8d3e44d Mon Sep 17 00:00:00 2001 From: Roman / Nea Date: Thu, 27 Jan 2022 11:21:50 +0100 Subject: Build Number (#70) Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com> --- .../io/github/moulberry/notenoughupdates/commands/StatsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index 525e8aea..f069a0e0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -120,7 +120,7 @@ public class StatsCommand extends ClientCommandBase { builder.category("Neu Settings"); builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiKey.apiKey.isEmpty() ? "FALSE" : "TRUE"); builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); - builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getSource().getName()); + builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getDisplayVersion()); builder.append("SB Profile", SBInfo.getInstance().currentProfile); builder.append("Has Advanced Tab", SBInfo.getInstance().hasNewTab ? "TRUE" : "FALSE"); builder.category("Repo Stats"); -- cgit From 393f3c8f9279f5d8f5e33933ce6ef985d65a92f0 Mon Sep 17 00:00:00 2001 From: ThatGravyBoat Date: Fri, 18 Feb 2022 04:58:10 -0330 Subject: Move commands to separate classes (#82) --- .../notenoughupdates/commands/StatsCommand.java | 150 --------------------- 1 file changed, 150 deletions(-) delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java deleted file mode 100644 index f069a0e0..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ /dev/null @@ -1,150 +0,0 @@ -package io.github.moulberry.notenoughupdates.commands; - -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.util.DiscordMarkdownBuilder; -import io.github.moulberry.notenoughupdates.util.HastebinUploader; -import io.github.moulberry.notenoughupdates.util.SBInfo; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.ForgeVersion; -import net.minecraftforge.fml.common.Loader; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.GL11; - -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.ObjectName; -import java.awt.*; -import java.awt.datatransfer.StringSelection; -import java.lang.management.ManagementFactory; -import java.util.List; -import java.util.Locale; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class StatsCommand extends ClientCommandBase { - private final ExecutorService threadPool = Executors.newFixedThreadPool(1); - - public StatsCommand() { - super("neustats"); - } - - private static int activeModCount = Loader.instance().getActiveModList().size(); - - @Override - public void processCommand(ICommandSender sender, String[] args) { - if (args.length > 0) { - switch (args[0].toLowerCase(Locale.ROOT)) { - case "modlist": - if (activeModCount > 15) { - clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); - } else { - clipboardAndSendMessage(createStats()); - } - break; - case "dump": - modPrefixedMessage(EnumChatFormatting.GREEN + "This will upload a dump of the java classes your game has loaded how big they are and how many there are. This can take a few seconds as it is uploading to HasteBin."); - threadPool.submit(() -> { - try { - final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - final ObjectName objectName = ObjectName.getInstance("com.sun.management:type=DiagnosticCommand"); - final DiagnosticCommandMXBean proxy = JMX.newMXBeanProxy(server, objectName, DiagnosticCommandMXBean.class); - clipboardAndSendMessage(HastebinUploader.upload(proxy.gcClassHistogram(new String[0]).replace("[", "[]"), HastebinUploader.Mode.NORMAL)); - } catch (Exception e) { - clipboardAndSendMessage(null); - } - }); - break; - } - } else { - clipboardAndSendMessage(createStats()); - } - - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return args.length == 1 ? getListOfStringsMatchingLastWord(args, "modlist", "dump") : null; - } - - public interface DiagnosticCommandMXBean { - String gcClassHistogram(String[] array); - } - - private static void clipboardAndSendMessage(String data) { - if (data == null) { - modPrefixedMessage(EnumChatFormatting.DARK_RED + "Error occurred trying to perform command."); - return; - } - try { - StringSelection clipboard = new StringSelection(data); - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard); - modPrefixedMessage(EnumChatFormatting.GREEN + "Dev info copied to clipboard."); - } catch (Exception ignored) { - modPrefixedMessage(EnumChatFormatting.DARK_RED + "Could not copy to clipboard."); - } - } - - private static void modPrefixedMessage(String message) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + "[" + EnumChatFormatting.RED + "NotEnoughUpdates" + EnumChatFormatting.GOLD + "]: " + message)); - - } - - private static String createStats() { - DiscordMarkdownBuilder builder = new DiscordMarkdownBuilder(); - long maxMemory = Runtime.getRuntime().maxMemory(); - long totalMemory = Runtime.getRuntime().totalMemory(); - long freeMemory = Runtime.getRuntime().freeMemory(); - long currentMemory = totalMemory - freeMemory; - - builder.category("System Stats"); - builder.append("OS", System.getProperty("os.name")); - builder.append("CPU", OpenGlHelper.getCpu()); - builder.append("Display", String.format("%dx%d (%s)", Display.getWidth(), Display.getHeight(), GL11.glGetString(GL11.GL_VENDOR))); - builder.append("GPU", GL11.glGetString(GL11.GL_RENDERER)); - builder.append("GPU Driver", GL11.glGetString(GL11.GL_VERSION)); - if (getMemorySize() > 0) builder.append("Maximum Memory", (getMemorySize() / 1024L / 1024L) + "MB"); - builder.append("Shaders", ("" + OpenGlHelper.isFramebufferEnabled()).toUpperCase()); - builder.category("Java Stats"); - builder.append("Java", String.format("%s %dbit", System.getProperty("java.version"), Minecraft.getMinecraft().isJava64bit() ? 64 : 32)); - builder.append("Memory", String.format("% 2d%% %03d/%03dMB", currentMemory * 100L / maxMemory, currentMemory / 1024L / 1024L, maxMemory / 1024L / 1024L)); - builder.append("Memory Allocated", String.format("% 2d%% %03dMB", totalMemory * 100L / maxMemory, totalMemory / 1024L / 1024L)); - builder.category("Game Stats"); - builder.append("FPS", String.valueOf(Minecraft.getDebugFPS())); - builder.append("Loaded Mods", String.valueOf(activeModCount)); - builder.append("Forge", ForgeVersion.getVersion()); - builder.category("Neu Settings"); - builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiKey.apiKey.isEmpty() ? "FALSE" : "TRUE"); - builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); - builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getDisplayVersion()); - builder.append("SB Profile", SBInfo.getInstance().currentProfile); - builder.append("Has Advanced Tab", SBInfo.getInstance().hasNewTab ? "TRUE" : "FALSE"); - builder.category("Repo Stats"); - builder.append("Last Commit", NotEnoughUpdates.INSTANCE.manager.latestRepoCommit); - builder.append("Loaded Items", String.valueOf(NotEnoughUpdates.INSTANCE.manager.getItemInformation().size())); - if (activeModCount <= 15) createModList(builder); - - return builder.toString(); - } - - private static DiscordMarkdownBuilder createModList(DiscordMarkdownBuilder builder) { - builder.category("Mods Loaded"); - Loader.instance().getActiveModList().forEach(mod -> builder.append(mod.getName(), mod.getSource().getName())); - return builder; - } - - private static long getMemorySize() { - try { - return ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize(); - } catch (Exception e) { - try { - return ((com.sun.management.UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize(); - } catch (Exception ignored) {/*IGNORE*/} - } - return -1; - } -} -- cgit