Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed May 9, 2024
1 parent 930ef33 commit 4a3d274
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
46 changes: 31 additions & 15 deletions patches/server/0005-Plazma-Configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ index 6d549448e67a110a42dde6f8eeaab1f0033f3462..065308f8cca471dee8360857bd627402

private void readScoreboard(DimensionDataStorage persistentStateManager) {
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..fbe39a996773c0a6ac2f74b3c7342724f8d2d842 100644
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..44821067c590809e4c76665474cee92ef50191e8 100644
--- a/src/main/java/net/minecraft/server/Services.java
+++ b/src/main/java/net/minecraft/server/Services.java
@@ -12,13 +12,34 @@ import net.minecraft.util.SignatureValidator;
@@ -12,13 +12,44 @@ import net.minecraft.util.SignatureValidator;


public record Services(
Expand All @@ -555,19 +555,28 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..fbe39a996773c0a6ac2f74b3c7342724
+ // Plazma end - Configurable Plazma
) {
// Paper start - add paper configuration files
+ // Plazma start - Configurable Plazma
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
- this(sessionService, servicesKeySet, profileRepository, profileCache, null);
this(sessionService, servicesKeySet, profileRepository, profileCache, null);
}

+ // Plazma start - Configurable Plazma
+ public Services(
+ MinecraftSessionService sessionService,
+ ServicesKeySet servicesKeySet,
+ GameProfileRepository profileRepository,
+ GameProfileCache profileCache,
+ @org.jetbrains.annotations.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations
+ ) {
+ this(
+ sessionService,
+ servicesKeySet,
+ profileRepository,
+ profileCache,
+ null,
+ paperConfigurations,
+ null
+ );
}
+ }
+
+ @Override
+ public org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations() {
+ return java.util.Objects.requireNonNull(this.plazmaConfigurations);
Expand All @@ -577,15 +586,20 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..fbe39a996773c0a6ac2f74b3c7342724
@Override
public io.papermc.paper.configuration.PaperConfigurations paperConfigurations() {
return java.util.Objects.requireNonNull(this.paperConfigurations);
@@ -34,7 +55,11 @@ public record Services(
@@ -34,7 +65,16 @@ public record Services(
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
+ // Plazma start - Configurable Plazma
+ final java.nio.file.Path plazmaConfigDirPath = ((File) optionSet.valueOf("plazma-settings-directory")).toPath();
+ org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations = new org.plazmamc.plazma.configurations.PlazmaConfigurations(plazmaConfigDirPath);
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, plazmaConfigurations);
+ return new Services(
+ minecraftSessionService,
+ authenticationService.getServicesKeySet(),
+ gameProfileRepository,
+ gameProfileCache,
+ paperConfigurations,
+ new org.plazmamc.plazma.configurations.PlazmaConfigurations(optionSet)
+ );
+ // Plazma end
// Paper end - load paper config files from cli options
}
Expand Down Expand Up @@ -1040,15 +1054,16 @@ index 0000000000000000000000000000000000000000..d8006ae086c18a4ef43906d516eba0d5
+}
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..1cda921b88e0c01f9376eaafddde6d20e72fd346
index 0000000000000000000000000000000000000000..09053b4ccf268fd204c81dbb8d4f10fa9edcad5f
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -0,0 +1,217 @@
@@ -0,0 +1,219 @@
+package org.plazmamc.plazma.configurations;
+
+import com.mojang.logging.LogUtils;
+import io.papermc.paper.configuration.ConfigurationPart;
+import io.papermc.paper.configuration.Configurations;
+import joptsimple.OptionSet;
+import net.minecraft.core.RegistryAccess;
+import net.minecraft.server.level.ServerLevel;
+import org.checkerframework.checker.nullness.qual.NonNull;
Expand All @@ -1064,6 +1079,7 @@ index 0000000000000000000000000000000000000000..1cda921b88e0c01f9376eaafddde6d20
+import org.spongepowered.configurate.objectmapping.ObjectMapper;
+import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.util.function.Function;
+
Expand Down Expand Up @@ -1157,8 +1173,8 @@ index 0000000000000000000000000000000000000000..1cda921b88e0c01f9376eaafddde6d20
+ CONFIG_DIR, WORLD_DEFAULTS_CONFIG_FILE_NAME
+ );
+
+ public PlazmaConfigurations(final Path globalFolder) {
+ super(globalFolder);
+ public PlazmaConfigurations(final OptionSet optionSet) {
+ super(((File) optionSet.valueOf("plazma-settings-directory")).toPath());
+ }
+
+ @Override
Expand Down
12 changes: 6 additions & 6 deletions patches/server/0012-Optimize-default-configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
}

diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 252e5f67f39c1fb5db2cba3a6cbc5490d472a29b..846b5b672c93e876b3d0ade4fed37d78b97bd5e7 100644
index c464e8440e854bd0d68042fdb9937fcfa8b77485..d2215f5293c568b4ae525f4a63996bac6edf787b 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -178,7 +178,7 @@ public class Main {
Expand All @@ -292,7 +292,7 @@ index 252e5f67f39c1fb5db2cba3a6cbc5490d472a29b..846b5b672c93e876b3d0ade4fed37d78

File commandFile = (File) optionset.valueOf("commands-settings");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index d43ebcf4448240f86eca1a4127b534851e7b9618..7d4872beca68f081d8f9f32cf8b2ab40957870ca 100644
index 55e16ed1151c5d53f492581f66a3406ac418b653..9af7df196ed74a48a6b6426df36353f92fb7728d 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -131,14 +131,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
Expand Down Expand Up @@ -324,7 +324,7 @@ index d43ebcf4448240f86eca1a4127b534851e7b9618..7d4872beca68f081d8f9f32cf8b2ab40
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 76d61c1f0a8e2fd0bed6be3052828a04aedb443d..257b050f552f2edab861df9c5f00b05cafa385b1 100644
index 26e93a0c346204ccccf8255d0f87da03e943bcfb..d53be3e57e97cf9806b04f6d6bdd6a3a9fdb299b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -426,7 +426,7 @@ public final class CraftServer implements Server {
Expand All @@ -348,10 +348,10 @@ index b02a0dddd99df1691c125660828a61cc4a5a4d02..d6ead6b1bc73df85a8e8938acd2e8465

}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
index 1cda921b88e0c01f9376eaafddde6d20e72fd346..b04075cef0468ed2c54cb7a42e4bd8f61f637033 100644
index 09053b4ccf268fd204c81dbb8d4f10fa9edcad5f..93f67f125b3674e645cfdae27e579e12d31a236e 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -33,6 +33,15 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Wo
@@ -35,6 +35,15 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Wo
static final String WORLD_CONFIG_FILE_NAME = "plazma-world.yml";
static final boolean OPTIMIZE = !Options.NO_OPTIMIZE;

Expand All @@ -368,7 +368,7 @@ index 1cda921b88e0c01f9376eaafddde6d20e72fd346..b04075cef0468ed2c54cb7a42e4bd8f6
#### ENGLISH ####
This is the %s configuration file for Plazma.
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae5386ce01410 100644
index 85f4a9300aebfd4ee64d179dfa1f7ffd314cb3b8..fa209964eec7dae8e2a0fa7bb44e0e8791e75248 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -49,6 +49,7 @@ public class PurpurConfig {
Expand Down

0 comments on commit 4a3d274

Please sign in to comment.