mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-01-04 15:41:30 +00:00
thx coco
This commit is contained in:
@@ -465,9 +465,9 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
J.s(this::setupPapi);
|
||||
J.a(ServerConfigurator::configure, 20);
|
||||
splash();
|
||||
ServerBoot.unstablemode();
|
||||
ServerBoot.supportedserversoftware();
|
||||
ServerBoot.incompatiblepluginset();
|
||||
ServerBoot.UnstableMode();
|
||||
ServerBoot.SupportedServerSoftware();
|
||||
ServerBoot.printincompatiblepluginWarnings();
|
||||
autoStartStudio();
|
||||
checkForBukkitWorlds();
|
||||
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
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 + "Command ran: /iris create");
|
||||
ServerBoot.incompatiblepluginset();
|
||||
ServerBoot.printincompatiblepluginWarnings();
|
||||
Iris.safeguard(C.RED + "----------------------------------------------------------------");
|
||||
}
|
||||
if (name.equals("iris")) {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
String worldNameToCheck = "YourWorldName";
|
||||
VolmitSender sender = Iris.getSender();
|
||||
@Decree(description = "Unload an Iris World", origin = DecreeOrigin.PLAYER, sync = true)
|
||||
public void unloadworld(
|
||||
public void unloadWorld(
|
||||
@Param(description = "The world to unload")
|
||||
World world
|
||||
) {
|
||||
@@ -76,7 +76,7 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
}
|
||||
|
||||
@Decree(description = "Load an Iris World", origin = DecreeOrigin.PLAYER, sync = true, aliases = {"import"})
|
||||
public void loadworld(
|
||||
public void loadWorld(
|
||||
@Param(description = "The name of the world to load")
|
||||
String world
|
||||
) {
|
||||
@@ -89,7 +89,6 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
sender().sendMessage(C.YELLOW + world + " Doesnt exist on the server.");
|
||||
return;
|
||||
}
|
||||
|
||||
WorldToLoad = world;
|
||||
File BUKKIT_YML = new File("bukkit.yml");
|
||||
String pathtodim = world + "\\iris\\pack\\dimensions\\";
|
||||
@@ -130,7 +129,6 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
}
|
||||
checkForBukkitWorlds();
|
||||
sender().sendMessage(C.GREEN + world + " loaded successfully.");
|
||||
|
||||
}
|
||||
@Decree(description = "Evacuate an iris world", origin = DecreeOrigin.PLAYER, sync = true)
|
||||
public void evacuate(
|
||||
@@ -143,7 +141,6 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
}
|
||||
sender().sendMessage(C.GREEN + "Evacuating world" + world.getName());
|
||||
IrisToolbelt.evacuate(world);
|
||||
|
||||
}
|
||||
@Decree(description = "Remove an Iris world", aliases = {"del", "rm"}, sync = true)
|
||||
public void remove(
|
||||
@@ -177,8 +174,7 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean doesWorldExist(String worldName) {
|
||||
boolean doesWorldExist(String worldName) {
|
||||
File worldContainer = Bukkit.getWorldContainer();
|
||||
File worldDirectory = new File(worldContainer, worldName);
|
||||
return worldDirectory.exists() && worldDirectory.isDirectory();
|
||||
@@ -198,12 +194,10 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
if (!worldsToLoad.contains(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ConfigurationSection entry = section.getConfigurationSection(s);
|
||||
if (!entry.contains("generator", true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String generator = entry.getString("generator");
|
||||
if (generator.startsWith("Iris:")) {
|
||||
generator = generator.split("\\Q:\\E")[1];
|
||||
@@ -212,13 +206,10 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
Iris.info("2 World: %s | Generator: %s", s, generator);
|
||||
|
||||
if (Bukkit.getWorlds().stream().anyMatch(w -> w.getName().equals(s))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Iris.info(C.LIGHT_PURPLE + "Preparing Spawn for " + s + "' using Iris:" + generator + "...");
|
||||
new WorldCreator(s)
|
||||
.generator(getDefaultWorldGenerator(s, generator))
|
||||
@@ -230,7 +221,6 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||
Iris.debug("Default World Generator Called for " + worldName + " using ID: " + id);
|
||||
if (worldName.equals("test")) {
|
||||
@@ -244,8 +234,6 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IrisDimension dim;
|
||||
if (id == null || id.isEmpty()) {
|
||||
dim = IrisData.loadAnyDimension(IrisSettings.get().getGenerator().getDefaultWorldType());
|
||||
@@ -266,9 +254,7 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
Iris.info("Resolved missing dimension, proceeding with generation.");
|
||||
}
|
||||
}
|
||||
|
||||
Iris.debug("Assuming IrisDimension: " + dim.getName());
|
||||
|
||||
IrisWorld w = IrisWorld.builder()
|
||||
.name(worldName)
|
||||
.seed(1337)
|
||||
@@ -277,15 +263,12 @@ public class CommandWorldManager implements DecreeExecutor {
|
||||
.minHeight(dim.getMinHeight())
|
||||
.maxHeight(dim.getMaxHeight())
|
||||
.build();
|
||||
|
||||
Iris.debug("Generator Config: " + w.toString());
|
||||
|
||||
File ff = new File(w.worldFolder(), "iris/pack");
|
||||
if (!ff.exists() || ff.listFiles().length == 0) {
|
||||
ff.mkdirs();
|
||||
service(StudioSVC.class).installIntoWorld(sender, dim.getLoadKey(), ff.getParentFile());
|
||||
}
|
||||
|
||||
return new BukkitChunkGenerator(w, false, ff, dim.getLoadKey());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public class IrisSafeguard {
|
||||
public static boolean unstablemode = false;
|
||||
public static void IrisSafeguardSystem() {
|
||||
Iris.info("Enabled Iris SafeGuard");
|
||||
ServerBoot.bootcheck();
|
||||
ServerBoot.BootCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package com.volmit.iris.engine.safeguard;
|
||||
|
||||
public class SafeguardUtils {
|
||||
public static void resetdatapacks(){
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ServerBoot {
|
||||
public static boolean passedserversoftware = true;
|
||||
protected static byte count;
|
||||
|
||||
public static void bootcheck() {
|
||||
public static void BootCheck() {
|
||||
Iris.info("Checking for possible conflicts..");
|
||||
org.bukkit.plugin.PluginManager pluginManager = Bukkit.getPluginManager();
|
||||
Plugin[] plugins = pluginManager.getPlugins();
|
||||
@@ -74,20 +74,20 @@ public class ServerBoot {
|
||||
Iris.safeguard(pluginList.toString());
|
||||
|
||||
}
|
||||
public static void unstablemode(){
|
||||
public static void UnstableMode(){
|
||||
if (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(){
|
||||
public static void SupportedServerSoftware(){
|
||||
if (!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 incompatiblepluginset(){
|
||||
public static void printincompatiblepluginWarnings(){
|
||||
|
||||
if (safeguardPassed) {
|
||||
Iris.safeguard(C.BLUE + "0 Conflicts found");
|
||||
|
||||
Reference in New Issue
Block a user