Yatopia/patches/server/0023-Redirect-Configs.patch
Ivan Pekov f1d3c9d7a2 Updated Upstream and Sidestream(s) (Tuinity/Purpur)
Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
5994cb0 Updated Upstream (Paper)
7dfe18c Merge https://github.com/Spottedleaf/Tuinity into ver/1.16.3
ef4e59a Optimise tab complete

Purpur Changes:
8726ad9 Updated Upstream (Paper)
2020-09-13 09:07:20 +03:00

101 lines
5.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 5 Aug 2020 08:17:46 -0500
Subject: [PATCH] Redirect Configs
diff --git a/src/main/java/com/proximyst/rainforest/RainforestConfig.java b/src/main/java/com/proximyst/rainforest/RainforestConfig.java
index f6623032e5d4034c104aa1fc6ff4265169e462ba..4bc94e4598cff801d08e457ebbf184fbaadb3b19 100644
--- a/src/main/java/com/proximyst/rainforest/RainforestConfig.java
+++ b/src/main/java/com/proximyst/rainforest/RainforestConfig.java
@@ -37,6 +37,8 @@ public final class RainforestConfig {
private static boolean fatalError;
public static void init(File configFile) {
+ // Yatopia start
+ /*
CONFIG_FILE = configFile;
config = new YamlConfiguration();
try {
@@ -56,7 +58,13 @@ public final class RainforestConfig {
version = getInt("config-version", 1);
set("config-version", 1);
+ */
+ config = net.yatopia.server.YatopiaConfig.config;
+ CONFIG_FILE = net.yatopia.server.YatopiaConfig.CONFIG_FILE;
+ verbose = net.yatopia.server.YatopiaConfig.verbose;
+ version = net.yatopia.server.YatopiaConfig.version;
readConfig(RainforestConfig.class, null);
+ // Yatopia end
}
protected static void logError(String s) {
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
index bbf09800b7b72bdfb75c91e4c6c77fe00e3ad436..1d98bfdee95fb1052fcd9f141a2ab82ba9dcf2f9 100644
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
@@ -1,5 +1,6 @@
package de.minebench.origami;
+import net.yatopia.server.YatopiaConfig;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -20,6 +21,8 @@ public final class OrigamiConfig {
private static int configVersion;
public static void init(final File file) {
+ // Yatopia start
+ /*
OrigamiConfig.configFile = file;
OrigamiConfig.config = new YamlConfiguration();
config.options().header(CONFIG_HEADER);
@@ -39,13 +42,16 @@ public final class OrigamiConfig {
System.out.println("Failure to load origami config");
throw new RuntimeException(ex);
}
- }
-
- OrigamiConfig.load(OrigamiConfig.class, null);
+ }*/
+ config = net.yatopia.server.YatopiaConfig.config;
+ configFile = net.yatopia.server.YatopiaConfig.CONFIG_FILE;
+ configVersion = net.yatopia.server.YatopiaConfig.version;
+ //OrigamiConfig.load(OrigamiConfig.class, null); // todo: uncomment when config options are ported
+ // Yatopia end
}
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 ||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index dde91498e773cc6744612f780ce82bd35ad79637..70d22f03162df1855fa8632127ef1a3e6703c4be 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -185,6 +185,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
return false;
}
net.yatopia.server.YatopiaConfig.registerCommands();
+ de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings"));
+ com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings"));
// Yatopia end
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 4032f71f1eb916b9a004502eab9babfb0bcf0be2..dcbe92898db5297c9c74b482eefbcdb9aca2c1a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -310,7 +310,7 @@ public class Main {
}
// 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
+ //de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - Server Config // Yatopia - no load here for u
System.out.println("Loading libraries, please wait...");
net.minecraft.server.Main.main(options);
} catch (Throwable t) {