diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-16 15:50:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-16 15:50:41 -0400 |
| commit | 7c00af18febf6c0b833c7633b4fb60a9a1bb93af (patch) | |
| tree | f02de145362d6a1399651ade4a130d565d7f0ba3 /src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java | |
| parent | b11742988dec635b5c5da7c2363803cbfafb37b1 (diff) | |
| download | notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.gz notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.bz2 notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.zip | |
Code Clean Up (#2)
* intellij code clean up
* optimize imports
* format
* intellij suggestions
* fix empty catch issues
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java | 16 |
1 files changed, 8 insertions, 8 deletions
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; } |
