refactor: push update to upstream
This commit is contained in:
@@ -4,302 +4,18 @@ Date: Sun, 8 Jun 2025 00:58:13 +0800
|
||||
Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
index fb63e2a3205ea9f7aaee0ff0f4dc0cc1a5268507..645f2f41de74f4461685c753dcd6cfc5dfa8b2ab 100644
|
||||
--- a/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
+++ b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
@@ -13,11 +13,17 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
index 76a76a4e5eadf89b1b24e145045c1bbac6d01755..c2e3bd05af207c9367823a3a5fa57b3b367af63c 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
@@ -10,6 +10,7 @@ public class ConfigManager {
|
||||
|
||||
public class LuminolConfigCommand extends Command {
|
||||
- public LuminolConfigCommand() {
|
||||
- super("luminolconfig");
|
||||
- this.setPermission("luminol.commands.luminolconfig");
|
||||
+ private LuminolConfig config;
|
||||
+
|
||||
+ public LuminolConfigCommand(String name) {
|
||||
+ super(name + "config");
|
||||
+ this.setPermission(name + ".commands." + name + "config");
|
||||
this.setDescription("Manage config file");
|
||||
- this.setUsage("/luminolconfig");
|
||||
+ this.setUsage("/" + name + "config");
|
||||
+ }
|
||||
+
|
||||
+ public void initConfig(LuminolConfig config) {
|
||||
+ this.config = config;
|
||||
public static void initConfigs() throws IOException {
|
||||
configfiles.put("luminol", new ConfigsInstance(new File("luminol_config"), "luminol", "me.earthme.luminol.config.modules"));
|
||||
+ configfiles.put("lophine", new ConfigsInstance(new File("lophine_config"), "lophine", "fun.bm.lophine.config.modules")); // add lophine config to global config
|
||||
preLoad();
|
||||
}
|
||||
|
||||
public void wrongUse(CommandSender sender) {
|
||||
@@ -38,7 +44,7 @@ public class LuminolConfigCommand extends Command {
|
||||
result.add("reset");
|
||||
result.add("reload");
|
||||
} else if (args.length == 2 && (args[0].equals("query") || args[0].equals("set") || args[0].equals("reset"))) {
|
||||
- result.addAll(LuminolConfig.completeConfigPath(args[1]));
|
||||
+ result.addAll(config.completeConfigPath(args[1]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -59,7 +65,7 @@ public class LuminolConfigCommand extends Command {
|
||||
|
||||
switch (args[0]) {
|
||||
case "reload" -> {
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
.text("Reloaded config file!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
@@ -69,8 +75,8 @@ public class LuminolConfigCommand extends Command {
|
||||
if (args.length == 2 || args.length > 3) {
|
||||
wrongUse(sender);
|
||||
return true;
|
||||
- } else if (LuminolConfig.setConfig(args[1], args[2])) {
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ } else if (config.setConfig(args[1], args[2])) {
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
.text("Set Config " + args[1] + " to " + args[2] + " successfully!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
@@ -88,10 +94,10 @@ public class LuminolConfigCommand extends Command {
|
||||
wrongUse(sender);
|
||||
return true;
|
||||
} else {
|
||||
- LuminolConfig.resetConfig(args[1]);
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ config.resetConfig(args[1]);
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
- .text("Reset Config " + args[1] + " to " + LuminolConfig.getConfig(args[1]) + " successfully!")
|
||||
+ .text("Reset Config " + args[1] + " to " + config.getConfig(args[1]) + " successfully!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
));
|
||||
}
|
||||
@@ -103,7 +109,7 @@ public class LuminolConfigCommand extends Command {
|
||||
} else {
|
||||
sender.sendMessage(
|
||||
Component
|
||||
- .text("Config " + args[1] + " is " + LuminolConfig.getConfig(args[1]) + "!")
|
||||
+ .text("Config " + args[1] + " is " + config.getConfig(args[1]) + "!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
);
|
||||
}
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/LuminolConfig.java b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
index 4526eba8e9dfb605bc4672a3eaf0688a5af66049..c05aa7296cd41e21306acd0b8fbc6d6684f56d9a 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
@@ -29,22 +29,33 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
public class LuminolConfig {
|
||||
- public static final Logger logger = LogManager.getLogger();
|
||||
- private static final File baseConfigFolder = new File("luminol_config");
|
||||
- private static final File baseConfigFile = new File(baseConfigFolder, "luminol_global_config.toml");
|
||||
- private static final Set<IConfigModule> allInstanced = new HashSet<>();
|
||||
- private static final Map<String, Object> stagedConfigMap = new HashMap<>();
|
||||
- private static final Map<String, Object> defaultvalueMap = new HashMap<>();
|
||||
- public static boolean alreadyInit = false;
|
||||
- private static CommentedFileConfig configFileInstance;
|
||||
-
|
||||
- public static void setupLatch() {
|
||||
- Bukkit.getCommandMap().register("luminolconfig", "luminol", new LuminolConfigCommand());
|
||||
+ public final Logger logger = LogManager.getLogger();
|
||||
+ private final File baseConfigFolder;
|
||||
+ private final File baseConfigFile;
|
||||
+ private final String name;
|
||||
+ private final String pack;
|
||||
+ private final Set<IConfigModule> allInstanced = new HashSet<>();
|
||||
+ private final Map<String, Object> stagedConfigMap = new HashMap<>();
|
||||
+ private final Map<String, Object> defaultvalueMap = new HashMap<>();
|
||||
+ public boolean alreadyInit = false;
|
||||
+ private CommentedFileConfig configFileInstance;
|
||||
+
|
||||
+ public LuminolConfig(@NotNull File base, @NotNull String name, @NotNull String pack) {
|
||||
+ this.baseConfigFolder = base;
|
||||
+ this.name = name;
|
||||
+ this.pack = pack;
|
||||
+ this.baseConfigFile = new File(base, name + "_global_config.toml");
|
||||
+ }
|
||||
+
|
||||
+ public void setupLatch() {
|
||||
+ LuminolConfigCommand command = new LuminolConfigCommand(name);
|
||||
+ Bukkit.getCommandMap().register(name + "config", name, command);
|
||||
+ command.initConfig(this);
|
||||
alreadyInit = true;
|
||||
}
|
||||
|
||||
- public static void reload() {
|
||||
- RegionizedServer.ensureGlobalTickThread("Reload luminol config off global region thread!");
|
||||
+ public void reload() {
|
||||
+ RegionizedServer.ensureGlobalTickThread("Reload " + name + " config off global region thread!");
|
||||
|
||||
dropAllInstanced();
|
||||
try {
|
||||
@@ -56,8 +67,8 @@ public class LuminolConfig {
|
||||
}
|
||||
|
||||
@Contract(" -> new")
|
||||
- public static @NotNull CompletableFuture<Void> reloadAsync() {
|
||||
- return CompletableFuture.runAsync(LuminolConfig::reload, task -> RegionizedServer.getInstance().addTask(() -> {
|
||||
+ public @NotNull CompletableFuture<Void> reloadAsync() {
|
||||
+ return CompletableFuture.runAsync(this::reload, task -> RegionizedServer.getInstance().addTask(() -> {
|
||||
try {
|
||||
task.run();
|
||||
} catch (Exception e) {
|
||||
@@ -66,17 +77,17 @@ public class LuminolConfig {
|
||||
}));
|
||||
}
|
||||
|
||||
- public static void dropAllInstanced() {
|
||||
+ public void dropAllInstanced() {
|
||||
allInstanced.clear();
|
||||
}
|
||||
|
||||
- public static void finalizeLoadConfig() {
|
||||
+ public void finalizeLoadConfig() {
|
||||
for (IConfigModule module : allInstanced) {
|
||||
module.onLoaded(configFileInstance);
|
||||
}
|
||||
}
|
||||
|
||||
- public static void preLoadConfig() throws IOException {
|
||||
+ public void preLoadConfig() throws IOException {
|
||||
baseConfigFolder.mkdirs();
|
||||
|
||||
if (!baseConfigFile.exists()) {
|
||||
@@ -98,21 +109,21 @@ public class LuminolConfig {
|
||||
saveConfigs();
|
||||
}
|
||||
|
||||
- private static void loadAllModules() throws IllegalAccessException {
|
||||
+ private void loadAllModules() throws IllegalAccessException {
|
||||
for (IConfigModule instanced : allInstanced) {
|
||||
loadForSingle(instanced);
|
||||
}
|
||||
}
|
||||
|
||||
- private static void instanceAllModule() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
||||
- for (Class<?> clazz : getClasses("me.earthme.luminol.config.modules")) {
|
||||
+ private void instanceAllModule() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
||||
+ for (Class<?> clazz : getClasses(pack)) {
|
||||
if (IConfigModule.class.isAssignableFrom(clazz)) {
|
||||
allInstanced.add((IConfigModule) clazz.getConstructor().newInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- private static void loadForSingle(@NotNull IConfigModule singleConfigModule) throws IllegalAccessException {
|
||||
+ private void loadForSingle(@NotNull IConfigModule singleConfigModule) throws IllegalAccessException {
|
||||
final EnumConfigCategory category = singleConfigModule.getCategory();
|
||||
|
||||
Field[] fields = singleConfigModule.getClass().getDeclaredFields();
|
||||
@@ -203,7 +214,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static void removeConfig(String name, String[] keys) {
|
||||
+ public void removeConfig(String name, String[] keys) {
|
||||
configFileInstance.remove(name);
|
||||
Object configAtPath = configFileInstance.get(String.join(".", keys));
|
||||
if (configAtPath instanceof UnmodifiableConfig && ((UnmodifiableConfig) configAtPath).isEmpty()) {
|
||||
@@ -211,7 +222,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static void removeConfig(String[] keys) {
|
||||
+ public void removeConfig(String[] keys) {
|
||||
configFileInstance.remove(String.join(".", keys));
|
||||
Object configAtPath = configFileInstance.get(String.join(".", Arrays.copyOfRange(keys, 1, keys.length)));
|
||||
if (configAtPath instanceof UnmodifiableConfig && ((UnmodifiableConfig) configAtPath).isEmpty()) {
|
||||
@@ -219,11 +230,11 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static boolean setConfig(String[] keys, Object value) {
|
||||
+ public boolean setConfig(String[] keys, Object value) {
|
||||
return setConfig(String.join(".", keys), value);
|
||||
}
|
||||
|
||||
- public static boolean setConfig(String key, Object value) {
|
||||
+ public boolean setConfig(String key, Object value) {
|
||||
if (configFileInstance.contains(key) && configFileInstance.get(key) != null) {
|
||||
stagedConfigMap.put(key, value);
|
||||
return true;
|
||||
@@ -231,7 +242,7 @@ public class LuminolConfig {
|
||||
return false;
|
||||
}
|
||||
|
||||
- private static Object tryTransform(Class<?> targetType, Object value) {
|
||||
+ private Object tryTransform(Class<?> targetType, Object value) {
|
||||
if (!targetType.isAssignableFrom(value.getClass())) {
|
||||
try {
|
||||
if (targetType == Integer.class) {
|
||||
@@ -255,27 +266,27 @@ public class LuminolConfig {
|
||||
return value;
|
||||
}
|
||||
|
||||
- public static void saveConfigs() {
|
||||
+ public void saveConfigs() {
|
||||
configFileInstance.save();
|
||||
}
|
||||
|
||||
- public static void resetConfig(String[] keys) {
|
||||
+ public void resetConfig(String[] keys) {
|
||||
resetConfig(String.join(".", keys));
|
||||
}
|
||||
|
||||
- public static void resetConfig(String key) {
|
||||
+ public void resetConfig(String key) {
|
||||
stagedConfigMap.put(key, null);
|
||||
}
|
||||
|
||||
- public static String getConfig(String[] keys) {
|
||||
+ public String getConfig(String[] keys) {
|
||||
return getConfig(String.join(".", keys));
|
||||
}
|
||||
|
||||
- public static String getConfig(String key) {
|
||||
+ public String getConfig(String key) {
|
||||
return configFileInstance.get(key).toString();
|
||||
}
|
||||
|
||||
- public static List<String> completeConfigPath(String partialPath) {
|
||||
+ public List<String> completeConfigPath(String partialPath) {
|
||||
List<String> allPaths = getAllConfigPaths(partialPath);
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
@@ -295,13 +306,13 @@ public class LuminolConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
- private static List<String> getAllConfigPaths(String currentPath) {
|
||||
+ private List<String> getAllConfigPaths(String currentPath) {
|
||||
return defaultvalueMap.keySet().stream()
|
||||
.filter(k -> k.startsWith(currentPath))
|
||||
.toList();
|
||||
}
|
||||
|
||||
- public static @NotNull Set<Class<?>> getClasses(String pack) {
|
||||
+ public @NotNull Set<Class<?>> getClasses(String pack) {
|
||||
Set<Class<?>> classes = new LinkedHashSet<>();
|
||||
String packageDirName = pack.replace('.', '/');
|
||||
Enumeration<URL> dirs;
|
||||
@@ -332,7 +343,7 @@ public class LuminolConfig {
|
||||
return classes;
|
||||
}
|
||||
|
||||
- private static void findClassesInPackageByFile(String packageName, String packagePath, Set<Class<?>> classes) {
|
||||
+ private void findClassesInPackageByFile(String packageName, String packagePath, Set<Class<?>> classes) {
|
||||
File dir = new File(packagePath);
|
||||
|
||||
if (!dir.exists() || !dir.isDirectory()) {
|
||||
@@ -356,7 +367,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- private static void findClassesInPackageByJar(String packageName, Enumeration<JarEntry> entries, String packageDirName, Set<Class<?>> classes) {
|
||||
+ private void findClassesInPackageByJar(String packageName, Enumeration<JarEntry> entries, String packageDirName, Set<Class<?>> classes) {
|
||||
while (entries.hasMoreElements()) {
|
||||
JarEntry entry = entries.nextElement();
|
||||
String name = entry.getName();
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
index ded1f0667327a70a923ebda55c41b1c9094d3e37..57ddc0832b919b115b85c81ac30f136e32f1e77e 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 8 Jun 2025 00:58:12 +0800
|
||||
Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index a75a5ce8477da8d3f7b0ae41bfbd75defe1d2ed4..ad80d198d96bb05d71200958216c4223bde7bb97 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -109,7 +109,7 @@ public class Main {
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
- me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol config
|
||||
+ fun.bm.lophine.config.LophineConfig.initConfigs(); // Lophine - Lophine config
|
||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 1f3c26cc9f3b687693c36f2946394fad5ab6bc9f..45cd92cd69bcb66b94bc6278f2897ea4a31c45b6 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -171,8 +171,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
- me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); // Luminol - load config file
|
||||
- me.earthme.luminol.config.LuminolConfig.setupLatch(); // Luminol - load config file
|
||||
+ fun.bm.lophine.config.LophineConfig.loadConfigFiles(); // Lophine - load config file
|
||||
if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
+2
-2
@@ -97,7 +97,7 @@ index 0357792de0ed8ec9058d1847c8b45c33ff365af6..4945c11f573a53df2f5be4beb7af6a3f
|
||||
this.scheduler.regionFailed(this, false, thr);
|
||||
// regionFailed will schedule a shutdown, so we should avoid letting this region tick further
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 14719cca5ff91c8647b3b616b2dfd4d153946d92..4a872ce3a3815d42da124a20af1bf232c9b47e12 100644
|
||||
index 8a90aa5c145f53afbb3f2371f97cb09974f30bbb..0d5ed9602492c8393088954105e9a19032067b8b 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -243,7 +243,11 @@ public class Commands {
|
||||
@@ -114,7 +114,7 @@ index 14719cca5ff91c8647b3b616b2dfd4d153946d92..4a872ce3a3815d42da124a20af1bf232
|
||||
TitleCommand.register(this.dispatcher, context);
|
||||
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 737df5c9345e22fa4487cbb83c7462b92a4f9e78..9f868e8865a1360b27cc8ac990f3a07d893af722 100644
|
||||
index b487adb2b104b14346bf7373f07c8d48c239feb4..c285fb3b0e6d3eeda8d4c9132dbd917f4f8ec20c 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
+1
-1
@@ -123,7 +123,7 @@ index d907e24d563e27acab2f2bf9711b1755ea9afd19..6189cb7c1745a242b610e89c859cc849
|
||||
if (min > 0) {
|
||||
other.grow(min);
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 8b318426d3aff4be920181bb8b882c43119e1571..8d67df8732f3b71eee044e535c4536930fd6e405 100644
|
||||
index b745eb5d9c68547335247910ff2ae8d5fb36349c..6d8675b918f92dc3ce85825edf2b33469950ef9d 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -279,10 +279,45 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
+2
-2
@@ -5,13 +5,13 @@ Subject: [PATCH] I18n support
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 45cd92cd69bcb66b94bc6278f2897ea4a31c45b6..48057abf3c127aab0458078f891a32ec5f6b9baa 100644
|
||||
index c6c6432c2efeb7b95c2894b188cd966321ae3186..1cd9af71ee66df5f277748c0a5a59a30bd57accc 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -172,6 +172,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
fun.bm.lophine.config.LophineConfig.loadConfigFiles(); // Lophine - load config file
|
||||
me.earthme.luminol.config.ConfigManager.loadConfigFiles(); // Luminol - load config file
|
||||
+ fun.bm.lophine.utils.ServerI18nUtil.init(); // Lophine - I18n support
|
||||
if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
@@ -1,33 +0,0 @@
|
||||
package fun.bm.lophine.config;
|
||||
|
||||
import me.earthme.luminol.config.LuminolConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LophineConfig {
|
||||
public static final Map<String, LuminolConfig> configfiles = new HashMap<>();
|
||||
private static final File luminolConfigFolder = new File("luminol_config");
|
||||
private static final File lophineConfigFolder = new File("lophine_config");
|
||||
|
||||
public static void initConfigs() throws IOException {
|
||||
configfiles.put("luminol", new LuminolConfig(luminolConfigFolder, "luminol", "me.earthme.luminol.config.modules"));
|
||||
configfiles.put("lophine", new LuminolConfig(lophineConfigFolder, "lophine", "fun.bm.lophine.config.modules"));
|
||||
preLoad();
|
||||
}
|
||||
|
||||
public static void preLoad() throws IOException {
|
||||
for (LuminolConfig config : configfiles.values()) {
|
||||
config.preLoadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadConfigFiles() {
|
||||
for (LuminolConfig config : configfiles.values()) {
|
||||
config.finalizeLoadConfig();
|
||||
config.setupLatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user