Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Sep 27, 2023
1 parent 5efc27e commit d63b408
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
18 changes: 11 additions & 7 deletions patches/server/0006-Plazma-Configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand All @@ -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)
Expand Down Expand Up @@ -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 @@
Expand Down Expand Up @@ -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;
+ }
+
Expand Down Expand Up @@ -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 @@
Expand All @@ -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);
+ }
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0009-Console-logging-tweaks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

}
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0010-Add-option-to-allow-any-usernames.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
13 changes: 11 additions & 2 deletions patches/server/0015-Reduce-create-random-instance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d63b408

Please sign in to comment.