mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 15:56:27 +00:00
A lot of cleanup
This commit is contained in:
@@ -471,7 +471,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
splash();
|
||||
UtilsSFG.UnstableMode();
|
||||
UtilsSFG.SupportedServerSoftware();
|
||||
UtilsSFG.printIncompatiblePluginWarnings();
|
||||
UtilsSFG.printIncompatibleWarnings();
|
||||
UtilsSFG.unstablePrompt();
|
||||
if(IrisSettings.get().getGeneral().useIntegratedChunkHandler) {
|
||||
chunkHandlerSVC = new ChunkHandlerSVC(this);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package com.volmit.iris.core.commands;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.service.ChunkHandlerSVC;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
import com.volmit.iris.core.tools.IrisBenchmarking;
|
||||
@@ -55,7 +54,7 @@ import java.util.concurrent.Future;
|
||||
|
||||
import static com.volmit.iris.core.tools.IrisBenchmarking.inProgress;
|
||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||
import static com.volmit.iris.engine.safeguard.ServerBootSFG.multiverse;
|
||||
import static com.volmit.iris.engine.safeguard.ServerBootSFG.incompatiblePlugins;
|
||||
|
||||
@Decree(name = "iris", aliases = {"ir", "irs"}, description = "Basic Command")
|
||||
public class CommandIris implements DecreeExecutor {
|
||||
@@ -81,7 +80,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
long seed
|
||||
) {
|
||||
if(sender() instanceof Player) {
|
||||
if (multiverse) {
|
||||
if (incompatiblePlugins.get("Multiverse-Core")) {
|
||||
sender().sendMessage(C.RED + "Your server has an incompatibility that may corrupt all worlds on the server if not handled properly.");
|
||||
sender().sendMessage(C.RED + "it is strongly advised for you to take action. see log for full detail");
|
||||
sender().sendMessage(C.RED + "----------------------------------------------------------------");
|
||||
@@ -89,7 +88,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
sender().sendMessage(C.RED + UtilsSFG.MSGIncompatibleWarnings());
|
||||
sender().sendMessage(C.RED + "----------------------------------------------------------------");
|
||||
}
|
||||
if (unstablemode && !multiverse) {
|
||||
if (unstablemode && !incompatiblePlugins.get("Multiverse-Core")) {
|
||||
sender().sendMessage(C.RED + "Your server is experiencing an incompatibility with the Iris plugin.");
|
||||
sender().sendMessage(C.RED + "Please rectify this problem to avoid further complications.");
|
||||
sender().sendMessage(C.RED + "----------------------------------------------------------------");
|
||||
@@ -191,7 +190,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
Iris.info(C.RED + "Please rectify this problem to avoid further complications.");
|
||||
Iris.info(C.RED + "----------------------------------------------------------------");
|
||||
Iris.info(C.RED + "Command ran: /iris fixunstable");
|
||||
UtilsSFG.printIncompatiblePluginWarnings();
|
||||
UtilsSFG.printIncompatibleWarnings();
|
||||
Iris.info(C.RED + "----------------------------------------------------------------");
|
||||
} else {
|
||||
Iris.info(C.BLUE + "Iris is running stable..");
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.volmit.iris.core.pregenerator.PregenTask;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.engine.safeguard.ServerBootSFG;
|
||||
import com.volmit.iris.engine.safeguard.UtilsSFG;
|
||||
import com.volmit.iris.util.exceptions.IrisException;
|
||||
import com.volmit.iris.util.format.C;
|
||||
@@ -48,7 +47,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.volmit.iris.core.tools.IrisPackBenchmarking.benchmark;
|
||||
import static com.volmit.iris.core.tools.IrisPackBenchmarking.loaded;
|
||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||
|
||||
/**
|
||||
@@ -115,7 +113,7 @@ public class IrisCreator {
|
||||
Iris.info(C.RED + "Your server is experiencing an incompatibility with the Iris plugin. Please rectify this problem to avoid further complications.");
|
||||
Iris.info(C.RED + "----------------------------------------------------------------");
|
||||
Iris.info(C.RED + "Operation ran: Loading Iris World..");
|
||||
UtilsSFG.printIncompatiblePluginWarnings();
|
||||
UtilsSFG.printIncompatibleWarnings();
|
||||
Iris.info(C.RED + "----------------------------------------------------------------");
|
||||
}
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
|
||||
@@ -8,58 +8,50 @@ import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static com.volmit.iris.Iris.dump;
|
||||
import static com.volmit.iris.Iris.instance;
|
||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||
@Getter
|
||||
|
||||
public class ServerBootSFG {
|
||||
public static boolean multiverse = false;
|
||||
public static boolean dynmap = false;
|
||||
public static boolean terraform = false;
|
||||
public static boolean stratos = false;
|
||||
public static final Map<String, Boolean> incompatiblePlugins = new HashMap<>();
|
||||
public static boolean unsuportedversion = false;
|
||||
protected static boolean safeguardPassed;
|
||||
public static boolean passedserversoftware = true;
|
||||
protected static byte count;
|
||||
public static String allIncompatiblePlugins;
|
||||
|
||||
public static void BootCheck() {
|
||||
Iris.info("Checking for possible conflicts..");
|
||||
org.bukkit.plugin.PluginManager pluginManager = Bukkit.getPluginManager();
|
||||
Plugin[] plugins = pluginManager.getPlugins();
|
||||
if (INMS.get() instanceof NMSBinding1X) {
|
||||
unsuportedversion = true;
|
||||
count++;
|
||||
}
|
||||
|
||||
// Why am i doing this again?
|
||||
Map<String, Boolean> incompatiblePlugins = new HashMap<>();
|
||||
incompatiblePlugins.put("Multiverse-Core", multiverse);
|
||||
incompatiblePlugins.put("Dynmap", dynmap);
|
||||
incompatiblePlugins.put("TerraformGenerator", terraform);
|
||||
incompatiblePlugins.put("Stratos", stratos);
|
||||
|
||||
StringBuilder pluginList = new StringBuilder("Plugin list: ");
|
||||
count = 0;
|
||||
incompatiblePlugins.clear();
|
||||
incompatiblePlugins.put("Multiverse-Core", false);
|
||||
incompatiblePlugins.put("Dynmap", false);
|
||||
incompatiblePlugins.put("TerraformGenerator", false);
|
||||
incompatiblePlugins.put("Stratos", false);
|
||||
|
||||
String pluginName;
|
||||
for (Plugin plugin : plugins) {
|
||||
String pluginName = plugin.getName();
|
||||
pluginName = plugin.getName();
|
||||
Boolean flag = incompatiblePlugins.get(pluginName);
|
||||
Iris.info("T65: " + pluginName);
|
||||
if (flag != null && !flag) {
|
||||
count++;
|
||||
incompatiblePlugins.put(pluginName, true);
|
||||
}
|
||||
// pluginList.append(pluginName).append(", ");
|
||||
// Iris.safeguard(pluginList.toString());
|
||||
}
|
||||
Iris.info("TEST:" + multiverse);
|
||||
|
||||
Iris.info("TEST: " + incompatiblePlugins.get("Multiverse-Core"));
|
||||
|
||||
StringJoiner joiner = new StringJoiner(", ");
|
||||
for (Map.Entry<String, Boolean> entry : incompatiblePlugins.entrySet()) {
|
||||
if (entry.getValue()) {
|
||||
joiner.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
if (
|
||||
!instance.getServer().getVersion().contains("Purpur") &&
|
||||
!instance.getServer().getVersion().contains("Paper") &&
|
||||
@@ -68,8 +60,17 @@ public class ServerBootSFG {
|
||||
!instance.getServer().getVersion().contains("Bukkit"))
|
||||
{
|
||||
passedserversoftware = false;
|
||||
joiner.add("Server Software");
|
||||
count++;
|
||||
}
|
||||
if (INMS.get() instanceof NMSBinding1X) {
|
||||
unsuportedversion = true;
|
||||
joiner.add("Unsupported Minecraft Version");
|
||||
count++;
|
||||
}
|
||||
|
||||
allIncompatiblePlugins = joiner.toString();
|
||||
Iris.info("All Incompatible Plugins: " + allIncompatiblePlugins);
|
||||
|
||||
safeguardPassed = (count == 0);
|
||||
if(!safeguardPassed){
|
||||
|
||||
@@ -3,17 +3,9 @@ package com.volmit.iris.engine.safeguard;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
import static com.volmit.iris.engine.safeguard.IrisSafeguard.unstablemode;
|
||||
import static com.volmit.iris.engine.safeguard.ServerBootSFG.*;
|
||||
import static org.bukkit.Bukkit.getLogger;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class UtilsSFG {
|
||||
public static void UnstableMode(){
|
||||
@@ -29,7 +21,7 @@ public class UtilsSFG {
|
||||
Iris.safeguard(C.RED + "Supported: Purpur, Pufferfish, Paper, Spigot, Bukkit");
|
||||
}
|
||||
}
|
||||
public static void printIncompatiblePluginWarnings(){
|
||||
public static void printIncompatibleWarnings(){
|
||||
// String SupportedIrisVersion = getDescription().getVersion(); //todo Automatic version
|
||||
|
||||
if (safeguardPassed) {
|
||||
@@ -38,17 +30,17 @@ public class UtilsSFG {
|
||||
Iris.safeguard(C.DARK_RED + "" + count + " Conflicts found");
|
||||
unstablemode = true;
|
||||
|
||||
if (multiverse) {
|
||||
if (incompatiblePlugins.get("Multiverse-Core")) {
|
||||
Iris.safeguard(C.RED + "Multiverse");
|
||||
Iris.safeguard(C.RED + "- The plugin Multiverse is not compatible with the server.");
|
||||
Iris.safeguard(C.RED + "- If you want to have a world manager, consider using PhantomWorlds or MyWorlds instead.");
|
||||
}
|
||||
if (dynmap) {
|
||||
if (incompatiblePlugins.get("Dynmap")) {
|
||||
Iris.safeguard(C.RED + "Dynmap");
|
||||
Iris.safeguard(C.RED + "- The plugin Dynmap is not compatible with the server.");
|
||||
Iris.safeguard(C.RED + "- If you want to have a map plugin like Dynmap, consider Bluemap or LiveAtlas.");
|
||||
}
|
||||
if (terraform || stratos) {
|
||||
if (incompatiblePlugins.get("TerraformGenerator") || incompatiblePlugins.get("Stratos")) {
|
||||
Iris.safeguard(C.YELLOW + "Terraform Generator / Stratos");
|
||||
Iris.safeguard(C.YELLOW + "- Iris is not compatible with other worldgen plugins.");
|
||||
}
|
||||
@@ -64,50 +56,11 @@ public class UtilsSFG {
|
||||
}
|
||||
}
|
||||
|
||||
public static String MSGIncompatibleWarnings(){
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
List<String> incompatibleList = new ArrayList<>();
|
||||
|
||||
if (multiverse) {
|
||||
String incompatibility1 = "Multiverse";
|
||||
stringBuilder.append(incompatibility1).append(", ");
|
||||
incompatibleList.add(incompatibility1);
|
||||
}
|
||||
if(dynmap) {
|
||||
String incompatibility2 = "Dynmap";
|
||||
stringBuilder.append(incompatibility2).append(", ");
|
||||
incompatibleList.add(incompatibility2);
|
||||
}
|
||||
if (terraform) {
|
||||
String incompatibility3 = "Terraform";
|
||||
stringBuilder.append(incompatibility3).append(", ");
|
||||
incompatibleList.add(incompatibility3);
|
||||
}
|
||||
if(stratos){
|
||||
String incompatibility4 = "Stratos";
|
||||
stringBuilder.append(incompatibility4).append(", ");
|
||||
incompatibleList.add(incompatibility4);
|
||||
|
||||
}
|
||||
if(unsuportedversion){
|
||||
String incompatibility5 = "Server Version";
|
||||
stringBuilder.append(incompatibility5).append(", ");
|
||||
incompatibleList.add(incompatibility5);
|
||||
|
||||
}
|
||||
if(!passedserversoftware){
|
||||
String incompatibility6 = "Server Software";
|
||||
stringBuilder.append(incompatibility6).append(", ");
|
||||
incompatibleList.add(incompatibility6);
|
||||
|
||||
}
|
||||
|
||||
String MSGIncompatiblePlugins = stringBuilder.toString();
|
||||
return MSGIncompatiblePlugins;
|
||||
|
||||
public static String MSGIncompatibleWarnings() {
|
||||
return allIncompatiblePlugins;
|
||||
}
|
||||
|
||||
|
||||
public static void unstablePrompt(){
|
||||
Iris.info("");
|
||||
Iris.info(C.DARK_GRAY + "--==<" + C.RED +" IMPORTANT " + C.DARK_GRAY + ">==--");
|
||||
@@ -123,17 +76,11 @@ public class UtilsSFG {
|
||||
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(C.DARK_RED + "CAUSES: " + 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.");
|
||||
}
|
||||
/*while (true) {
|
||||
Iris.info("test2");
|
||||
if(IrisSettings.get().getGeneral().isBootUnstable()){
|
||||
Iris.info("AAAAAAAAAAAAAAAAAAA");
|
||||
}
|
||||
} */
|
||||
|
||||
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.");
|
||||
|
||||
Reference in New Issue
Block a user