From d63b408e89e34b8e65b355dec045ace6b1518f55 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Thu, 28 Sep 2023 00:48:30 +0900 Subject: [PATCH] Fix build --- .../server/0006-Plazma-Configurations.patch | 18 +++++++++++------- .../server/0009-Console-logging-tweaks.patch | 4 ++-- ...010-Add-option-to-allow-any-usernames.patch | 4 ++-- .../0015-Reduce-create-random-instance.patch | 13 +++++++++++-- ...-LootTable-for-non-player-interaction.patch | 4 ++-- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/patches/server/0006-Plazma-Configurations.patch b/patches/server/0006-Plazma-Configurations.patch index 05e78bff3..a56ef8849 100644 --- a/patches/server/0006-Plazma-Configurations.patch +++ b/patches/server/0006-Plazma-Configurations.patch @@ -578,14 +578,15 @@ index 0000000000000000000000000000000000000000..85002144e0b350c4ae044e1a4a4c1734 +} diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java new file mode 100644 -index 0000000000000000000000000000000000000000..92524f24bdb56a861b06fffc900ff3c118bdb4ee +index 0000000000000000000000000000000000000000..b9a6c781684b080bcfb07495e561325d594eeafd --- /dev/null +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,37 @@ +package org.plazmamc.plazma.configurations; + +import io.papermc.paper.configuration.Configuration; +import io.papermc.paper.configuration.ConfigurationPart; ++import org.jetbrains.annotations.NotNull; +import org.spongepowered.configurate.objectmapping.meta.Setting; + +@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"}) @@ -598,8 +599,11 @@ index 0000000000000000000000000000000000000000..92524f24bdb56a861b06fffc900ff3c1 + return instance; + } + -+ static void set(GlobalConfiguration instance) { ++ static void set(@NotNull GlobalConfiguration instance, boolean test) { + GlobalConfiguration.instance = instance; ++ if (test) { ++ ++ } + } + + @Setting(Configuration.VERSION_FIELD) @@ -668,7 +672,7 @@ index 0000000000000000000000000000000000000000..d990c031255daf0d43541efe175c5b52 +} diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java new file mode 100644 -index 0000000000000000000000000000000000000000..39db772735d57e12bbb26a6505ca7a5e360cdd78 +index 0000000000000000000000000000000000000000..295578fddc8f897763d0af9836cdd93b0d3cef31 --- /dev/null +++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java @@ -0,0 +1,309 @@ @@ -844,7 +848,7 @@ index 0000000000000000000000000000000000000000..39db772735d57e12bbb26a6505ca7a5e + @Override + public GlobalConfiguration initializeGlobalConfiguration() throws ConfigurateException { + GlobalConfiguration configuration = super.initializeGlobalConfiguration(); -+ GlobalConfiguration.set(configuration); ++ GlobalConfiguration.set(configuration, false); + return configuration; + } + @@ -1012,7 +1016,7 @@ index 8174b6bb78553cbe124b499ffa235368179d1564..a5f8a128b27906daba5aeb293851bb03 diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java new file mode 100644 -index 0000000000000000000000000000000000000000..2b9a17a2e04f7fb6b801920ed04133db9478f984 +index 0000000000000000000000000000000000000000..adf57600250b05e1d7cf617d7f58797d2663bca9 --- /dev/null +++ b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java @@ -0,0 +1,18 @@ @@ -1027,7 +1031,7 @@ index 0000000000000000000000000000000000000000..2b9a17a2e04f7fb6b801920ed04133db + ConfigurationNode node = PlazmaConfigurations.createForTesting(); + try { + GlobalConfiguration globalConfiguration = node.require(GlobalConfiguration.class); -+ GlobalConfiguration.set(globalConfiguration); ++ GlobalConfiguration.set(globalConfiguration, true); + } catch (SerializationException e) { + throw new RuntimeException(e); + } diff --git a/patches/server/0009-Console-logging-tweaks.patch b/patches/server/0009-Console-logging-tweaks.patch index 11ad6f9ac..03b421a20 100644 --- a/patches/server/0009-Console-logging-tweaks.patch +++ b/patches/server/0009-Console-logging-tweaks.patch @@ -57,10 +57,10 @@ index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb17 if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { return false; diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -index 92524f24bdb56a861b06fffc900ff3c118bdb4ee..25cd126e676e7114dea5357acbbbc3ed52c82e39 100644 +index b9a6c781684b080bcfb07495e561325d594eeafd..59c862c0e8a4111d4e9aa14a424b15cd9c37e6d1 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -30,4 +30,12 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -34,4 +34,12 @@ public class GlobalConfiguration extends ConfigurationPart { public class Player extends ConfigurationPart { } diff --git a/patches/server/0010-Add-option-to-allow-any-usernames.patch b/patches/server/0010-Add-option-to-allow-any-usernames.patch index 0a89cf2a5..6eb6dc442 100644 --- a/patches/server/0010-Add-option-to-allow-any-usernames.patch +++ b/patches/server/0010-Add-option-to-allow-any-usernames.patch @@ -17,10 +17,10 @@ index b875f4af9dcb45bcad0ee59a958442ba673268fe..d38685f82d2e6c4e71179bf3a85a8b18 // Paper start - validate usernames if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) { diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -index 25cd126e676e7114dea5357acbbbc3ed52c82e39..351379de0811b3dc610e8bb0b526b3431e856b1c 100644 +index 59c862c0e8a4111d4e9aa14a424b15cd9c37e6d1..8636ec3e130b73af0ec1b069aea6e04bc54cebdf 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -29,6 +29,8 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -33,6 +33,8 @@ public class GlobalConfiguration extends ConfigurationPart { public Player player; public class Player extends ConfigurationPart { diff --git a/patches/server/0015-Reduce-create-random-instance.patch b/patches/server/0015-Reduce-create-random-instance.patch index f2196f4ad..1ac13a8f5 100644 --- a/patches/server/0015-Reduce-create-random-instance.patch +++ b/patches/server/0015-Reduce-create-random-instance.patch @@ -357,10 +357,19 @@ index 0000000000000000000000000000000000000000..4421110e20a006c3773e922eb0facc88 + +} diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -index 351379de0811b3dc610e8bb0b526b3431e856b1c..f4634cc41e1aabc1e656f6720700c580645c8709 100644 +index 8636ec3e130b73af0ec1b069aea6e04bc54cebdf..4ce28f5f7c47c77ca299d1ff9a99d26c4a066215 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -24,6 +24,9 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -18,7 +18,7 @@ public class GlobalConfiguration extends ConfigurationPart { + static void set(@NotNull GlobalConfiguration instance, boolean test) { + GlobalConfiguration.instance = instance; + if (test) { +- ++ instance.misc.reduceCreateRandomInstance = false; + } + } + +@@ -28,6 +28,9 @@ public class GlobalConfiguration extends ConfigurationPart { public Misc misc; public class Misc extends ConfigurationPart { diff --git a/patches/server/0018-Don-t-refresh-LootTable-for-non-player-interaction.patch b/patches/server/0018-Don-t-refresh-LootTable-for-non-player-interaction.patch index 2e5c0b10f..dd28d4b43 100644 --- a/patches/server/0018-Don-t-refresh-LootTable-for-non-player-interaction.patch +++ b/patches/server/0018-Don-t-refresh-LootTable-for-non-player-interaction.patch @@ -17,10 +17,10 @@ index 081691f9710ff1115e4308f79ed49fbc38941193..79a27755534384ab94e79e422c0a5e9c LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable); if (player instanceof ServerPlayer) { diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -index f4634cc41e1aabc1e656f6720700c580645c8709..b58d91e842c29a28e8c6cbb275f2906eb361626a 100644 +index 4ce28f5f7c47c77ca299d1ff9a99d26c4a066215..065a4113f0b1dc1ee122af34609d0de02f62f9de 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -26,6 +26,7 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -30,6 +30,7 @@ public class GlobalConfiguration extends ConfigurationPart { public boolean reduceCreateRandomInstance = DO_OPTIMIZE; public boolean suppressThreadSafeRandom = DO_OPTIMIZE;