Fix generator settings string for flat-type worlds (#7568)

This commit is contained in:
Jake Potrebic
2022-03-21 11:06:26 -07:00
parent b7490f963f
commit bdb0f73b6b
2 changed files with 33 additions and 0 deletions

View File

@@ -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<WorldGenSettings> CODEC = RecordCodecBuilder.create((instance) -> {
+ public static final Codec<WorldGenSettings> CODEC = RecordCodecBuilder.<WorldGenSettings>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));