diff --git a/luminol-server/build.gradle.kts.patch b/luminol-server/build.gradle.kts.patch index d2f4b36..df9b1b6 100644 --- a/luminol-server/build.gradle.kts.patch +++ b/luminol-server/build.gradle.kts.patch @@ -54,7 +54,7 @@ dependencies { - implementation(project(":folia-api")) + implementation(project(":luminol-api")) // Luminol -+ implementation("com.electronwill.night-config:toml:3.6.6") // Luminol - Night config ++ implementation("com.electronwill.night-config:toml:3.8.2") // Luminol - Night config + // Abomination start + implementation("com.github.luben:zstd-jni:1.5.4-1") + implementation("org.lz4:lz4-java:1.8.0") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java.patch index cae529c..12d66fc 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java -@@ -1,0 +_,70 @@ +@@ -1,0 +_,80 @@ +package me.earthme.luminol.commands; + +import me.earthme.luminol.config.LuminolConfig; @@ -16,7 +16,7 @@ +import java.util.List; + +public class LuminolConfigCommand extends Command { -+ public LuminolConfigCommand(){ ++ public LuminolConfigCommand() { + super("luminolconfig"); + this.setPermission("luminol.commands.luminolconfig"); + this.setDescription("Manage config file"); @@ -27,8 +27,10 @@ + public @NotNull List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args, @Nullable Location location) throws IllegalArgumentException { + final List result = new ArrayList<>(); + -+ if (args.length == 1){ -+ result.add("reload"); ++ if (args.length == 1) { ++ result.add("query"); ++ // result.add("set"); // TODO Later ++ // result.add("reload"); // TODO Later + } + + return result; @@ -36,35 +38,43 @@ + + @Override + public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) { -+ if (!this.testPermission(sender)){ ++ if (!this.testPermission(sender)) { + sender.sendMessage(Component + .text("No permission to execute this command!") -+ .color(TextColor.color(255,0,0)) ++ .color(TextColor.color(255, 0, 0)) + ); + } + -+ if (args.length < 1){ ++ if (args.length < 1) { + sender.sendMessage( + Component + .text("Wrong use!\n") -+ .color(TextColor.color(255,0,0)) ++ .color(TextColor.color(255, 0, 0)) + ); + return true; + } + -+ switch (args[0]){ ++ switch (args[0]) { + case "reload" -> { + LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage( + Component + .text("Reloaded config file!") -+ .color(TextColor.color(0,255,0)) ++ .color(TextColor.color(0, 255, 0)) + )); + } + ++ case "set" -> { ++ // TODO Later ++ } ++ ++ case "query" -> { ++ // TODO Later ++ } ++ + default -> sender.sendMessage( + Component + .text("Unknown action!\n") -+ .color(TextColor.color(255,0,0)) ++ .color(TextColor.color(255, 0, 0)) + ); + } + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/MembarCommand.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/MembarCommand.java.patch index 6d87fa4..98e3d8c 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/MembarCommand.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/MembarCommand.java.patch @@ -22,28 +22,28 @@ + + @Override + public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) { -+ if (!testPermission(sender)){ ++ if (!testPermission(sender)) { + return true; + } + -+ if (!MembarConfig.memoryBarEnabled){ -+ sender.sendMessage(Component.text("Membar was already disabled!").color(TextColor.color(255,0,0))); ++ if (!MembarConfig.memoryBarEnabled) { ++ sender.sendMessage(Component.text("Membar was already disabled!").color(TextColor.color(255, 0, 0))); + return true; + } + -+ if (!(sender instanceof Player player)){ -+ sender.sendMessage(Component.text("Only player can use this command!").color(TextColor.color(255,0,0))); ++ if (!(sender instanceof Player player)) { ++ sender.sendMessage(Component.text("Only player can use this command!").color(TextColor.color(255, 0, 0))); + return true; + } + + if (GlobalServerMemoryBar.isPlayerVisible(player)) { -+ player.sendMessage(Component.text("Disabled mem bar").color(TextColor.color(0,255,0))); -+ GlobalServerMemoryBar.setVisibilityForPlayer(player,false); ++ player.sendMessage(Component.text("Disabled mem bar").color(TextColor.color(0, 255, 0))); ++ GlobalServerMemoryBar.setVisibilityForPlayer(player, false); + return true; + } + -+ player.sendMessage(Component.text("Enabled mem bar").color(TextColor.color(0,255,0))); -+ GlobalServerMemoryBar.setVisibilityForPlayer(player,true); ++ player.sendMessage(Component.text("Enabled mem bar").color(TextColor.color(0, 255, 0))); ++ GlobalServerMemoryBar.setVisibilityForPlayer(player, true); + + return true; + } diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java.patch index 3b239c5..9de20ba 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java.patch @@ -1,15 +1,12 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java -@@ -1,0 +_,50 @@ +@@ -1,0 +_,47 @@ +package me.earthme.luminol.commands; + +import me.earthme.luminol.config.modules.misc.TpsBarConfig; +import me.earthme.luminol.functions.GlobalServerTpsBar; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.TextColor; -+import net.kyori.adventure.util.RGBLike; -+import org.bukkit.ChatColor; -+import org.bukkit.Color; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; @@ -25,28 +22,28 @@ + + @Override + public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) { -+ if (!testPermission(sender)){ ++ if (!testPermission(sender)) { + return true; + } + -+ if (!TpsBarConfig.tpsbarEnabled){ -+ sender.sendMessage(Component.text("Tpsbar was already disabled!").color(TextColor.color(255,0,0))); ++ if (!TpsBarConfig.tpsbarEnabled) { ++ sender.sendMessage(Component.text("Tpsbar was already disabled!").color(TextColor.color(255, 0, 0))); + return true; + } + -+ if (!(sender instanceof Player player)){ -+ sender.sendMessage(Component.text("Only player can use this command!").color(TextColor.color(255,0,0))); ++ if (!(sender instanceof Player player)) { ++ sender.sendMessage(Component.text("Only player can use this command!").color(TextColor.color(255, 0, 0))); + return true; + } + + if (GlobalServerTpsBar.isPlayerVisible(player)) { -+ player.sendMessage(Component.text("Disabled tps bar").color(TextColor.color(0,255,0))); -+ GlobalServerTpsBar.setVisibilityForPlayer(player,false); ++ player.sendMessage(Component.text("Disabled tps bar").color(TextColor.color(0, 255, 0))); ++ GlobalServerTpsBar.setVisibilityForPlayer(player, false); + return true; + } + -+ player.sendMessage(Component.text("Enabled tps bar").color(TextColor.color(0,255,0))); -+ GlobalServerTpsBar.setVisibilityForPlayer(player,true); ++ player.sendMessage(Component.text("Enabled tps bar").color(TextColor.color(0, 255, 0))); ++ GlobalServerTpsBar.setVisibilityForPlayer(player, true); + + return true; + } diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/IConfigModule.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/IConfigModule.java.patch index 68003b0..092aa62 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/IConfigModule.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/IConfigModule.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/config/IConfigModule.java -@@ -1,0 +_,22 @@ +@@ -1,0 +_,23 @@ +package me.earthme.luminol.config; + +import com.electronwill.nightconfig.core.file.CommentedFileConfig; @@ -12,11 +12,12 @@ + + String getBaseName(); + -+ default void onLoaded(CommentedFileConfig configInstance) {} ++ default void onLoaded(CommentedFileConfig configInstance) { ++ } + -+ default T get(String keyName, T defaultValue, @NotNull CommentedFileConfig config){ -+ if (!config.contains(keyName)){ -+ config.set(keyName,defaultValue); ++ default T get(String keyName, T defaultValue, @NotNull CommentedFileConfig config) { ++ if (!config.contains(keyName)) { ++ config.set(keyName, defaultValue); + return defaultValue; + } + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/LuminolConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/LuminolConfig.java.patch index 4117fd7..54c9120 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/LuminolConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/LuminolConfig.java.patch @@ -1,12 +1,17 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java -@@ -1,0 +_,275 @@ +@@ -1,0 +_,351 @@ +package me.earthme.luminol.config; + ++import com.electronwill.nightconfig.core.CommentedConfig; +import com.electronwill.nightconfig.core.UnmodifiableConfig; +import com.electronwill.nightconfig.core.file.CommentedFileConfig; +import io.papermc.paper.threadedregions.RegionizedServer; +import me.earthme.luminol.commands.LuminolConfigCommand; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; ++import me.earthme.luminol.config.flags.HotReloadUnsupported; ++import me.earthme.luminol.config.flags.TransformedConfig; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.bukkit.Bukkit; @@ -80,7 +85,7 @@ + baseConfigFile.createNewFile(); + } + -+ configFileInstance = CommentedFileConfig.ofConcurrent(baseConfigFile); ++ configFileInstance = CommentedFileConfig.of(baseConfigFile); + + configFileInstance.load(); + @@ -197,6 +202,77 @@ + } + } + ++ public static boolean setConfigAndSave(String[] keys, Object value) { ++ return setConfigAndSave(String.join(".", keys), value); ++ } ++ ++ public static boolean setConfigAndSave(String key, Object value) { ++ if (setConfig(key, value)) { ++ saveConfig(); ++ return true; ++ } ++ return false; ++ } ++ ++ public static boolean setConfig(String[] keys, Object value) { ++ return setConfig(String.join(".", keys), value); ++ } ++ ++ public static boolean setConfig(String key, Object value) { ++ if (configFileInstance.contains(key) && configFileInstance.get(key) != null) { ++ configFileInstance.set(key, value); ++ return true; ++ } ++ return false; ++ } ++ ++ public static void saveConfig() { ++ configFileInstance.save(); ++ } ++ ++ public static void resetConfig(String[] keys) { ++ resetConfig(String.join(".", keys)); ++ } ++ ++ public static void resetConfig(String key) { ++ configFileInstance.remove(key); ++ configFileInstance.save(); ++ reload(); ++ } ++ ++ public static String getConfig(String[] keys) { ++ return getConfig(String.join(".", keys)); ++ } ++ ++ public static String getConfig(String key) { ++ return configFileInstance.get(key); ++ } ++ ++ public List getAllConfigPaths(String prefix) { ++ List configPaths = getAllConfigPaths(); ++ return configPaths.stream().filter(path -> path.startsWith(prefix)).toList(); ++ } ++ ++ public static List getAllConfigPaths() { ++ List configPaths = new ArrayList<>(); ++ getAllConfigPathsRecursive(configFileInstance, "", configPaths); ++ return configPaths; ++ } ++ ++ private static void getAllConfigPathsRecursive(CommentedConfig config, String currentPath, List configPaths) { ++ for (CommentedConfig.Entry entry : config.entrySet()) { ++ String key = entry.getKey(); ++ Object value = entry.getValue(); ++ String fullPath = currentPath.isEmpty() ? key : currentPath + "." + key; ++ ++ if (value instanceof CommentedConfig) { ++ getAllConfigPathsRecursive((CommentedConfig) value, fullPath, configPaths); ++ } else { ++ configPaths.add(fullPath); ++ } ++ } ++ } ++ + public static @NotNull Set> getClasses(String pack) { + Set> classes = new LinkedHashSet<>(); + String packageDirName = pack.replace('.', '/'); diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/ConfigInfo.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/ConfigInfo.java.patch similarity index 69% rename from luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/ConfigInfo.java.patch rename to luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/ConfigInfo.java.patch index 5e200ba..0e21dfd 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/ConfigInfo.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/ConfigInfo.java.patch @@ -1,7 +1,7 @@ --- /dev/null -+++ b/src/main/java/me/earthme/luminol/config/ConfigInfo.java ++++ b/src/main/java/me/earthme/luminol/config/flags/ConfigInfo.java @@ -1,0 +_,11 @@ -+package me.earthme.luminol.config; ++package me.earthme.luminol.config.flags; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/DoNotLoad.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/DoNotLoad.java.patch similarity index 63% rename from luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/DoNotLoad.java.patch rename to luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/DoNotLoad.java.patch index 7408583..c31e5d6 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/DoNotLoad.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/DoNotLoad.java.patch @@ -1,7 +1,7 @@ --- /dev/null -+++ b/src/main/java/me/earthme/luminol/config/DoNotLoad.java ++++ b/src/main/java/me/earthme/luminol/config/flags/DoNotLoad.java @@ -1,0 +_,8 @@ -+package me.earthme.luminol.config; ++package me.earthme.luminol.config.flags; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/HotReloadUnsupported.java.patch similarity index 62% rename from luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java.patch rename to luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/HotReloadUnsupported.java.patch index aa0b177..1318154 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/HotReloadUnsupported.java.patch @@ -1,7 +1,7 @@ --- /dev/null -+++ b/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java ++++ b/src/main/java/me/earthme/luminol/config/flags/HotReloadUnsupported.java @@ -1,0 +_,8 @@ -+package me.earthme.luminol.config; ++package me.earthme.luminol.config.flags; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/TransformedConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/TransformedConfig.java.patch similarity index 76% rename from luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/TransformedConfig.java.patch rename to luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/TransformedConfig.java.patch index ce62f7f..5f60f60 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/TransformedConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/flags/TransformedConfig.java.patch @@ -1,7 +1,9 @@ --- /dev/null -+++ b/src/main/java/me/earthme/luminol/config/TransformedConfig.java -@@ -1,0 +_,24 @@ -+package me.earthme.luminol.config; ++++ b/src/main/java/me/earthme/luminol/config/flags/TransformedConfig.java +@@ -1,0 +_,26 @@ ++package me.earthme.luminol.config.flags; ++ ++import me.earthme.luminol.config.DefaultTransformLogic; + +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockConfig.java.patch index 402b4c5..fbfe36f 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class CommandBlockConfig implements IConfigModule { + @ConfigInfo(baseName = "enable") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandDataConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandDataConfig.java.patch index ce73f31..30702ba 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandDataConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandDataConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class CommandDataConfig implements IConfigModule { + @ConfigInfo(baseName = "enable") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandTickConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandTickConfig.java.patch index 1df39a4..d6a641c 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandTickConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/CommandTickConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class CommandTickConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java.patch index 5a60668..2959c95 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableAsyncCatcherConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java.patch index 536a1e6..d6b9d54 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableEntityCatchConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/EntityDamageSourceTraceConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/EntityDamageSourceTraceConfig.java.patch index d47f628..2e52884 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/EntityDamageSourceTraceConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/EntityDamageSourceTraceConfig.java.patch @@ -3,10 +3,10 @@ @@ -1,0 +_,24 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; -+import me.earthme.luminol.config.TransformedConfig; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.TransformedConfig; + +public class EntityDamageSourceTraceConfig implements IConfigModule { + @TransformedConfig(name = "enabled", category = {"experiment", "entity-damage-source-trace"}) diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/RayTrackingEntityTrackerConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/RayTrackingEntityTrackerConfig.java.patch index 46185a7..937e34e 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/RayTrackingEntityTrackerConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/RayTrackingEntityTrackerConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,28 @@ +package me.earthme.luminol.config.modules.experiment; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class RayTrackingEntityTrackerConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaEntityMovingFixConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaEntityMovingFixConfig.java.patch index 49cab91..b5e0957 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaEntityMovingFixConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaEntityMovingFixConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,28 @@ +package me.earthme.luminol.config.modules.fixes; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class FoliaEntityMovingFixConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPOIAccessOffRegionFixConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPOIAccessOffRegionFixConfig.java.patch index e1188eb..5eae94a 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPOIAccessOffRegionFixConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPOIAccessOffRegionFixConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,25 @@ +package me.earthme.luminol.config.modules.fixes; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class FoliaPOIAccessOffRegionFixConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/ForceCleanupEntityBrainMemoryConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/ForceCleanupEntityBrainMemoryConfig.java.patch index b0290ed..d5540bb 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/ForceCleanupEntityBrainMemoryConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/ForceCleanupEntityBrainMemoryConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.fixes; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class ForceCleanupEntityBrainMemoryConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled_for_entity", comments = "When enabled, the entity's brain will clean the memory which is typed of entity and not belong to current tickregion") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java.patch index 5c482f3..2b51f88 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.fixes; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class UnsafeTeleportationConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = "Allow non player entities enter end portals if enabled.\n" + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java.patch index d66a0b4..59c562b 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java.patch @@ -3,12 +3,12 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.fixes; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class VanillaRandomSourceConfig implements IConfigModule { -+ @ConfigInfo(baseName = "enable_for_player_entity",comments = "Related with RNG cracks") ++ @ConfigInfo(baseName = "enable_for_player_entity", comments = "Related with RNG cracks") + public static boolean useLegacyRandomSourceForPlayers = false; + + @Override diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ContainerExpansionConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ContainerExpansionConfig.java.patch index 784880c..46f965f 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ContainerExpansionConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ContainerExpansionConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,27 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class ContainerExpansionConfig implements IConfigModule { + @ConfigInfo(baseName = "barrel_rows", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableEndCrystalCheckConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableEndCrystalCheckConfig.java.patch index e9f2f92..47ba0b8 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableEndCrystalCheckConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableEndCrystalCheckConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,23 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableEndCrystalCheckConfig implements IConfigModule { + @ConfigInfo(baseName = "disable_end_crystal_check", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableHeightmapWarnConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableHeightmapWarnConfig.java.patch index 5df08bf..e53d29a 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableHeightmapWarnConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableHeightmapWarnConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableHeightmapWarnConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableMovedWronglyThreshold.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableMovedWronglyThreshold.java.patch index bdd1c96..233ea1b 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableMovedWronglyThreshold.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/DisableMovedWronglyThreshold.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableMovedWronglyThreshold implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java.patch index 1ec410b..45f740a 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class FoliaWatchogConfig implements IConfigModule { + @ConfigInfo(baseName = "tick_region_time_out_ms") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/InorderChatConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/InorderChatConfig.java.patch index 949f216..ac45c6e 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/InorderChatConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/InorderChatConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class InorderChatConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/MembarConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/MembarConfig.java.patch index 4e0cccf..4285634 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/MembarConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/MembarConfig.java.patch @@ -5,10 +5,10 @@ + +import com.electronwill.nightconfig.core.file.CommentedFileConfig; +import me.earthme.luminol.commands.MembarCommand; -+import me.earthme.luminol.config.ConfigInfo; -+import me.earthme.luminol.config.DoNotLoad; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; +import me.earthme.luminol.functions.GlobalServerMemoryBar; +import org.bukkit.Bukkit; + @@ -20,7 +20,7 @@ + @ConfigInfo(baseName = "format") + public static String memBarFormat = "Memory usage : MB/MB"; + @ConfigInfo(baseName = "memory_color_list") -+ public static List memColors = List.of("GREEN","YELLOW","RED","PURPLE"); ++ public static List memColors = List.of("GREEN", "YELLOW", "RED", "PURPLE"); + @ConfigInfo(baseName = "update_interval_ticks") + public static int updateInterval = 15; + @@ -38,15 +38,15 @@ + } + + @Override -+ public void onLoaded(CommentedFileConfig configInstance){ -+ if (memoryBarEnabled){ ++ public void onLoaded(CommentedFileConfig configInstance) { ++ if (memoryBarEnabled) { + GlobalServerMemoryBar.init(); -+ }else{ ++ } else { + GlobalServerMemoryBar.cancelBarUpdateTask(); + } + -+ if (!inited){ -+ Bukkit.getCommandMap().register("membar","luminol",new MembarCommand("membar")); ++ if (!inited) { ++ Bukkit.getCommandMap().register("membar", "luminol", new MembarCommand("membar")); + inited = true; + } + } diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/OfflineModeWarningConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/OfflineModeWarningConfig.java.patch index 0ca0d1d..5f38514 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/OfflineModeWarningConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/OfflineModeWarningConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class OfflineModeWarningConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/PublickeyVerifyConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/PublickeyVerifyConfig.java.patch index fe06838..e067505 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/PublickeyVerifyConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/PublickeyVerifyConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,21 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class PublickeyVerifyConfig implements IConfigModule { + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java.patch index e86b935..f90b1fc 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java.patch @@ -3,10 +3,10 @@ @@ -1,0 +_,61 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; -+import me.earthme.luminol.config.TransformedConfig; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.TransformedConfig; + +public class RaidChangesConfig implements IConfigModule { + @TransformedConfig(name = "allow-bad-omen-trigger-raid", category = {"misc", "revert-raid-changes"}) diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionBarConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionBarConfig.java.patch index 543282e..e1e8ec3 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionBarConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionBarConfig.java.patch @@ -5,10 +5,10 @@ + +import com.electronwill.nightconfig.core.file.CommentedFileConfig; +import me.earthme.luminol.commands.RegionBarCommand; -+import me.earthme.luminol.config.ConfigInfo; -+import me.earthme.luminol.config.DoNotLoad; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; +import me.earthme.luminol.functions.GlobalServerRegionBar; +import org.bukkit.Bukkit; + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java.patch index 190e2ab..33ec9ee 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java.patch @@ -1,11 +1,15 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java -@@ -1,0 +_,59 @@ +@@ -1,0 +_,63 @@ +package me.earthme.luminol.config.modules.misc; + +import abomination.LinearRegionFile; +import com.electronwill.nightconfig.core.file.CommentedFileConfig; -+import me.earthme.luminol.config.*; ++import me.earthme.luminol.config.EnumConfigCategory; ++import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; ++import me.earthme.luminol.config.flags.HotReloadUnsupported; +import me.earthme.luminol.utils.EnumRegionFormat; +import net.minecraft.server.MinecraftServer; + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SecureSeedConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SecureSeedConfig.java.patch index e17c110..77b521b 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SecureSeedConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SecureSeedConfig.java.patch @@ -3,14 +3,14 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class SecureSeedConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = """ -+ Once you enable secure seed, all ores and structures are generated with 1024-bit seed -+ instead of using 64-bit seed in vanilla, made seed cracker become impossible.""") ++ Once you enable secure seed, all ores and structures are generated with 1024-bit seed ++ instead of using 64-bit seed in vanilla, made seed cracker become impossible.""") + public static boolean enabled = false; + + @Override diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SentryConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SentryConfig.java.patch index 5ff6577..ad7e613 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SentryConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/SentryConfig.java.patch @@ -4,9 +4,9 @@ +package me.earthme.luminol.config.modules.misc; + +import com.electronwill.nightconfig.core.file.CommentedFileConfig; -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; +import org.apache.logging.log4j.Level; + +public class SentryConfig implements IConfigModule { diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java.patch index 9e2f7fa..dd56ee8 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,23 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class ServerModNameConfig implements IConfigModule { + @ConfigInfo(baseName = "name") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java.patch index cd458ce..fc2cbdd 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java.patch @@ -1,11 +1,14 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java -@@ -1,0 +_,51 @@ +@@ -1,0 +_,54 @@ +package me.earthme.luminol.config.modules.misc; + +import com.electronwill.nightconfig.core.file.CommentedFileConfig; +import me.earthme.luminol.commands.TpsBarCommand; -+import me.earthme.luminol.config.*; ++import me.earthme.luminol.config.EnumConfigCategory; ++import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; +import me.earthme.luminol.functions.GlobalServerTpsBar; +import org.bukkit.Bukkit; + @@ -17,11 +20,11 @@ + @ConfigInfo(baseName = "format") + public static String tpsBarFormat = "TPS: MSPT: Ping: ms ChunkHot: "; + @ConfigInfo(baseName = "tps_color_list") -+ public static List tpsColors = List.of("GREEN","YELLOW","RED","PURPLE"); ++ public static List tpsColors = List.of("GREEN", "YELLOW", "RED", "PURPLE"); + @ConfigInfo(baseName = "ping_color_list") -+ public static List pingColors = List.of("GREEN","YELLOW","RED","PURPLE"); ++ public static List pingColors = List.of("GREEN", "YELLOW", "RED", "PURPLE"); + @ConfigInfo(baseName = "chunkhot_color_list") -+ public static List chunkHotColors = List.of("GREEN","YELLOW","RED","PURPLE"); ++ public static List chunkHotColors = List.of("GREEN", "YELLOW", "RED", "PURPLE"); + @ConfigInfo(baseName = "update_interval_ticks") + public static int updateInterval = 15; + @@ -39,15 +42,15 @@ + } + + @Override -+ public void onLoaded(CommentedFileConfig configInstance){ -+ if (tpsbarEnabled){ ++ public void onLoaded(CommentedFileConfig configInstance) { ++ if (tpsbarEnabled) { + GlobalServerTpsBar.init(); -+ }else{ ++ } else { + GlobalServerTpsBar.cancelBarUpdateTask(); + } + -+ if (!inited){ -+ Bukkit.getCommandMap().register("tpsbar","luminol",new TpsBarCommand("tpsbar")); ++ if (!inited) { ++ Bukkit.getCommandMap().register("tpsbar", "luminol", new TpsBarCommand("tpsbar")); + inited = true; + } + } diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TripwireBehaviorConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TripwireBehaviorConfig.java.patch index 8589fe0..082d687 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TripwireBehaviorConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/TripwireBehaviorConfig.java.patch @@ -3,10 +3,10 @@ @@ -1,0 +_,29 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; -+import me.earthme.luminol.config.TransformedConfig; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.TransformedConfig; + +public class TripwireBehaviorConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/UsernameCheckConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/UsernameCheckConfig.java.patch index 1caa1fe..da4c307 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/UsernameCheckConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/misc/UsernameCheckConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.misc; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class UsernameCheckConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/EntityGoalSelectorInactiveTickConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/EntityGoalSelectorInactiveTickConfig.java.patch index 1b912af..41e66de 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/EntityGoalSelectorInactiveTickConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/EntityGoalSelectorInactiveTickConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class EntityGoalSelectorInactiveTickConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/GaleVariableEntityWakeupConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/GaleVariableEntityWakeupConfig.java.patch index 70f5dd7..036a72d 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/GaleVariableEntityWakeupConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/GaleVariableEntityWakeupConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class GaleVariableEntityWakeupConfig implements IConfigModule { + @ConfigInfo(baseName = "entity_wakeup_duration_ratio_standard_deviation") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/LobotomizeVillageConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/LobotomizeVillageConfig.java.patch index 1f994e2..1f97684 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/LobotomizeVillageConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/LobotomizeVillageConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,24 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class LobotomizeVillageConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java.patch index 713ab76..26d2d41 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class PetalReduceSensorWorkConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/ProjectileChunkReduceConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/ProjectileChunkReduceConfig.java.patch index 16d9c5d..6548c4a 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/ProjectileChunkReduceConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/ProjectileChunkReduceConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,22 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class ProjectileChunkReduceConfig implements IConfigModule { + @ConfigInfo(baseName = "max-loads-per-tick") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PurpurAlternativeKeepaliveConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PurpurAlternativeKeepaliveConfig.java.patch index a47e2aa..c6055f6 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PurpurAlternativeKeepaliveConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/PurpurAlternativeKeepaliveConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class PurpurAlternativeKeepaliveConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SIMDConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SIMDConfig.java.patch index 722a216..38755bb 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SIMDConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SIMDConfig.java.patch @@ -6,10 +6,10 @@ +import com.electronwill.nightconfig.core.file.CommentedFileConfig; +import com.mojang.logging.LogUtils; +import gg.pufferfish.pufferfish.simd.SIMDDetection; -+import me.earthme.luminol.config.ConfigInfo; -+import me.earthme.luminol.config.DoNotLoad; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; +import org.slf4j.Logger; + +public class SIMDConfig implements IConfigModule { @@ -30,7 +30,7 @@ + + @Override + public void onLoaded(CommentedFileConfig configInstance) { -+ if (!enabled){ ++ if (!enabled) { + return; + } + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SuffocationOptimizationConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SuffocationOptimizationConfig.java.patch index 60d7531..d4063e8 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SuffocationOptimizationConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/optimizations/SuffocationOptimizationConfig.java.patch @@ -3,9 +3,9 @@ @@ -1,0 +_,20 @@ +package me.earthme.luminol.config.modules.optimizations; + -+import me.earthme.luminol.config.ConfigInfo; +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; + +public class SuffocationOptimizationConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled") diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/removed/RemovedConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/removed/RemovedConfig.java.patch index d673c85..734e221 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/removed/RemovedConfig.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/removed/RemovedConfig.java.patch @@ -1,9 +1,13 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/config/modules/removed/RemovedConfig.java -@@ -1,0 +_,22 @@ +@@ -1,0 +_,26 @@ +package me.earthme.luminol.config.modules.removed; + -+import me.earthme.luminol.config.*; ++import me.earthme.luminol.config.EnumConfigCategory; ++import me.earthme.luminol.config.IConfigModule; ++import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.DoNotLoad; ++import me.earthme.luminol.config.flags.TransformedConfig; + +public class RemovedConfig implements IConfigModule { + @TransformedConfig(name = "example", category = {"removed", "example"}, transform = false) diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerMemoryBar.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerMemoryBar.java.patch index ef15d63..7506074 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerMemoryBar.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerMemoryBar.java.patch @@ -26,24 +26,24 @@ + protected static final NullPlugin NULL_PLUGIN = new NullPlugin(); + protected static final Map uuid2Bossbars = Maps.newConcurrentMap(); + protected static final Map scheduledTasks = new HashMap<>(); -+ protected static volatile ScheduledTask scannerTask = null; + private static final Logger logger = LogUtils.getLogger(); ++ protected static volatile ScheduledTask scannerTask = null; + -+ public static void init(){ ++ public static void init() { + cancelBarUpdateTask(); + + scannerTask = Bukkit.getGlobalRegionScheduler().runAtFixedRate(NULL_PLUGIN, unused -> { + try { + update(); -+ }catch (Exception e){ ++ } catch (Exception e) { + logger.error(e.getLocalizedMessage()); + } + }, 1, MembarConfig.updateInterval); + } + + -+ public static void cancelBarUpdateTask(){ -+ if (scannerTask == null || scannerTask.isCancelled()){ ++ public static void cancelBarUpdateTask() { ++ if (scannerTask == null || scannerTask.isCancelled()) { + return; + } + @@ -56,20 +56,20 @@ + } + } + -+ public static boolean isPlayerVisible(Player player){ ++ public static boolean isPlayerVisible(Player player) { + return ((CraftPlayer) player).getHandle().isMemBarVisible; + } + -+ public static void setVisibilityForPlayer(Player target,boolean canSee){ ++ public static void setVisibilityForPlayer(Player target, boolean canSee) { + ((CraftPlayer) target).getHandle().isMemBarVisible = canSee; + } + -+ private static void update(){ ++ private static void update() { + doUpdate(); + cleanUp(); + } + -+ private static void cleanUp(){ ++ private static void cleanUp() { + final List toCleanUp = new ArrayList<>(); + + for (Map.Entry toCheck : scheduledTasks.entrySet()) { @@ -83,7 +83,7 @@ + } + } + -+ private static void doUpdate(){ ++ private static void doUpdate() { + for (Player player : Bukkit.getOnlinePlayers()) { + scheduledTasks.computeIfAbsent(player.getUniqueId(), unused -> createBossBarForPlayer(player)); + } @@ -110,7 +110,7 @@ + + BossBar targetBossbar = uuid2Bossbars.computeIfAbsent( + playerUUID, -+ (unused1) -> BossBar.bossBar(Component.text(""),0.0F, BossBar.Color.valueOf(MembarConfig.memColors.get(3)), BossBar.Overlay.NOTCHED_20) ++ (unused1) -> BossBar.bossBar(Component.text(""), 0.0F, BossBar.Color.valueOf(MembarConfig.memColors.get(3)), BossBar.Overlay.NOTCHED_20) + ); + + apiPlayer.showBossBar(targetBossbar); @@ -125,47 +125,47 @@ + }, 1, MembarConfig.updateInterval); + } + -+ private static void updateMembar(@NotNull BossBar bar, long used, long xmx){ ++ private static void updateMembar(@NotNull BossBar bar, long used, long xmx) { + double percent = Math.max(Math.min((float) used / xmx, 1.0F), 0.0F); + bar.name(MiniMessage.miniMessage().deserialize( + MembarConfig.memBarFormat, -+ Placeholder.component("used", getMemoryComponent(used,xmx)), -+ Placeholder.component("available",getMaxMemComponent(xmx)) ++ Placeholder.component("used", getMemoryComponent(used, xmx)), ++ Placeholder.component("available", getMaxMemComponent(xmx)) + )); + bar.color(barColorFromMemory(percent)); + bar.progress((float) percent); + } + -+ private static @NotNull Component getMaxMemComponent(double max){ ++ private static @NotNull Component getMaxMemComponent(double max) { + final BossBar.Color colorBukkit = BossBar.Color.GREEN; + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.format("%.2f", max / (1024 * 1024)))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.format("%.2f", max / (1024 * 1024)))); + } + -+ private static @NotNull Component getMemoryComponent(long used,long max){ ++ private static @NotNull Component getMemoryComponent(long used, long max) { + final BossBar.Color colorBukkit = barColorFromMemory(Math.max(Math.min((float) used / max, 1.0F), 0.0F)); + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.format("%.2f", (double)used / (1024 * 1024)))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.format("%.2f", (double) used / (1024 * 1024)))); + } + -+ private static BossBar.Color barColorFromMemory(double memPercent){ -+ if (memPercent == -1){ ++ private static BossBar.Color barColorFromMemory(double memPercent) { ++ if (memPercent == -1) { + return BossBar.Color.valueOf(MembarConfig.memColors.get(3)); + } + -+ if (memPercent <= 50){ ++ if (memPercent <= 50) { + return BossBar.Color.valueOf(MembarConfig.memColors.getFirst()); + } + -+ if (memPercent <= 70){ ++ if (memPercent <= 70) { + return BossBar.Color.valueOf(MembarConfig.memColors.get(1)); + } + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerRegionBar.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerRegionBar.java.patch index b92008e..6e990a6 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerRegionBar.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerRegionBar.java.patch @@ -1,11 +1,14 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/functions/GlobalServerRegionBar.java -@@ -1,0 +_,184 @@ +@@ -1,0 +_,185 @@ +package me.earthme.luminol.functions; + +import com.google.common.collect.Maps; +import com.mojang.logging.LogUtils; -+import io.papermc.paper.threadedregions.*; ++import io.papermc.paper.threadedregions.ThreadedRegionizer; ++import io.papermc.paper.threadedregions.TickData; ++import io.papermc.paper.threadedregions.TickRegionScheduler; ++import io.papermc.paper.threadedregions.TickRegions; +import io.papermc.paper.threadedregions.scheduler.ScheduledTask; +import me.earthme.luminol.config.modules.misc.RegionBarConfig; +import me.earthme.luminol.utils.NullPlugin; @@ -26,11 +29,9 @@ + protected static final NullPlugin NULL_PLUGIN = new NullPlugin(); + protected static final Map uuid2Bossbars = Maps.newConcurrentMap(); + protected static final Map scheduledTasks = new HashMap<>(); -+ -+ protected static volatile ScheduledTask scannerTask = null; + private static final Logger logger = LogUtils.getLogger(); -+ + private static final ThreadLocal ONE_DECIMAL_PLACES = ThreadLocal.withInitial(() -> new DecimalFormat("#,##0.0")); ++ protected static volatile ScheduledTask scannerTask = null; + + public static void init() { + cancelBarUpdateTask(); diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java.patch index 2e97980..29d1cea 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java -@@ -1,0 +_,241 @@ +@@ -1,0 +_,240 @@ +package me.earthme.luminol.functions; + +import com.google.common.collect.Maps; @@ -28,25 +28,24 @@ + protected static final NullPlugin NULL_PLUGIN = new NullPlugin(); + protected static final Map uuid2Bossbars = Maps.newConcurrentMap(); + protected static final Map scheduledTasks = new HashMap<>(); -+ -+ protected static volatile ScheduledTask scannerTask = null; + private static final Logger logger = LogUtils.getLogger(); ++ protected static volatile ScheduledTask scannerTask = null; + -+ public static void init(){ ++ public static void init() { + cancelBarUpdateTask(); + + scannerTask = Bukkit.getGlobalRegionScheduler().runAtFixedRate(NULL_PLUGIN, unused -> { + try { + update(); + cleanUp(); -+ }catch (Exception e){ ++ } catch (Exception e) { + logger.error(e.getLocalizedMessage()); + } + }, 1, TpsBarConfig.updateInterval); + } + -+ public static void cancelBarUpdateTask(){ -+ if (scannerTask == null || scannerTask.isCancelled()){ ++ public static void cancelBarUpdateTask() { ++ if (scannerTask == null || scannerTask.isCancelled()) { + return; + } + @@ -59,15 +58,15 @@ + } + } + -+ public static boolean isPlayerVisible(Player player){ ++ public static boolean isPlayerVisible(Player player) { + return ((CraftPlayer) player).getHandle().isTpsBarVisible; + } + -+ public static void setVisibilityForPlayer(Player target,boolean canSee){ ++ public static void setVisibilityForPlayer(Player target, boolean canSee) { + ((CraftPlayer) target).getHandle().isTpsBarVisible = canSee; + } + -+ private static void update(){ ++ private static void update() { + for (Player player : Bukkit.getOnlinePlayers()) { + scheduledTasks.computeIfAbsent(player.getUniqueId(), unused -> createBossBarForPlayer(player)); + } @@ -106,12 +105,12 @@ + + BossBar targetBossbar = uuid2Bossbars.computeIfAbsent( + playerUUID, -+ unused -> BossBar.bossBar(Component.text(""),0.0F, BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(3)), BossBar.Overlay.NOTCHED_20) ++ unused -> BossBar.bossBar(Component.text(""), 0.0F, BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(3)), BossBar.Overlay.NOTCHED_20) + ); + + apiPlayer.showBossBar(targetBossbar); + -+ if (reportData != null){ ++ if (reportData != null) { + final TickData.SegmentData tpsData = reportData.tpsData().segmentAll(); + final double mspt = reportData.timePerTickData().segmentAll().average() / 1.0E6; + @@ -126,116 +125,116 @@ + }, 1, TpsBarConfig.updateInterval); + } + -+ private static void updateTpsBar(double tps, double mspt, @NotNull BossBar bar, @NotNull Player player){ ++ private static void updateTpsBar(double tps, double mspt, @NotNull BossBar bar, @NotNull Player player) { + bar.name(MiniMessage.miniMessage().deserialize( + TpsBarConfig.tpsBarFormat, -+ Placeholder.component("tps",getTpsComponent(tps)), -+ Placeholder.component("mspt",getMsptComponent(mspt)), -+ Placeholder.component("ping",getPingComponent(player.getPing())), -+ Placeholder.component("chunkhot",getChunkHotComponent(player.getNearbyChunkHot())) ++ Placeholder.component("tps", getTpsComponent(tps)), ++ Placeholder.component("mspt", getMsptComponent(mspt)), ++ Placeholder.component("ping", getPingComponent(player.getPing())), ++ Placeholder.component("chunkhot", getChunkHotComponent(player.getNearbyChunkHot())) + )); + bar.color(barColorFromTps(tps)); -+ bar.progress((float) Math.min((float)1,Math.max(mspt / 50,0))); ++ bar.progress((float) Math.min((float) 1, Math.max(mspt / 50, 0))); + } + -+ private static @NotNull Component getPingComponent(int ping){ ++ private static @NotNull Component getPingComponent(int ping) { + final BossBar.Color colorBukkit = barColorFromPing(ping); + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.valueOf(ping))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.valueOf(ping))); + } + -+ private static BossBar.Color barColorFromPing(int ping){ -+ if (ping == -1){ ++ private static BossBar.Color barColorFromPing(int ping) { ++ if (ping == -1) { + return BossBar.Color.valueOf(TpsBarConfig.pingColors.get(3)); + } + -+ if (ping <= 80){ ++ if (ping <= 80) { + return BossBar.Color.valueOf(TpsBarConfig.pingColors.get(0)); + } + -+ if (ping <= 160){ ++ if (ping <= 160) { + return BossBar.Color.valueOf(TpsBarConfig.pingColors.get(1)); + } + + return BossBar.Color.valueOf(TpsBarConfig.pingColors.get(2)); + } + -+ private static @NotNull Component getMsptComponent(double mspt){ ++ private static @NotNull Component getMsptComponent(double mspt) { + final BossBar.Color colorBukkit = barColorFromMspt(mspt); + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.format("%.2f", mspt))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.format("%.2f", mspt))); + } + -+ private static @NotNull Component getChunkHotComponent(long chunkHot){ ++ private static @NotNull Component getChunkHotComponent(long chunkHot) { + final BossBar.Color colorBukkit = barColorFromChunkHot(chunkHot); + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.valueOf(chunkHot))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.valueOf(chunkHot))); + } + -+ private static BossBar.Color barColorFromChunkHot(long chunkHot){ -+ if (chunkHot == -1){ ++ private static BossBar.Color barColorFromChunkHot(long chunkHot) { ++ if (chunkHot == -1) { + return BossBar.Color.valueOf(TpsBarConfig.chunkHotColors.get(3)); + } + -+ if (chunkHot <= 300000L){ ++ if (chunkHot <= 300000L) { + return BossBar.Color.valueOf(TpsBarConfig.chunkHotColors.get(0)); + } + -+ if (chunkHot <= 500000L){ ++ if (chunkHot <= 500000L) { + return BossBar.Color.valueOf(TpsBarConfig.chunkHotColors.get(1)); + } + + return BossBar.Color.valueOf(TpsBarConfig.chunkHotColors.get(2)); + } + -+ private static BossBar.Color barColorFromMspt(double mspt){ -+ if (mspt == -1){ ++ private static BossBar.Color barColorFromMspt(double mspt) { ++ if (mspt == -1) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(3)); + } + -+ if (mspt <= 25){ ++ if (mspt <= 25) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(0)); + } + -+ if (mspt <= 50){ ++ if (mspt <= 50) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(1)); + } + + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(2)); + } + -+ private static @NotNull Component getTpsComponent(double tps){ ++ private static @NotNull Component getTpsComponent(double tps) { + final BossBar.Color colorBukkit = barColorFromTps(tps); + final String colorString = colorBukkit.name(); + + final String content = "<%s>"; -+ final String replaced = String.format(content,colorString,colorString); ++ final String replaced = String.format(content, colorString, colorString); + -+ return MiniMessage.miniMessage().deserialize(replaced,Placeholder.parsed("text", String.format("%.2f", tps))); ++ return MiniMessage.miniMessage().deserialize(replaced, Placeholder.parsed("text", String.format("%.2f", tps))); + } + -+ private static BossBar.Color barColorFromTps(double tps){ -+ if (tps == -1){ ++ private static BossBar.Color barColorFromTps(double tps) { ++ if (tps == -1) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(3)); + } + -+ if (tps >= 18){ ++ if (tps >= 18) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(0)); + } + -+ if (tps >= 15){ ++ if (tps >= 15) { + return BossBar.Color.valueOf(TpsBarConfig.tpsColors.get(1)); + } + diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/EnumRegionFormat.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/EnumRegionFormat.java.patch index 48b241e..0840fbb 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/EnumRegionFormat.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/EnumRegionFormat.java.patch @@ -9,8 +9,8 @@ +import org.jetbrains.annotations.Nullable; + +public enum EnumRegionFormat { -+ MCA("mca", "mca" , (info) -> new RegionFile(info.info(), info.filePath(), info.folder(), info.sync())), -+ LINEAR_V2("linear_v2", "linear" ,(info) -> new LinearRegionFile(info.info(), info.filePath(), info.folder(), info.sync(), RegionFormatConfig.linearCompressionLevel)); ++ MCA("mca", "mca", (info) -> new RegionFile(info.info(), info.filePath(), info.folder(), info.sync())), ++ LINEAR_V2("linear_v2", "linear", (info) -> new LinearRegionFile(info.info(), info.filePath(), info.folder(), info.sync(), RegionFormatConfig.linearCompressionLevel)); + + private final String name; + private final String argument; diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/NullPlugin.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/NullPlugin.java.patch index bfd42a8..644ee61 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/NullPlugin.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/NullPlugin.java.patch @@ -3,27 +3,26 @@ @@ -1,0 +_,152 @@ +package me.earthme.luminol.utils; + -+import io.papermc.paper.plugin.configuration.PluginMeta; -+import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager; +import org.bukkit.Server; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.generator.BiomeProvider; +import org.bukkit.generator.ChunkGenerator; -+import org.bukkit.plugin.*; ++import org.bukkit.plugin.PluginBase; ++import org.bukkit.plugin.PluginDescriptionFile; ++import org.bukkit.plugin.PluginLoader; ++import org.bukkit.plugin.PluginLogger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.InputStream; +import java.util.List; -+import java.util.logging.Logger; -+ -+public class NullPlugin extends PluginBase { -+ private boolean enabled = true; + ++public class NullPlugin extends PluginBase { + private final String pluginName; ++ private boolean enabled = true; + private PluginDescriptionFile pdf; + + public NullPlugin() { @@ -31,10 +30,6 @@ + pdf = new PluginDescriptionFile(pluginName, "1.0", "nms"); + } + -+ public void setEnabled(boolean enabled) { -+ this.enabled = enabled; -+ } -+ + @Override + public File getDataFolder() { + throw new UnsupportedOperationException("Not supported."); @@ -44,17 +39,18 @@ + public PluginDescriptionFile getDescription() { + return pdf; + } ++ + // Paper start + @Override + public io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() { + return pdf; + } -+ // Paper end + + @Override + public FileConfiguration getConfig() { + throw new UnsupportedOperationException("Not supported."); + } ++ // Paper end + + @Override + public InputStream getResource(String filename) { @@ -101,6 +97,10 @@ + return enabled; + } + ++ public void setEnabled(boolean enabled) { ++ this.enabled = enabled; ++ } ++ + @Override + public void onDisable() { + throw new UnsupportedOperationException("Not supported."); diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/RegionCreatorInfo.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/RegionCreatorInfo.java.patch index 2ed6eee..70e0f7e 100644 --- a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/RegionCreatorInfo.java.patch +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/utils/RegionCreatorInfo.java.patch @@ -1,10 +1,11 @@ --- /dev/null +++ b/src/main/java/me/earthme/luminol/utils/RegionCreatorInfo.java -@@ -1,0 +_,7 @@ +@@ -1,0 +_,8 @@ +package me.earthme.luminol.utils; + +import net.minecraft.world.level.chunk.storage.RegionStorageInfo; + +import java.nio.file.Path; + -+public record RegionCreatorInfo (RegionStorageInfo info, Path filePath, Path folder, boolean sync) {} ++public record RegionCreatorInfo(RegionStorageInfo info, Path filePath, Path folder, boolean sync) { ++}