--- a/net/minecraft/world/level/levelgen/GeneratorSettings.java
+++ b/net/minecraft/world/level/levelgen/GeneratorSettings.java
@@ -35,9 +35,14 @@
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
+// CraftBukkit start
+import net.minecraft.resources.RegistryReadOps;
+import net.minecraft.server.packs.resources.IResourceManager;
+// CraftBukkit end
+
 public class GeneratorSettings {
 
-    public static final Codec<GeneratorSettings> CODEC = RecordCodecBuilder.create((instance) -> {
+    public static final Codec<GeneratorSettings> CODEC = RecordCodecBuilder.<GeneratorSettings>create((instance) -> { // CraftBukkit - decompile error
         return instance.group(Codec.LONG.fieldOf("seed").stable().forGetter(GeneratorSettings::getSeed), Codec.BOOL.fieldOf("generate_features").orElse(true).stable().forGetter(GeneratorSettings::shouldGenerateMapFeatures), Codec.BOOL.fieldOf("bonus_chest").orElse(false).stable().forGetter(GeneratorSettings::c), RegistryMaterials.b(IRegistry.LEVEL_STEM_REGISTRY, Lifecycle.stable(), WorldDimension.CODEC).xmap(WorldDimension::a, Function.identity()).fieldOf("dimensions").forGetter(GeneratorSettings::d), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((generatorsettings) -> {
             return generatorsettings.legacyCustomOptions;
         })).apply(instance, instance.stable(GeneratorSettings::new));
@@ -121,7 +126,7 @@
     public static RegistryMaterials<WorldDimension> a(RegistryMaterials<WorldDimension> registrymaterials, Supplier<DimensionManager> supplier, ChunkGenerator chunkgenerator) {
         RegistryMaterials<WorldDimension> registrymaterials1 = new RegistryMaterials<>(IRegistry.LEVEL_STEM_REGISTRY, Lifecycle.experimental());
 
-        registrymaterials1.a(WorldDimension.OVERWORLD, (Object) (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable());
+        registrymaterials1.a(WorldDimension.OVERWORLD, (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable()); // CraftBukkit - decompile error
         Iterator iterator = registrymaterials.d().iterator();
 
         while (iterator.hasNext()) {
@@ -129,7 +134,7 @@
             ResourceKey<WorldDimension> resourcekey = (ResourceKey) entry.getKey();
 
             if (resourcekey != WorldDimension.OVERWORLD) {
-                registrymaterials1.a(resourcekey, (Object) ((WorldDimension) entry.getValue()), registrymaterials.d((Object) ((WorldDimension) entry.getValue())));
+                registrymaterials1.a(resourcekey, ((WorldDimension) entry.getValue()), registrymaterials.d(((WorldDimension) entry.getValue()))); // CraftBukkit - decompile error
             }
         }
 
@@ -242,7 +247,7 @@
         switch (b0) {
             case 0:
                 JsonObject jsonobject = !s.isEmpty() ? ChatDeserializer.a(s) : new JsonObject();
-                Dynamic<JsonElement> dynamic = new Dynamic(JsonOps.INSTANCE, jsonobject);
+                Dynamic<JsonElement> dynamic = new Dynamic(RegistryReadOps.a(JsonOps.INSTANCE, IResourceManager.Empty.INSTANCE, (IRegistryCustom.Dimension) iregistrycustom), jsonobject); // CraftBukkit - SPIGOT-6237
                 DataResult dataresult = GeneratorSettingsFlat.CODEC.parse(dynamic);
                 Logger logger = GeneratorSettings.LOGGER;
 
@@ -278,7 +283,7 @@
                 Entry<ResourceKey<WorldDimension>, WorldDimension> entry = (Entry) iterator.next();
                 ResourceKey<WorldDimension> resourcekey = (ResourceKey) entry.getKey();
 
-                registrymaterials.a(resourcekey, (Object) (new WorldDimension(((WorldDimension) entry.getValue()).a(), ((WorldDimension) entry.getValue()).c().withSeed(j))), this.dimensions.d((Object) ((WorldDimension) entry.getValue())));
+                registrymaterials.a(resourcekey, (Object) (new WorldDimension(((WorldDimension) entry.getValue()).a(), ((WorldDimension) entry.getValue()).c().withSeed(j))), this.dimensions.d(((WorldDimension) entry.getValue()))); // CraftBukkit - decompile error
             }
         } else {
             registrymaterials = this.dimensions;
