2020-08-03 18:48:42 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2020-08-07 02:59:57 +02:00
From: tr7zw <tr7zw@live.de>
2020-08-05 15:21:25 +02:00
Date: Wed, 5 Aug 2020 08:17:46 -0500
2020-08-03 18:48:42 +02:00
Subject: [PATCH] Redirect Configs
2020-08-05 15:21:25 +02:00
diff --git a/src/main/java/com/proximyst/rainforest/RainforestConfig.java b/src/main/java/com/proximyst/rainforest/RainforestConfig.java
2020-08-11 17:38:17 +02:00
index 0d854bda9611b45d78815f9fe9cafb8901de210f..c4092282040d4e7cd960b6922feb8b179a6a8ada 100644
2020-08-05 15:21:25 +02:00
--- a/src/main/java/com/proximyst/rainforest/RainforestConfig.java
+++ b/src/main/java/com/proximyst/rainforest/RainforestConfig.java
2020-08-11 17:38:17 +02:00
@@ -37,6 +37,8 @@ public final class RainforestConfig {
2020-08-05 15:21:25 +02:00
private static boolean fatalError;
public static void init(File configFile) {
2020-08-11 17:38:17 +02:00
+ // Yatopia start
+ /*
CONFIG_FILE = configFile;
config = new YamlConfiguration();
2020-08-05 15:21:25 +02:00
try {
2020-08-11 17:38:17 +02:00
@@ -56,7 +58,13 @@ public final class RainforestConfig {
2020-08-05 15:21:25 +02:00
version = getInt("config-version", 1);
set("config-version", 1);
- readConfig(RainforestConfig.class, null);
2020-08-11 17:38:17 +02:00
+ */
+ config = dev.tr7zw.yatopia.YatopiaConfig.config;
+ CONFIG_FILE = dev.tr7zw.yatopia.YatopiaConfig.CONFIG_FILE;
+ verbose = dev.tr7zw.yatopia.YatopiaConfig.verbose;
+ version = dev.tr7zw.yatopia.YatopiaConfig.version;
+ //readConfig(RainforestConfig.class, null); // todo: when options actually get ported, uncomment this
+ // Yatopia end
2020-08-05 15:21:25 +02:00
}
protected static void logError(String s) {
2020-08-11 17:38:17 +02:00
diff --git a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java
index 22d920686418e86aec8be37f125123682af023a3..081a5344b86e300ae7aa722b9b0ca84c77844e49 100644
--- a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java
+++ b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java
@@ -22,7 +22,7 @@ public final class RainforestWorldConfig {
public void init() {
log("-------- World Settings For [" + worldName + "] --------");
- RainforestConfig.readConfig(RainforestWorldConfig.class, this);
+ //RainforestConfig.readConfig(RainforestWorldConfig.class, this); // Yatopia - todo: when options are ported, uncomment this
}
private void set(String path, Object val) {
2020-08-03 21:25:54 +02:00
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
2020-08-13 17:53:32 +02:00
index 3d71ee447b0d45c50ed6f2f17ad5184d28d3bc08..965cc06a826c7d827e6b9a9e586738bfddc974d8 100644
2020-08-03 21:25:54 +02:00
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
2020-08-11 17:38:17 +02:00
@@ -20,6 +20,8 @@ public final class OrigamiConfig {
2020-08-03 21:25:54 +02:00
private static int configVersion;
public static void init(final File file) {
2020-08-11 17:38:17 +02:00
+ // Yatopia start
+ /*
OrigamiConfig.configFile = file;
2020-08-03 21:25:54 +02:00
OrigamiConfig.config = new YamlConfiguration();
config.options().header(CONFIG_HEADER);
2020-08-11 17:38:17 +02:00
@@ -39,13 +41,16 @@ public final class OrigamiConfig {
2020-08-03 21:25:54 +02:00
System.out.println("Failure to load origami config");
throw new RuntimeException(ex);
}
- }
2020-08-11 17:38:17 +02:00
-
- OrigamiConfig.load(OrigamiConfig.class, null);
2020-08-03 21:25:54 +02:00
+ }*/
2020-08-11 17:38:17 +02:00
+ config = dev.tr7zw.yatopia.YatopiaConfig.config;
+ configFile = dev.tr7zw.yatopia.YatopiaConfig.CONFIG_FILE;
+ configVersion = dev.tr7zw.yatopia.YatopiaConfig.version;
+ //OrigamiConfig.load(OrigamiConfig.class, null); // todo: uncomment when config options are ported
+ // Yatopia end
2020-08-03 21:25:54 +02:00
}
2020-08-11 17:38:17 +02:00
public static void load(Class<?> clazz, Object instance) {
- OrigamiConfig.configVersion = OrigamiConfig.getInt("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION);
+ //OrigamiConfig.configVersion = OrigamiConfig.getInt("config-version-please-do-not-modify-me", CURRENT_CONFIG_VERSION); // Yatopia - NO
for (final Method method : clazz.getDeclaredMethods()) {
if (method.getReturnType() != void.class || method.getParameterCount() != 0 ||
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
2020-08-13 17:53:32 +02:00
index cb4a89940cf02de5c3eefc5c746397a931c96b7a..7e053bc9bbd8abc1a6c060c1b4166ff27c7043d2 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
2020-08-11 17:38:17 +02:00
@@ -189,6 +189,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
2020-08-03 18:48:42 +02:00
return false;
}
2020-08-11 17:38:17 +02:00
dev.tr7zw.yatopia.YatopiaConfig.registerCommands();
2020-08-05 02:27:24 +02:00
+ de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings"));
2020-08-11 17:38:17 +02:00
+ com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings"));
2020-08-05 15:21:25 +02:00
// Yatopia end
2020-08-03 18:48:42 +02:00
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
2020-08-03 21:25:54 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
2020-08-13 17:53:32 +02:00
index 2ba0d89ae1b5d52eec3bd91328088ea2c7249d07..5c2dec887a41351b1d3288c391dfa899cc7e2a03 100644
2020-08-03 21:25:54 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
2020-08-13 17:53:32 +02:00
@@ -311,7 +311,7 @@ public class Main {
2020-08-03 21:25:54 +02:00
}
// Paper end
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
- de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - Server Config
2020-08-11 20:40:29 +02:00
+ //de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - Server Config // Yatopia - no load here for u
2020-08-03 21:25:54 +02:00
System.out.println("Loading libraries, please wait...");
net.minecraft.server.Main.main(options);
} catch (Throwable t) {