diff --git a/patches/server/0006-Leaves-Server-Config-And-Command.patch b/patches/server/0006-Leaves-Server-Config-And-Command.patch index 497af282..b278106a 100644 --- a/patches/server/0006-Leaves-Server-Config-And-Command.patch +++ b/patches/server/0006-Leaves-Server-Config-And-Command.patch @@ -85,7 +85,7 @@ index c2c421b1caf76b40542fdc436801accbe97a38cb..29f139fb4d70a9a362ac0a30579eb0b4 .withRequiredArg() diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d616c2547a6 +index 0000000000000000000000000000000000000000..f554b8e61a31c307bb46fa007c54f2b842be4dfc --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java @@ -0,0 +1,939 @@ @@ -201,7 +201,7 @@ index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d61 + } + + @RemovedConfig(name = "unable-fakeplayer-names", category = "fakeplayer", transform = true) -+ @GlobalConfig(name = "unable-fakeplayer-names", category = {"modify", "fakeplayer"}, verify = ConfigVerify.ListConfigVerify.class) ++ @GlobalConfig(name = "unable-fakeplayer-names", category = {"modify", "fakeplayer"}, verify = ConfigVerify.ListConfigVerify.STRING.class) + public static List unableFakeplayerNames = List.of("player-name"); + + @GlobalConfig(name = "limit", category = {"modify", "fakeplayer"}, verify = ConfigVerify.IntConfigVerify.class) @@ -892,7 +892,7 @@ index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d61 + @GlobalConfig(name = "allow-experimental", category = {"misc", "auto-update"}) + public static Boolean autoUpdateAllowExperimental = false; + -+ @GlobalConfig(name = "time", category = {"misc", "auto-update"}, lock = true, verify = ConfigVerify.ListConfigVerify.class) ++ @GlobalConfig(name = "time", category = {"misc", "auto-update"}, lock = true, verify = ConfigVerify.ListConfigVerify.STRING.class) + public static List autoUpdateTime = List.of("14:00", "2:00"); + + // Leaves end - misc - auto-update @@ -916,13 +916,13 @@ index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d61 + @GlobalConfig(name = "login-protect", category = {"misc", "extra-yggdrasil-service"}) + public static boolean extraYggdrasilLoginProtect = false; + -+ @GlobalConfig(name = "urls", category = {"misc", "extra-yggdrasil-service"}, verify = ExtraYggdrasilUrlsVerify.class) ++ @GlobalConfig(name = "urls", category = {"misc", "extra-yggdrasil-service"}, lock = true, verify = ExtraYggdrasilUrlsVerify.class) + public static List extraYggdrasilServiceList = List.of("https://url.with.authlib-injector-yggdrasil"); + -+ public static class ExtraYggdrasilUrlsVerify extends ConfigVerify.ListConfigVerify { ++ public static class ExtraYggdrasilUrlsVerify extends ConfigVerify.ListConfigVerify { + @Override -+ public String check(List old, List value) { -+ org.leavesmc.leaves.profile.LeavesMinecraftSessionService.initExtraYggdrasilList(); ++ public String check(List old, List value) { ++ org.leavesmc.leaves.profile.LeavesMinecraftSessionService.initExtraYggdrasilList(value); + return null; + } + } @@ -1463,10 +1463,10 @@ index 0000000000000000000000000000000000000000..3ddeff82e31178c9c1bb1737c9a28a81 +} diff --git a/src/main/java/org/leavesmc/leaves/config/ConfigVerify.java b/src/main/java/org/leavesmc/leaves/config/ConfigVerify.java new file mode 100644 -index 0000000000000000000000000000000000000000..08ffa951d8fd835f075c45021f56cec19f03e7fc +index 0000000000000000000000000000000000000000..e3cfc606222f27f029ff8e4d1fd370685e76e325 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/config/ConfigVerify.java -@@ -0,0 +1,90 @@ +@@ -0,0 +1,93 @@ +package org.leavesmc.leaves.config; + +import java.lang.reflect.ParameterizedType; @@ -1522,9 +1522,12 @@ index 0000000000000000000000000000000000000000..08ffa951d8fd835f075c45021f56cec1 + } + } + -+ class ListConfigVerify implements ConfigVerify> { ++ abstract class ListConfigVerify implements ConfigVerify> { ++ public static class STRING extends ListConfigVerify { ++ } ++ + @Override -+ public List convert(String value) { ++ public List convert(String value) { + throw new IllegalArgumentException("not support"); // TODO + } + } @@ -1539,7 +1542,7 @@ index 0000000000000000000000000000000000000000..08ffa951d8fd835f075c45021f56cec1 + Type genericSuperclass = getClass().getGenericSuperclass(); + Type[] typeArguments = ((ParameterizedType) genericSuperclass).getActualTypeArguments(); + this.enumClass = (Class) typeArguments[0]; -+ this.enumValues = new ArrayList<>(){{ ++ this.enumValues = new ArrayList<>() {{ + for (E e : enumClass.getEnumConstants()) { + add(e.name().toLowerCase(Locale.ROOT)); + } diff --git a/patches/server/0047-Leaves-Extra-Yggdrasil-Service.patch b/patches/server/0047-Leaves-Extra-Yggdrasil-Service.patch index 74cfb987..f83ed2b7 100644 --- a/patches/server/0047-Leaves-Extra-Yggdrasil-Service.patch +++ b/patches/server/0047-Leaves-Extra-Yggdrasil-Service.patch @@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..6f14a66d78709fae9fecbefc80e3489b +} diff --git a/src/main/java/org/leavesmc/leaves/profile/LeavesMinecraftSessionService.java b/src/main/java/org/leavesmc/leaves/profile/LeavesMinecraftSessionService.java new file mode 100644 -index 0000000000000000000000000000000000000000..c99092acd7aecb7f4c4c5cd1327991d9d468c5c5 +index 0000000000000000000000000000000000000000..b15ee80ac1aea751594cd3321928f26d3cbf243e --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/profile/LeavesMinecraftSessionService.java @@ -0,0 +1,102 @@ @@ -124,9 +124,9 @@ index 0000000000000000000000000000000000000000..c99092acd7aecb7f4c4c5cd1327991d9 + + private static List extraYggdrasilList = List.of(); + -+ public static void initExtraYggdrasilList() { ++ public static void initExtraYggdrasilList(List extraYggdrasilServiceList) { + List list = new ArrayList<>(); -+ for (String str : LeavesConfig.extraYggdrasilServiceList) { ++ for (String str : extraYggdrasilServiceList) { + list.add(HttpAuthenticationService.constantURL(str + "/sessionserver/session/minecraft/hasJoined")); + } + extraYggdrasilList = Collections.unmodifiableList(list); @@ -174,8 +174,8 @@ index 0000000000000000000000000000000000000000..c99092acd7aecb7f4c4c5cd1327991d9 + } + + final Set profileActions = response.profileActions().stream() -+ .map(ProfileAction::type) -+ .collect(Collectors.toSet()); ++ .map(ProfileAction::type) ++ .collect(Collectors.toSet()); + return new ProfileResult(result1, profileActions); + } + } catch (final MinecraftClientException e) {