mojira.dev
MC-195468

World Generation Settings not working on dedicated server

Hi! I used Export World Generation Setting button to obtain generation settings JSON file, and then I was trying to use it in server.properties.
It does not work at all on the server - settings are not importing at all, even tho it fully works when creating a singleplayer world.

The worldgen_settings_export.json file:

{
  "bonus_chest": false,
  "dimensions": {
    "minecraft:overworld": {
      "type": "minecraft:overworld",
      "generator": {
        "settings": {
          "lakes": false,
          "features": true,
          "biome": "minecraft:the_void",
          "structures": {
            "structures": {}
          },
          "layers": [
            {
              "height": 1,
              "block": "minecraft:air"
            }
          ]
        },
        "type": "minecraft:flat"
      }
    },
    "minecraft:the_nether": {
      "type": "minecraft:the_nether",
      "generator": {
        "settings": {
          "lakes": false,
          "features": true,
          "biome": "minecraft:the_void",
          "structures": {
            "structures": {}
          },
          "layers": [
            {
              "height": 1,
              "block": "minecraft:air"
            }
          ]
        },
        "type": "minecraft:flat"
      }
    },
    "minecraft:the_end": {
      "type": "minecraft:the_end",
      "generator": {
        "settings": {
          "lakes": false,
          "features": true,
          "biome": "minecraft:the_void",
          "structures": {
            "structures": {}
          },
          "layers": [
            {
              "height": 1,
              "block": "minecraft:air"
            }
          ]
        },
        "type": "minecraft:flat"
      }
    }
  },
  "seed": 6225140477871570822,
  "generate_features": true
}

Some "server.properties" lines:

generator-settings={"bonus_chest": false,"dimensions": {"minecraft:overworld": {"type": "minecraft:overworld","generator": {"settings": {"lakes": false,"features": true,"biome": "minecraft:the_void","structures": {"structures": {}},"layers": [{"height": 1,"block": "minecraft:air"}]},"type": "minecraft:flat"}},"minecraft:the_nether": {"type": "minecraft:the_nether","generator": {"settings": {"lakes": false,"features": true,"biome": "minecraft:the_void","structures": {"structures": {}},"layers": [{"height": 1,"block": "minecraft:air"}]},"type": "minecraft:flat"}}},"seed": 6225140477871570822,"generate_features": true}
level-type=flat

Full server log from MC-199659:

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true 
[21:15:24] [main/ERROR]: Not a registry ops 
[21:15:24] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api
.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD' 
[21:15:24] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with
 inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] 
[21:15:24] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] wit
h inputs: [0.1 -0.5 .9, 0 0 0] 
[21:15:24] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with in
puts: [0.1 -0.5 .9, 0 0 0] 
[21:15:24] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with
 inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] 
[21:15:24] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets
, destination] with inputs: [0.1 -0.5 .9, 0 0 0] 
[21:15:24] [main/INFO]: Reloading ResourceManager: Default 
[21:15:25] [Worker-Main-10/INFO]: Loaded 7 recipes 
[21:15:25] [Worker-Main-10/INFO]: Loaded 927 advancements 
[21:15:26] [Server thread/INFO]: Starting minecraft server version 1.16.2 
[21:15:26] [Server thread/INFO]: Loading properties 
[21:15:26] [Server thread/INFO]: Default game type: SURVIVAL 
[21:15:26] [Server thread/INFO]: Generating keypair 
[21:15:26] [Server thread/INFO]: Starting Minecraft server on *:25565 
[21:15:26] [Server thread/INFO]: Using epoll channel type 
[21:15:26] [Server thread/INFO]: Preparing level "world" 
[21:15:26] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld 
[21:15:27] [Server thread/INFO]: Preparing spawn area: 0% 
[21:15:27] [Server thread/INFO]: Preparing spawn area: 0% 
[21:15:27] [Server thread/INFO]: Preparing spawn area: 0% 
[21:15:28] [Server thread/INFO]: Preparing spawn area: 39% 
[21:15:29] [Worker-Main-12/INFO]: Preparing spawn area: 83% 
[21:15:29] [Worker-Main-10/INFO]: Preparing spawn area: 83% 
[21:15:29] [Worker-Main-12/INFO]: Preparing spawn area: 83% 
[21:15:29] [Worker-Main-11/INFO]: Preparing spawn area: 83% 
[21:15:30] [Worker-Main-9/INFO]: Preparing spawn area: 83% 
[21:15:30] [Worker-Main-9/INFO]: Preparing spawn area: 83% 
[21:15:31] [Worker-Main-8/INFO]: Preparing spawn area: 83% 
[21:15:31] [Worker-Main-14/INFO]: Preparing spawn area: 87% 
[21:15:32] [Worker-Main-14/INFO]: Preparing spawn area: 91% 
[21:15:32] [Server thread/INFO]: Preparing spawn area: 98% 
[21:15:33] [Server thread/INFO]: Time elapsed: 6638 ms 
[21:15:33] [Server thread/INFO]: Done (6.690s)! For help, type "help"

Linked issues

Comments 5

Still present in 1.16.2. It seems in net/minecraft/server/Main, when WorldData is null, it goes into an if statement where it creates a new WorldGenSettings but this one does not read from datapacks and so, never loads in custom json worldgen stuff. It only gets set with the worldgen registries that had the vanilla biomes and dimensions hardcoded and all.

From my testing and debugging, it appears that the issue isn't that the JSON data is never used, but that the Codecs used to parse it fail. The Dynamic<JsonElement> that is created from the inputed JSON uses the JsonOps.INSTANCE DynamicOps. This Dynamic is then passed to FlatLevelGeneratorSettings.CODEC to decode, which results in the use of a RegistryLookupCodec on the biome registry. This is a problem as the RegistryLookupCodec has a check that reqiures the DynamicOps that is passed to be a RegistryReadOps when decoding, and otherwise triggers an error that causes the reading of the generator-settings to fail and fallback to the default settings for the flat world, and prints the error message: Not a registry ops.

A bugfix example is in [Fabric Mod API|https://hub.fastgit.org/FabricMC/fabric/blob/1.17/fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/mixin/dimension/ServerBugfixMixin.java].

Written in Mixin, with Fabric Yarn mappings (instead of Mojang). Could use Fabric's tiny remapper to handle the mapping issue.

Can confirm this is still an issue in 1.16.5

This was partially or entirely fixed. Please file a new report if there is a persisting issue.

BeetMacol

(Unassigned)

Community Consensus

Important

World generation

1.16.1, 1.16.2, 1.16.3, 20w46a

22w13a

Retrieved