--- a/net/minecraft/world/level/levelgen/presets/WorldPresets.java
+++ b/net/minecraft/world/level/levelgen/presets/WorldPresets.java
@@ -49,11 +49,7 @@
 
     public static Optional<ResourceKey<WorldPreset>> fromSettings(WorldDimensions p_326314_) {
         return p_326314_.get(LevelStem.OVERWORLD).flatMap(p_344665_ -> {
-            Object object;
-            Objects.requireNonNull(object);
-            ChunkGenerator chunkgenerator = (ChunkGenerator)object;
-
-            p_344665_.generator();
+            ChunkGenerator chunkgenerator = p_344665_.generator();
             return switch (chunkgenerator) {
                 case FlatLevelSource flatlevelsource -> Optional.of(FLAT);
                 case DebugLevelSource debuglevelsource -> Optional.of(DEBUG);
