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-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-10-04 17:43:50 +02:00
index 004184a7c3da4f72f68a5fd9b4dd5abd0b8f871d..4230872de3551393a35c567d07a570dd07976fb8 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-09-01 08:38:17 +02:00
@@ -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 {
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-09-01 08:38:17 +02:00
@@ -39,13 +42,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-09-01 08:38:17 +02:00
+ config = net.yatopia.server.YatopiaConfig.config;
+ configFile = net.yatopia.server.YatopiaConfig.CONFIG_FILE;
+ configVersion = net.yatopia.server.YatopiaConfig.version;
2020-08-11 17:38:17 +02:00
+ //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-11-07 08:02:33 +01:00
index c8e0310143e72e43832ecaebe6b9252f9cbd3c5b..d1cf80ce9e87fa6ec03f2e965883041acbd181d5 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-11-07 08:02:33 +01:00
@@ -188,7 +188,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
2020-08-03 18:48:42 +02:00
return false;
}
2020-08-05 15:21:25 +02:00
// Yatopia end
2020-11-07 08:02:33 +01:00
-
+ de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings"));
2020-08-03 18:48:42 +02:00
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
2020-11-07 08:02:33 +01:00
this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba());
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-11-07 08:02:33 +01:00
index da624fbeb5aaba2aa717ed3aada7633d324fb8cf..b189c4011000106631b98a7ca87bd9d114aaf350 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-09-13 09:00:43 +02:00
@@ -303,7 +303,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) {