diff --git a/patches/server/Fix-generator-settings-string-for-flat-type-worlds.patch b/patches/server/Fix-generator-settings-string-for-flat-type-worlds.patch new file mode 100644 index 0000000000..02e3e7e46f --- /dev/null +++ b/patches/server/Fix-generator-settings-string-for-flat-type-worlds.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 9 Mar 2022 12:51:29 -0800 +Subject: [PATCH] Fix generator settings string for flat-type worlds + +Fixes MC-195468 + +diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java +@@ -0,0 +0,0 @@ public class WorldGenSettings { + String var8 = worldGenProperties.levelType(); + switch(var8) { + case "flat": +- Dynamic dynamic = new Dynamic<>(JsonOps.INSTANCE, worldGenProperties.generatorSettings()); ++ Dynamic dynamic = new Dynamic<>(net.minecraft.resources.RegistryOps.create(JsonOps.INSTANCE, registryManager), worldGenProperties.generatorSettings()); // Paper - needs RegistryOps to access biome registry inside FlatLevelGeneratorSettings's Codec, Fixes MC-195468 + return new WorldGenSettings(l, worldGenProperties.generateStructures(), false, withOverworld(registry, registry4, new FlatLevelSource(registry3, FlatLevelGeneratorSettings.CODEC.parse(dynamic).resultOrPartial(LOGGER::error).orElseGet(() -> { + return FlatLevelGeneratorSettings.getDefault(registry2, registry3); + })))); diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index e91450d1d5..259786a76d 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -345,3 +345,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java +@@ -0,0 +0,0 @@ import org.apache.commons.lang3.StringUtils; + import org.slf4j.Logger; + + public class WorldGenSettings { +- public static final Codec CODEC = RecordCodecBuilder.create((instance) -> { ++ public static final Codec CODEC = RecordCodecBuilder.create((instance) -> { // Paper - decompile fix + return instance.group(Codec.LONG.fieldOf("seed").stable().forGetter(WorldGenSettings::seed), Codec.BOOL.fieldOf("generate_features").orElse(true).stable().forGetter(WorldGenSettings::generateFeatures), Codec.BOOL.fieldOf("bonus_chest").orElse(false).stable().forGetter(WorldGenSettings::generateBonusChest), RegistryCodecs.dataPackAwareCodec(Registry.LEVEL_STEM_REGISTRY, Lifecycle.stable(), LevelStem.CODEC).xmap(LevelStem::sortMap, Function.identity()).fieldOf("dimensions").forGetter(WorldGenSettings::dimensions), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((worldGenSettings) -> { + return worldGenSettings.legacyCustomOptions; + })).apply(instance, instance.stable(WorldGenSettings::new));