diff --git a/gradle.properties b/gradle.properties index d84f58c8..1d7c8ada 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=org.leavesmc.leaves version=1.21.3-R0.1-SNAPSHOT mcVersion=1.21.3 paperRef=5a60ffb8b1cc88c1480a4c5f5c221291be97527f -preVersion=true +preVersion=false org.gradle.jvmargs=-Xmx2G org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0006-Leaves-Server-Config-And-Command.patch b/patches/server/0006-Leaves-Server-Config-And-Command.patch index ce350737..816c645a 100644 --- a/patches/server/0006-Leaves-Server-Config-And-Command.patch +++ b/patches/server/0006-Leaves-Server-Config-And-Command.patch @@ -1689,10 +1689,10 @@ index 0000000000000000000000000000000000000000..1e109a8b95f7dd25f68f7b3d2115c8cf +} diff --git a/src/main/java/org/leavesmc/leaves/config/GlobalConfigCreator.java b/src/main/java/org/leavesmc/leaves/config/GlobalConfigCreator.java new file mode 100644 -index 0000000000000000000000000000000000000000..baa8f15c5ef092f287004b8266b7f7cee1392260 +index 0000000000000000000000000000000000000000..dfc38bd1fbec54da52188e9ea860448e14342a99 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/config/GlobalConfigCreator.java -@@ -0,0 +1,83 @@ +@@ -0,0 +1,84 @@ +package org.leavesmc.leaves.config; + +import org.bukkit.configuration.file.YamlConfiguration; @@ -1702,17 +1702,18 @@ index 0000000000000000000000000000000000000000..baa8f15c5ef092f287004b8266b7f7ce + +import java.io.File; +import java.io.IOException; -+import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Collections; + +import static org.leavesmc.leaves.config.GlobalConfigManager.CONFIG_START; + ++@SuppressWarnings("CallToPrintStackTrace") +public class GlobalConfigCreator { + + private static YamlConfiguration config; + ++ @SuppressWarnings("ResultOfMethodCallIgnored") + public static void main(String[] args) { + config = new YamlConfiguration(); + config.options().setHeader(Collections.singletonList(LeavesConfig.CONFIG_HEADER)); @@ -1750,7 +1751,7 @@ index 0000000000000000000000000000000000000000..baa8f15c5ef092f287004b8266b7f7ce + } + + private static void initField(@NotNull Field field, @Nullable Object upstreamField, @NotNull String upstreamPath) { -+ if (Modifier.isStatic(field.getModifiers())) { ++ if (upstreamField != null || Modifier.isStatic(field.getModifiers())) { + field.setAccessible(true); + + GlobalConfig globalConfig = field.getAnnotation(GlobalConfig.class); @@ -1770,7 +1771,7 @@ index 0000000000000000000000000000000000000000..baa8f15c5ef092f287004b8266b7f7ce + private static void initConfig(@NotNull Field field, GlobalConfig globalConfig, @Nullable Object upstreamField, @NotNull String upstreamPath) { + try { + GlobalConfigManager.VerifiedConfig verifiedConfig = GlobalConfigManager.VerifiedConfig.build(globalConfig, field, upstreamField, upstreamPath); -+ config.set(verifiedConfig.path(), verifiedConfig.validator().saveConvert(field.get(null))); ++ config.set(verifiedConfig.path(), verifiedConfig.validator().saveConvert(field.get(upstreamField))); + } catch (Exception e) { + e.printStackTrace(); + }