30
30
import net .minecraft .Util ;
31
31
import net .minecraft .client .Minecraft ;
32
32
import net .minecraft .client .resources .language .I18n ;
33
- import oshi .SystemInfo ;
34
33
35
34
/**
36
35
* Allows for providing easily accessible debugging information.
@@ -72,6 +71,8 @@ public static List<DebugInfoSection> getServerInfo() {
72
71
static {
73
72
DebugInfoSection .builder (Create .NAME )
74
73
.put ("Mod Version" , CreateBuildInfo .VERSION )
74
+ .put ("Mod Git Commit" , CreateBuildInfo .GIT_COMMIT )
75
+ .put ("Ponder Version" , getVersionOfMod ("ponder" ))
75
76
.put ("Forge Version" , getVersionOfMod ("forge" ))
76
77
.put ("Minecraft Version" , SharedConstants .getCurrentVersion ().getName ())
77
78
.buildTo (DebugInformation ::registerBothInfo );
@@ -115,7 +116,11 @@ public static String getVersionOfMod(String id) {
115
116
public static Collection <InfoElement > listAllOtherMods () {
116
117
List <InfoElement > mods = new ArrayList <>();
117
118
ModList .get ().forEachModContainer ((id , mod ) -> {
118
- if (!id .equals (Create .ID ) && !id .equals ("forge" ) && !id .equals ("minecraft" ) && !id .equals ("flywheel" )) {
119
+ if (!id .equals (Create .ID ) &&
120
+ !id .equals ("forge" ) &&
121
+ !id .equals ("minecraft" ) &&
122
+ !id .equals ("flywheel" ) &&
123
+ !id .equals ("ponder" )) {
119
124
IModInfo info = mod .getModInfo ();
120
125
String name = info .getDisplayName ();
121
126
String version = info .getVersion ().toString ();
@@ -141,10 +146,11 @@ public static Collection<InfoElement> listAllGraphicsCards() {
141
146
}
142
147
143
148
public static String getTotalRam () {
144
- long availableMemory = new SystemInfo ().getHardware ().getMemory ().getAvailable ();
145
- long totalMemory = new SystemInfo ().getHardware ().getMemory ().getTotal ();
149
+ Runtime runtime = Runtime .getRuntime ();
150
+ long availableMemory = runtime .freeMemory ();
151
+ long totalMemory = runtime .totalMemory ();
146
152
long usedMemory = totalMemory - availableMemory ;
147
- return String .format ("%s bytes (%s MiB) / %s bytes (%s MiB)" , usedMemory , usedMemory / 1049000 , totalMemory , totalMemory / 1049000 );
153
+ return String .format ("%s bytes (%s MiB) / %s bytes (%s MiB)" , usedMemory , usedMemory / 1048576L , totalMemory , totalMemory / 1048576L );
148
154
}
149
155
150
156
public static String getCpuInfo () {
0 commit comments