mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-18 14:50:57 +00:00
renames + dev sync
This commit is contained in:
@@ -39,7 +39,7 @@ import com.volmit.iris.engine.object.IrisWorld;
|
|||||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||||
import com.volmit.iris.engine.platform.DummyChunkGenerator;
|
import com.volmit.iris.engine.platform.DummyChunkGenerator;
|
||||||
import com.volmit.iris.engine.safeguard.IrisSafeguard;
|
import com.volmit.iris.engine.safeguard.IrisSafeguard;
|
||||||
import com.volmit.iris.engine.safeguard.ServerBoot;
|
import com.volmit.iris.engine.safeguard.ServerBootSFG;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.collection.KMap;
|
import com.volmit.iris.util.collection.KMap;
|
||||||
import com.volmit.iris.util.exceptions.IrisException;
|
import com.volmit.iris.util.exceptions.IrisException;
|
||||||
@@ -94,7 +94,7 @@ import java.util.Date;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||||
import static com.volmit.iris.engine.safeguard.ServerBoot.passedserversoftware;
|
import static com.volmit.iris.engine.safeguard.ServerBootSFG.passedserversoftware;
|
||||||
|
|
||||||
@SuppressWarnings("CanBeFinal")
|
@SuppressWarnings("CanBeFinal")
|
||||||
public class Iris extends VolmitPlugin implements Listener {
|
public class Iris extends VolmitPlugin implements Listener {
|
||||||
@@ -465,9 +465,9 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
J.s(this::setupPapi);
|
J.s(this::setupPapi);
|
||||||
J.a(ServerConfigurator::configure, 20);
|
J.a(ServerConfigurator::configure, 20);
|
||||||
splash();
|
splash();
|
||||||
ServerBoot.UnstableMode();
|
ServerBootSFG.UnstableMode();
|
||||||
ServerBoot.SupportedServerSoftware();
|
ServerBootSFG.SupportedServerSoftware();
|
||||||
ServerBoot.printincompatiblepluginWarnings();
|
ServerBootSFG.printincompatiblepluginWarnings();
|
||||||
autoStartStudio();
|
autoStartStudio();
|
||||||
checkForBukkitWorlds();
|
checkForBukkitWorlds();
|
||||||
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import com.volmit.iris.core.tools.IrisToolbelt;
|
|||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.object.IrisDimension;
|
import com.volmit.iris.engine.object.IrisDimension;
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||||
import com.volmit.iris.engine.safeguard.ServerBoot;
|
import com.volmit.iris.engine.safeguard.ServerBootSFG;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.decree.DecreeContext;
|
import com.volmit.iris.util.decree.DecreeContext;
|
||||||
import com.volmit.iris.util.decree.DecreeExecutor;
|
import com.volmit.iris.util.decree.DecreeExecutor;
|
||||||
@@ -52,7 +52,7 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import static com.volmit.iris.core.tools.IrisBenchmarking.inProgress;
|
import static com.volmit.iris.core.tools.IrisBenchmarking.inProgress;
|
||||||
import static com.volmit.iris.engine.safeguard.ServerBoot.multiverse;
|
import static com.volmit.iris.engine.safeguard.ServerBootSFG.multiverse;
|
||||||
|
|
||||||
@Decree(name = "iris", aliases = {"ir", "irs"}, description = "Basic Command")
|
@Decree(name = "iris", aliases = {"ir", "irs"}, description = "Basic Command")
|
||||||
public class CommandIris implements DecreeExecutor {
|
public class CommandIris implements DecreeExecutor {
|
||||||
@@ -80,7 +80,7 @@ public class CommandIris implements DecreeExecutor {
|
|||||||
sender().sendMessage(C.RED + "it is strongly advised for you to take action. see log for full detail");
|
sender().sendMessage(C.RED + "it is strongly advised for you to take action. see log for full detail");
|
||||||
Iris.safeguard(C.RED + "----------------------------------------------------------------");
|
Iris.safeguard(C.RED + "----------------------------------------------------------------");
|
||||||
Iris.safeguard(C.RED + "Command ran: /iris create");
|
Iris.safeguard(C.RED + "Command ran: /iris create");
|
||||||
ServerBoot.printincompatiblepluginWarnings();
|
ServerBootSFG.printincompatiblepluginWarnings();
|
||||||
Iris.safeguard(C.RED + "----------------------------------------------------------------");
|
Iris.safeguard(C.RED + "----------------------------------------------------------------");
|
||||||
}
|
}
|
||||||
if (name.equals("iris")) {
|
if (name.equals("iris")) {
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import java.io.IOException;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
import static com.google.common.math.LongMath.isPrime;
|
import static com.google.common.math.LongMath.isPrime;
|
||||||
|
import static com.volmit.iris.util.misc.getHardware.getCPUModel;
|
||||||
|
import static com.volmit.iris.util.misc.getHardware.getDiskModel;
|
||||||
|
|
||||||
public class IrisBenchmarking {
|
public class IrisBenchmarking {
|
||||||
static String ServerOS;
|
static String ServerOS;
|
||||||
@@ -237,29 +239,6 @@ public class IrisBenchmarking {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCPUModel() {
|
|
||||||
try {
|
|
||||||
SystemInfo systemInfo = new SystemInfo();
|
|
||||||
CentralProcessor processor = systemInfo.getHardware().getProcessor();
|
|
||||||
String cpuModel = processor.getProcessorIdentifier().getName();
|
|
||||||
return cpuModel.isEmpty() ? "Unknown CPU Model" : cpuModel;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return "Unknown CPU Model";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDiskModel() {
|
|
||||||
SystemInfo systemInfo = new SystemInfo();
|
|
||||||
List<HWDiskStore> diskStores = systemInfo.getHardware().getDiskStores();
|
|
||||||
if (!diskStores.isEmpty()) {
|
|
||||||
HWDiskStore firstDisk = diskStores.get(0);
|
|
||||||
return firstDisk.getModel();
|
|
||||||
} else {
|
|
||||||
return "Unknown Disk Model";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warningFallback() {
|
public static void warningFallback() {
|
||||||
Iris.info(C.RED + "Using the " + C.DARK_RED + "FALLBACK" + C.RED + " method due to compatibility issues. ");
|
Iris.info(C.RED + "Using the " + C.DARK_RED + "FALLBACK" + C.RED + " method due to compatibility issues. ");
|
||||||
Iris.info(C.RED + "Please note that this may result in less accurate results.");
|
Iris.info(C.RED + "Please note that this may result in less accurate results.");
|
||||||
@@ -645,6 +624,4 @@ public class IrisBenchmarking {
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo JMH BENCHMARKS
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.volmit.iris.core.tools;
|
||||||
|
|
||||||
|
|
||||||
|
public class IrisPackBenchmarking {
|
||||||
|
public static void runBenchmark(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -280,6 +280,7 @@ public class IrisEngineMantle implements EngineMantle {
|
|||||||
x = Math.max(x, c);
|
x = Math.max(x, c);
|
||||||
x = (Math.max(x, 16) + 16) >> 4;
|
x = (Math.max(x, 16) + 16) >> 4;
|
||||||
x = x % 2 == 0 ? x + 1 : x;
|
x = x % 2 == 0 ? x + 1 : x;
|
||||||
|
x = 4;
|
||||||
Iris.info("Mantle Size: " + x + " Chunks");
|
Iris.info("Mantle Size: " + x + " Chunks");
|
||||||
Iris.info(" Object Mantle Size: " + u + " (" + ((Math.max(u, 16) + 16) >> 4) + ")");
|
Iris.info(" Object Mantle Size: " + u + " (" + ((Math.max(u, 16) + 16) >> 4) + ")");
|
||||||
Iris.info(" Jigsaw Mantle Size: " + jig + " (" + ((Math.max(jig, 16) + 16) >> 4) + ")");
|
Iris.info(" Jigsaw Mantle Size: " + jig + " (" + ((Math.max(jig, 16) + 16) >> 4) + ")");
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class IrisSafeguard {
|
|||||||
public static boolean unstablemode = false;
|
public static boolean unstablemode = false;
|
||||||
public static void IrisSafeguardSystem() {
|
public static void IrisSafeguardSystem() {
|
||||||
Iris.info("Enabled Iris SafeGuard");
|
Iris.info("Enabled Iris SafeGuard");
|
||||||
ServerBoot.BootCheck();
|
ServerBootSFG.BootCheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.volmit.iris.engine.safeguard;
|
||||||
|
|
||||||
|
import oshi.SystemInfo;
|
||||||
|
import oshi.hardware.GlobalMemory;
|
||||||
|
|
||||||
|
import static com.volmit.iris.util.misc.getHardware.*;
|
||||||
|
|
||||||
|
public class PerformanceSFG {
|
||||||
|
public static byte CPUPerformanceStage = 3;
|
||||||
|
public void getPerformance(){
|
||||||
|
// Performance Stage 3 = Max Performance, 2=Medium, 1=Low
|
||||||
|
|
||||||
|
SystemInfo systemInfo = new SystemInfo();
|
||||||
|
GlobalMemory globalMemory = systemInfo.getHardware().getMemory();
|
||||||
|
long totalMemoryMB = globalMemory.getTotal() / (1024 * 1024);
|
||||||
|
long availableMemoryMB = globalMemory.getAvailable() / (1024 * 1024);
|
||||||
|
long totalPageSize = globalMemory.getPageSize() / (1024 * 1024);
|
||||||
|
long usedMemoryMB = totalMemoryMB - availableMemoryMB;
|
||||||
|
|
||||||
|
// Todo RePixelated: Finish this
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -10,7 +10,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import static com.volmit.iris.Iris.instance;
|
import static com.volmit.iris.Iris.instance;
|
||||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||||
|
|
||||||
public class ServerBoot {
|
public class ServerBootSFG {
|
||||||
public static boolean multiverse = false;
|
public static boolean multiverse = false;
|
||||||
public static boolean dynmap = false;
|
public static boolean dynmap = false;
|
||||||
public static boolean terraform = false;
|
public static boolean terraform = false;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
package com.volmit.iris.engine.safeguard;
|
package com.volmit.iris.engine.safeguard;
|
||||||
public class SafeguardUtils {
|
public class UtilsSFG {
|
||||||
public static void resetdatapacks(){
|
public static void resetdatapacks(){
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.volmit.iris.util.misc;
|
||||||
|
|
||||||
|
import oshi.SystemInfo;
|
||||||
|
import oshi.hardware.CentralProcessor;
|
||||||
|
import oshi.hardware.HWDiskStore;
|
||||||
|
import oshi.software.os.OperatingSystem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class getHardware {
|
||||||
|
public static String getServerOS() {
|
||||||
|
SystemInfo systemInfo = new SystemInfo();
|
||||||
|
OperatingSystem os = systemInfo.getOperatingSystem();
|
||||||
|
return os.toString();
|
||||||
|
}
|
||||||
|
public static int getCPUThreads(){
|
||||||
|
SystemInfo systemInfo = new SystemInfo();
|
||||||
|
CentralProcessor processor = systemInfo.getHardware().getProcessor();
|
||||||
|
return processor.getLogicalProcessorCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCPUModel() {
|
||||||
|
try {
|
||||||
|
SystemInfo systemInfo = new SystemInfo();
|
||||||
|
CentralProcessor processor = systemInfo.getHardware().getProcessor();
|
||||||
|
String cpuModel = processor.getProcessorIdentifier().getName();
|
||||||
|
return cpuModel.isEmpty() ? "Unknown CPU Model" : cpuModel;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "Unknown CPU Model";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDiskModel() {
|
||||||
|
SystemInfo systemInfo = new SystemInfo();
|
||||||
|
List<HWDiskStore> diskStores = systemInfo.getHardware().getDiskStores();
|
||||||
|
if (!diskStores.isEmpty()) {
|
||||||
|
HWDiskStore firstDisk = diskStores.get(0);
|
||||||
|
return firstDisk.getModel();
|
||||||
|
} else {
|
||||||
|
return "Unknown Disk Model";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user