- Added DiskSpace to Splash

- Changed form ofSize to contain a space
This commit is contained in:
RePixelatedMC
2023-12-22 16:16:48 +01:00
parent 55ed9d7132
commit 5127b7c959
2 changed files with 7 additions and 5 deletions
@@ -788,6 +788,7 @@ public class Iris extends VolmitPlugin implements Listener {
padd + C.GRAY + " " + C.DARK_GRAY + "@@@" + C.GRAY + "@@@@@@@@@@@@@@" padd + C.GRAY + " " + C.DARK_GRAY + "@@@" + C.GRAY + "@@@@@@@@@@@@@@"
}; };
String[] splash; String[] splash;
File freeSpace = new File(Bukkit.getWorldContainer() + ".");
if (unstablemode) { if (unstablemode) {
splash = splashunstable; splash = splashunstable;
} else if (warningmode) { } else if (warningmode) {
@@ -835,6 +836,7 @@ public class Iris extends VolmitPlugin implements Listener {
Iris.info("Process Threads: " + getCPUThreads()); Iris.info("Process Threads: " + getCPUThreads());
Iris.info("Process Memory: " + getHardware.getProcessMemory() + " MB"); Iris.info("Process Memory: " + getHardware.getProcessMemory() + " MB");
Iris.info("Free DiskSpace: " + Form.ofSize(freeSpace.getFreeSpace(), 1024));
if (getHardware.getProcessMemory() < 5999) { if (getHardware.getProcessMemory() < 5999) {
Iris.warn("6GB+ Ram is recommended"); Iris.warn("6GB+ Ram is recommended");
} }
@@ -683,23 +683,23 @@ public class Form {
*/ */
public static String ofSize(long s, int div) { public static String ofSize(long s, int div) {
double d = (double) s; double d = (double) s;
String sub = "Bytes"; String sub = " Bytes";
if (d > div - 1) { if (d > div - 1) {
d /= div; d /= div;
sub = "KB"; sub = " KB";
if (d > div - 1) { if (d > div - 1) {
d /= div; d /= div;
sub = "MB"; sub = " MB";
if (d > div - 1) { if (d > div - 1) {
d /= div; d /= div;
sub = "GB"; sub = " GB";
if (d > div - 1) { if (d > div - 1) {
d /= div; d /= div;
sub = "TB"; sub = " TB";
} }
} }
} }