aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-softspoon.tar.gz
Paper-softspoon.zip
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch')
-rw-r--r--patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch b/patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch
new file mode 100644
index 0000000000..47870fe56d
--- /dev/null
+++ b/patch-remap/og/net/minecraft/server/dedicated/DedicatedServerProperties.patch
@@ -0,0 +1,74 @@
+--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
++++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
+@@ -44,11 +44,16 @@
+ import net.minecraft.world.level.levelgen.presets.WorldPresets;
+ import org.slf4j.Logger;
+
++// CraftBukkit start
++import joptsimple.OptionSet;
++// CraftBukkit end
++
+ public class DedicatedServerProperties extends PropertyManager<DedicatedServerProperties> {
+
+ static final Logger LOGGER = LogUtils.getLogger();
+ private static final Pattern SHA1 = Pattern.compile("^[a-fA-F0-9]{40}$");
+ private static final Splitter COMMA_SPLITTER = Splitter.on(',').trimResults();
++ public final boolean debug = this.get("debug", false); // CraftBukkit
+ public final boolean onlineMode = this.get("online-mode", true);
+ public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
+ public final String serverIp = this.get("server-ip", "");
+@@ -103,8 +108,10 @@
+ private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
+ public final WorldOptions worldOptions;
+
+- public DedicatedServerProperties(Properties properties) {
+- super(properties);
++ // CraftBukkit start
++ public DedicatedServerProperties(Properties properties, OptionSet optionset) {
++ super(properties, optionset);
++ // CraftBukkit end
+ this.difficulty = (EnumDifficulty) this.get("difficulty", dispatchNumberOrString(EnumDifficulty::byId, EnumDifficulty::byName), EnumDifficulty::getKey, EnumDifficulty.EASY);
+ this.gamemode = (EnumGamemode) this.get("gamemode", dispatchNumberOrString(EnumGamemode::byId, EnumGamemode::byName), EnumGamemode::getName, EnumGamemode.SURVIVAL);
+ this.levelName = this.get("level-name", "world");
+@@ -161,13 +168,15 @@
+ this.initialDataPackConfiguration = getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled())));
+ }
+
+- public static DedicatedServerProperties fromFile(Path path) {
+- return new DedicatedServerProperties(loadFromFile(path));
++ // CraftBukkit start
++ public static DedicatedServerProperties fromFile(Path path, OptionSet optionset) {
++ return new DedicatedServerProperties(loadFromFile(path), optionset);
+ }
+
+ @Override
+- protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties) {
+- return new DedicatedServerProperties(properties);
++ protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties, OptionSet optionset) {
++ return new DedicatedServerProperties(properties, optionset);
++ // CraftBukkit end
+ }
+
+ @Nullable
+@@ -248,10 +257,10 @@
+ }).orElseThrow(() -> {
+ return new IllegalStateException("Invalid datapack contents: can't find default preset");
+ });
+- Optional optional = Optional.ofNullable(MinecraftKey.tryParse(this.levelType)).map((minecraftkey) -> {
++ Optional<ResourceKey<WorldPreset>> optional = Optional.ofNullable(MinecraftKey.tryParse(this.levelType)).map((minecraftkey) -> { // CraftBukkit - decompile error
+ return ResourceKey.create(Registries.WORLD_PRESET, minecraftkey);
+ }).or(() -> {
+- return Optional.ofNullable((ResourceKey) DedicatedServerProperties.WorldDimensionData.LEGACY_PRESET_NAMES.get(this.levelType));
++ return Optional.ofNullable(DedicatedServerProperties.WorldDimensionData.LEGACY_PRESET_NAMES.get(this.levelType)); // CraftBukkit - decompile error
+ });
+
+ Objects.requireNonNull(iregistry);
+@@ -263,7 +272,7 @@
+
+ if (holder.is(WorldPresets.FLAT)) {
+ RegistryOps<JsonElement> registryops = RegistryOps.create(JsonOps.INSTANCE, (HolderLookup.b) iregistrycustom);
+- DataResult dataresult = GeneratorSettingsFlat.CODEC.parse(new Dynamic(registryops, this.generatorSettings()));
++ DataResult<GeneratorSettingsFlat> dataresult = GeneratorSettingsFlat.CODEC.parse(new Dynamic(registryops, this.generatorSettings())); // CraftBukkit - decompile error
+ Logger logger = DedicatedServerProperties.LOGGER;
+
+ Objects.requireNonNull(logger);