mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 22:32:04 +00:00
Bug when on intel cpu and unstable mode and changed how SFG works
This commit is contained in:
@@ -770,7 +770,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
};
|
};
|
||||||
String[] splash = unstablemode ? splashunstable : splashstable; // Choose the appropriate splash array based on unstablemode
|
String[] splash = unstablemode ? splashunstable : splashstable; // Choose the appropriate splash array based on unstablemode
|
||||||
|
|
||||||
|
|
||||||
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
|
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
|
||||||
String osArch = osBean.getArch();
|
String osArch = osBean.getArch();
|
||||||
String osName = osBean.getName();
|
String osName = osBean.getName();
|
||||||
@@ -778,17 +777,30 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
if (!passedserversoftware) {
|
if (!passedserversoftware) {
|
||||||
Iris.info("Server type & version: " + C.RED + Bukkit.getVersion());
|
Iris.info("Server type & version: " + C.RED + Bukkit.getVersion());
|
||||||
} else { Iris.info("Server type & version: " + Bukkit.getVersion()); }
|
} else { Iris.info("Server type & version: " + Bukkit.getVersion()); }
|
||||||
|
if (!instance.getServer().getVersion().contains("Purpur")) {
|
||||||
|
if (instance.getServer().getVersion().contains("Spigot") && instance.getServer().getVersion().contains("Bukkit")) {
|
||||||
|
Iris.info(C.RED + " Iris requires paper or above to function properly..");
|
||||||
|
} else {
|
||||||
|
Iris.info(C.YELLOW + "Purpur is recommended to use with iris.");
|
||||||
|
}
|
||||||
|
}
|
||||||
Iris.info("Server OS: " + osName + " (" + osArch + ")");
|
Iris.info("Server OS: " + osName + " (" + osArch + ")");
|
||||||
|
|
||||||
if(unstablemode) Iris.info("Server Cpu: " + C.DARK_RED + getCPUModel());
|
if(unstablemode) Iris.info("Server Cpu: " + C.DARK_RED + getCPUModel());
|
||||||
|
try {
|
||||||
if(getCPUModel().contains("Intel")) Iris.info("Server Cpu: " + C.BLUE + getCPUModel());else {
|
if (getCPUModel().contains("Intel")) {
|
||||||
if (getCPUModel().contains("Ryzen")) Iris.info("Server Cpu: " + C.RED + getCPUModel()); else {
|
Iris.info("Server Cpu: " + C.BLUE + getCPUModel());
|
||||||
Iris.info("Server Cpu: " + C.DARK_GRAY + getCPUModel());
|
|
||||||
}
|
}
|
||||||
|
if (getCPUModel().contains("Ryzen")) {
|
||||||
|
Iris.info("Server Cpu: " + C.RED + getCPUModel());
|
||||||
|
}
|
||||||
|
if (!getCPUModel().contains("Ryzen") && !getCPUModel().contains("Intel")) {
|
||||||
|
Iris.info("Server Cpu: " + C.GRAY + getCPUModel());
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e){
|
||||||
|
Iris.info("Server Cpu: " + C.DARK_RED + "Failed");
|
||||||
}
|
}
|
||||||
if(!getCPUModel().contains("Intel") && !getCPUModel().contains("Ryzen")) Iris.info("Server Cpu: " + C.DARK_GRAY + getCPUModel());
|
|
||||||
|
|
||||||
Iris.info("Process Threads: " + getCPUThreads());
|
Iris.info("Process Threads: " + getCPUThreads());
|
||||||
Iris.info("Process Memory: " + getHardware.getProcessMemory() + " MB");
|
Iris.info("Process Memory: " + getHardware.getProcessMemory() + " MB");
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.volmit.iris.util.format.C;
|
|||||||
|
|
||||||
public class IrisSafeguard {
|
public class IrisSafeguard {
|
||||||
public static boolean unstablemode = false;
|
public static boolean unstablemode = false;
|
||||||
|
public static boolean stablemode = false;
|
||||||
public static void IrisSafeguardSystem() {
|
public static void IrisSafeguardSystem() {
|
||||||
Iris.info("Enabled Iris SafeGuard");
|
Iris.info("Enabled Iris SafeGuard");
|
||||||
ServerBootSFG.BootCheck();
|
ServerBootSFG.BootCheck();
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
package com.volmit.iris.core.safeguard;
|
package com.volmit.iris.core.safeguard;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
|
||||||
import com.volmit.iris.core.nms.INMS;
|
import com.volmit.iris.core.nms.INMS;
|
||||||
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
|
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
|
||||||
import com.volmit.iris.util.SFG.WorldHandlerSFG;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.volmit.iris.Iris.instance;
|
import static com.volmit.iris.Iris.instance;
|
||||||
|
import static com.volmit.iris.core.safeguard.IrisSafeguard.stablemode;
|
||||||
import static com.volmit.iris.core.safeguard.IrisSafeguard.unstablemode;
|
import static com.volmit.iris.core.safeguard.IrisSafeguard.unstablemode;
|
||||||
import static com.volmit.iris.core.tools.IrisToolbelt.access;
|
|
||||||
|
|
||||||
public class ServerBootSFG {
|
public class ServerBootSFG {
|
||||||
public static final Map<String, Boolean> incompatiblePlugins = new HashMap<>();
|
public static final Map<String, Boolean> incompatiblePlugins = new HashMap<>();
|
||||||
public static boolean unsuportedversion = false;
|
public static boolean unsuportedversion = false;
|
||||||
protected static boolean safeguardPassed;
|
protected static boolean safeguardPassed;
|
||||||
public static boolean passedserversoftware = true;
|
public static boolean passedserversoftware = true;
|
||||||
protected static byte count;
|
protected static int count;
|
||||||
|
protected static byte severityLow;
|
||||||
|
protected static byte severityMedium;
|
||||||
|
protected static byte severityHigh;
|
||||||
public static String allIncompatiblePlugins;
|
public static String allIncompatiblePlugins;
|
||||||
|
|
||||||
public static void BootCheck() {
|
public static void BootCheck() {
|
||||||
@@ -40,7 +39,7 @@ public class ServerBootSFG {
|
|||||||
pluginName = plugin.getName();
|
pluginName = plugin.getName();
|
||||||
Boolean flag = incompatiblePlugins.get(pluginName);
|
Boolean flag = incompatiblePlugins.get(pluginName);
|
||||||
if (flag != null && !flag) {
|
if (flag != null && !flag) {
|
||||||
count++;
|
severityHigh++;
|
||||||
incompatiblePlugins.put(pluginName, true);
|
incompatiblePlugins.put(pluginName, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,17 +59,22 @@ public class ServerBootSFG {
|
|||||||
{
|
{
|
||||||
passedserversoftware = false;
|
passedserversoftware = false;
|
||||||
joiner.add("Server Software");
|
joiner.add("Server Software");
|
||||||
count++;
|
severityHigh++;
|
||||||
}
|
}
|
||||||
if (INMS.get() instanceof NMSBinding1X) {
|
if (INMS.get() instanceof NMSBinding1X) {
|
||||||
unsuportedversion = true;
|
unsuportedversion = true;
|
||||||
joiner.add("Unsupported Minecraft Version");
|
joiner.add("Unsupported Minecraft Version");
|
||||||
count++;
|
severityHigh++;
|
||||||
}
|
}
|
||||||
|
|
||||||
allIncompatiblePlugins = joiner.toString();
|
allIncompatiblePlugins = joiner.toString();
|
||||||
|
|
||||||
safeguardPassed = (count == 0);
|
safeguardPassed = (severityHigh == 0 && severityMedium == 0 && severityLow == 0);
|
||||||
|
count = severityHigh + severityMedium + severityLow;
|
||||||
|
if(safeguardPassed){
|
||||||
|
stablemode = true;
|
||||||
|
Iris.safeguard("Stable mode has been activated.");
|
||||||
|
}
|
||||||
if(!safeguardPassed){
|
if(!safeguardPassed){
|
||||||
unstablemode = true;
|
unstablemode = true;
|
||||||
Iris.safeguard("Unstable mode has been activated.");
|
Iris.safeguard("Unstable mode has been activated.");
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.volmit.iris.core.safeguard;
|
||||||
|
|
||||||
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.core.IrisSettings;
|
||||||
|
import com.volmit.iris.util.format.C;
|
||||||
|
|
||||||
|
public class UnstableModeSFG {
|
||||||
|
public static void selectMode(){
|
||||||
|
if (IrisSafeguard.unstablemode) {
|
||||||
|
Iris.safeguard(C.DARK_RED + "Iris is running in Unstable Mode");
|
||||||
|
unstable();
|
||||||
|
} else {
|
||||||
|
stable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void stable(){
|
||||||
|
Iris.safeguard(C.BLUE + "Iris is running Stable");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void unstable() {
|
||||||
|
|
||||||
|
UtilsSFG.printIncompatibleWarnings();
|
||||||
|
|
||||||
|
if (IrisSafeguard.unstablemode) {
|
||||||
|
Iris.info("");
|
||||||
|
Iris.info(C.DARK_GRAY + "--==<" + C.RED + " IMPORTANT " + C.DARK_GRAY + ">==--");
|
||||||
|
Iris.info(C.RED + "Iris is running in unstable mode which may cause the following issues:");
|
||||||
|
Iris.info(C.DARK_RED + "Server Issues");
|
||||||
|
Iris.info(C.RED + "- Server won't boot");
|
||||||
|
Iris.info(C.RED + "- Data Loss");
|
||||||
|
Iris.info(C.RED + "- Unexpected behavior.");
|
||||||
|
Iris.info(C.RED + "- And More...");
|
||||||
|
Iris.info(C.DARK_RED + "World Issues");
|
||||||
|
Iris.info(C.RED + "- Worlds can't load due to corruption.");
|
||||||
|
Iris.info(C.RED + "- Worlds may slowly corrupt until they can't load.");
|
||||||
|
Iris.info(C.RED + "- World data loss.");
|
||||||
|
Iris.info(C.RED + "- And More...");
|
||||||
|
Iris.info(C.DARK_RED + "ATTENTION: " + C.RED + "While running Iris in unstable mode, you won't be eligible for support.");
|
||||||
|
Iris.info(C.DARK_RED + "CAUSE: " + C.RED + UtilsSFG.MSGIncompatibleWarnings());
|
||||||
|
|
||||||
|
if (IrisSettings.get().getGeneral().bootUnstable) {
|
||||||
|
Iris.info(C.DARK_RED + "Boot Unstable is set to true, continuing with the startup process.");
|
||||||
|
} else {
|
||||||
|
Iris.info(C.DARK_RED + "Go to plugins/iris/settings.json and set ignoreUnstable to true if you wish to proceed.");
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// Handle interruption
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Iris.info("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,29 +1,13 @@
|
|||||||
package com.volmit.iris.core.safeguard;
|
package com.volmit.iris.core.safeguard;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
|
||||||
import com.volmit.iris.util.format.C;
|
import com.volmit.iris.util.format.C;
|
||||||
|
|
||||||
public class UtilsSFG {
|
public class UtilsSFG {
|
||||||
public static void splash(){
|
public static void splash(){
|
||||||
UtilsSFG.unstableMode();
|
UnstableModeSFG.selectMode();
|
||||||
UtilsSFG.supportedServerSoftware();
|
|
||||||
UtilsSFG.printIncompatibleWarnings();
|
|
||||||
UtilsSFG.unstablePrompt();
|
|
||||||
}
|
|
||||||
public static void unstableMode(){
|
|
||||||
if (IrisSafeguard.unstablemode) {
|
|
||||||
Iris.safeguard(C.DARK_RED + "Iris is running in Unstable Mode");
|
|
||||||
} else {
|
|
||||||
Iris.safeguard(C.BLUE + "Iris is running Stable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static void supportedServerSoftware(){
|
|
||||||
if (!ServerBootSFG.passedserversoftware) {
|
|
||||||
Iris.safeguard(C.DARK_RED + "Server is running unsupported server software");
|
|
||||||
Iris.safeguard(C.RED + "Supported: Purpur, Pufferfish, Paper, Spigot, Bukkit");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printIncompatibleWarnings(){
|
public static void printIncompatibleWarnings(){
|
||||||
// String SupportedIrisVersion = getDescription().getVersion(); //todo Automatic version
|
// String SupportedIrisVersion = getDescription().getVersion(); //todo Automatic version
|
||||||
|
|
||||||
@@ -31,7 +15,6 @@ public class UtilsSFG {
|
|||||||
Iris.safeguard(C.BLUE + "0 Conflicts found");
|
Iris.safeguard(C.BLUE + "0 Conflicts found");
|
||||||
} else {
|
} else {
|
||||||
Iris.safeguard(C.DARK_RED + "" + ServerBootSFG.count + " Conflicts found");
|
Iris.safeguard(C.DARK_RED + "" + ServerBootSFG.count + " Conflicts found");
|
||||||
IrisSafeguard.unstablemode = true;
|
|
||||||
|
|
||||||
if (ServerBootSFG.incompatiblePlugins.get("Multiverse-Core")) {
|
if (ServerBootSFG.incompatiblePlugins.get("Multiverse-Core")) {
|
||||||
Iris.safeguard(C.RED + "Multiverse");
|
Iris.safeguard(C.RED + "Multiverse");
|
||||||
@@ -62,41 +45,4 @@ public class UtilsSFG {
|
|||||||
public static String MSGIncompatibleWarnings() {
|
public static String MSGIncompatibleWarnings() {
|
||||||
return ServerBootSFG.allIncompatiblePlugins;
|
return ServerBootSFG.allIncompatiblePlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void unstablePrompt() {
|
|
||||||
if (IrisSafeguard.unstablemode) {
|
|
||||||
Iris.info("");
|
|
||||||
Iris.info(C.DARK_GRAY + "--==<" + C.RED + " IMPORTANT " + C.DARK_GRAY + ">==--");
|
|
||||||
Iris.info(C.RED + "Iris is running in unstable mode what may cause the following issues.");
|
|
||||||
Iris.info(C.DARK_RED + "Server Issues");
|
|
||||||
Iris.info(C.RED + "- Server wont boot");
|
|
||||||
Iris.info(C.RED + "- Data Loss");
|
|
||||||
Iris.info(C.RED + "- Unexpected behavior.");
|
|
||||||
Iris.info(C.RED + "- And More..");
|
|
||||||
Iris.info(C.DARK_RED + "World Issues");
|
|
||||||
Iris.info(C.RED + "- Worlds cant load due to corruption..");
|
|
||||||
Iris.info(C.RED + "- Worlds may slowly corrupt till they wont be able to load.");
|
|
||||||
Iris.info(C.RED + "- World data loss.");
|
|
||||||
Iris.info(C.RED + "- And More..");
|
|
||||||
Iris.info(C.DARK_RED + "ATTENTION:" + C.RED + " While running iris in unstable mode you wont be eligible for support.");
|
|
||||||
Iris.info(C.DARK_RED + "CAUSE: " + C.RED + MSGIncompatibleWarnings());
|
|
||||||
Iris.info("");
|
|
||||||
if (IrisSettings.get().getGeneral().bootUnstable) {
|
|
||||||
Iris.info(C.DARK_RED + "Boot Unstable is set to true, continuing with the startup process.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IrisSettings.get().getGeneral().isBootUnstable()) {
|
|
||||||
Iris.info(C.DARK_RED + "Go to plugins/iris/settings.json and set ignoreUnstable to true if you wish to proceed.");
|
|
||||||
while (true) {
|
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
// No
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Iris.info("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user