|
|
|
@@ -0,0 +1,397 @@
|
|
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
|
|
|
Date: Sun, 8 Jun 2025 00:58:13 +0800
|
|
|
|
|
Subject: [PATCH] Rebrand to Lophine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
|
|
|
index 22c038e6556d9911e1eaedf71d7b86843af89c16..f5574eb883b1ee8747acc42832bc88ae03e27b67 100644
|
|
|
|
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
|
|
|
@@ -593,7 +593,7 @@ public class Metrics {
|
|
|
|
|
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
|
|
|
|
// Only start Metrics, if it's enabled in the config
|
|
|
|
|
if (config.getBoolean("enabled", true)) {
|
|
|
|
|
- Metrics metrics = new Metrics("Luminol", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Luminol
|
|
|
|
|
+ Metrics metrics = new Metrics("Lophine", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Luminol // Lophine
|
|
|
|
|
|
|
|
|
|
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
|
|
|
|
String minecraftVersion = Bukkit.getVersion();
|
|
|
|
|
@@ -607,11 +607,11 @@ public class Metrics {
|
|
|
|
|
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
|
|
|
|
if (implVersion != null) {
|
|
|
|
|
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
|
|
|
|
- paperVersion = "git-Luminol-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page // Luminol - Rebrand to Luminol
|
|
|
|
|
+ paperVersion = "git-Lophine-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page // Luminol - Rebrand to Luminol // Lophine - Rebrand to Lophine
|
|
|
|
|
} else {
|
|
|
|
|
paperVersion = "unknown";
|
|
|
|
|
}
|
|
|
|
|
- metrics.addCustomChart(new Metrics.SimplePie("luminol_version", () -> paperVersion)); // Folia - we have our own bstats page // Luminol
|
|
|
|
|
+ metrics.addCustomChart(new Metrics.SimplePie("lophine_version", () -> paperVersion)); // Folia - we have our own bstats page // Luminol // Lophine
|
|
|
|
|
|
|
|
|
|
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
|
|
|
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
|
|
|
index 22125dbe1765f930fe10fe420be1c275ec553139..d5b070d1a3d84e228960dacd614e0f1abe968e79 100644
|
|
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
|
|
|
@@ -35,7 +35,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
|
|
|
private static final Logger LOGGER = LogUtils.getClassLogger();
|
|
|
|
|
private static final int DISTANCE_ERROR = -1;
|
|
|
|
|
private static final int DISTANCE_UNKNOWN = -2;
|
|
|
|
|
- private static final String DOWNLOAD_PAGE = "https://github.com/LuminolMC/Luminol"; //Luminol
|
|
|
|
|
+ private static final String DOWNLOAD_PAGE = "https://github.com/LuminolMC/Lophine"; //Luminol // Lophine
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public long getCacheTime() {
|
|
|
|
|
@@ -49,7 +49,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
|
|
|
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
|
|
|
|
|
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
|
|
|
|
|
} else {
|
|
|
|
|
- updateMessage = getUpdateStatusMessage("LuminolMC/Luminol", build); // Folia // Luminol
|
|
|
|
|
+ updateMessage = getUpdateStatusMessage("LuminolMC/Lophine", build); // Folia // Luminol // Lophine
|
|
|
|
|
}
|
|
|
|
|
final @Nullable Component history = this.getHistory();
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
|
|
|
index e3c5f4c31f084294a59830f3e764921433dd80d5..8b08a578102caf078efb15565ae3006c6eb50662 100644
|
|
|
|
|
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
|
|
|
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
|
|
|
@@ -32,6 +32,7 @@ public record ServerBuildInfoImpl(
|
|
|
|
|
|
|
|
|
|
private static final String BRAND_PAPER_NAME = "Paper";
|
|
|
|
|
private static final String BRAND_LUMINOL_NAME = "Luminol";
|
|
|
|
|
+ private static final String BRAND_LOPHINE_NAME = "Lophine";
|
|
|
|
|
|
|
|
|
|
private static final String BUILD_DEV = "DEV";
|
|
|
|
|
|
|
|
|
|
@@ -43,9 +44,9 @@ public record ServerBuildInfoImpl(
|
|
|
|
|
this(
|
|
|
|
|
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
|
|
|
|
|
.map(Key::key)
|
|
|
|
|
- .orElse(BRAND_LUMINOL_ID), // Folia // Luminol
|
|
|
|
|
+ .orElse(BRAND_LOPHINE_ID), // Folia // Luminol // Lophine
|
|
|
|
|
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
|
|
|
|
- .orElse(BRAND_LUMINOL_NAME), // Folia // Luminol
|
|
|
|
|
+ .orElse(BRAND_LOPHINE_NAME), // Folia // Luminol // Lophine
|
|
|
|
|
SharedConstants.getCurrentVersion().getId(),
|
|
|
|
|
SharedConstants.getCurrentVersion().getName(),
|
|
|
|
|
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
|
|
|
|
@@ -62,7 +63,7 @@ public record ServerBuildInfoImpl(
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isBrandCompatible(final @NotNull Key brandId) {
|
|
|
|
|
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID); // Luminol
|
|
|
|
|
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID) || brandId.equals(BRAND_LUMINOL_ID); // Luminol // Lophine
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
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 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 0fed724ce1f0f4f731ab471333aa9fbaef70598e..145612d7ed358d3973f817f45fc5eb195a74daa0 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();
|
|
|
|
|
@@ -199,7 +210,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()) {
|
|
|
|
|
@@ -207,7 +218,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()) {
|
|
|
|
|
@@ -215,11 +226,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;
|
|
|
|
|
@@ -227,7 +238,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) {
|
|
|
|
|
@@ -251,27 +262,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<>();
|
|
|
|
|
|
|
|
|
|
@@ -291,13 +302,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;
|
|
|
|
|
@@ -328,7 +339,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()) {
|
|
|
|
|
@@ -352,7 +363,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/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
|
|
|
index 9699d7dcca5cf67f50ad05c0e875de424a4e00c5..1c3b94a2592cff74924cf9b355e30b0fa182b79b 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
|
|
|
@@ -11,7 +11,7 @@ public final class Versioning {
|
|
|
|
|
public static String getBukkitVersion() {
|
|
|
|
|
String result = "Unknown-Version";
|
|
|
|
|
|
|
|
|
|
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.earthme.luminol/luminol-api/pom.properties"); // Folia //Luminol
|
|
|
|
|
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.earthme.lophine/lophine-api/pom.properties"); // Folia //Luminol
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
|
|
|
|
|
|
if (stream != null) {
|