mojira.dev
MC-205877

"generator-settings" in server.properties not applying to flat world

I know a lot of people have been having issues with "generator-settings" in server.properties not applying to flat worlds. I did a good amount of searching as was not able to find an answer.

I did come across issue #MC-182421 which stated it was fixed.
I used the settings from that issue that Bartosk posted:

{"biome":"minecraft:plains","layers":[{"block":"minecraft:diamond_block","height":1}],"structures":{"village":{}}}

I tested on 20w18a since that was the version that was claimed to work on.

It worked. But when I tested in both 1.16 and 1.16.4 neither worked. I even tested on the latest snapshot, 20w46a, and still a no go.

In the images, you will see the diamond block world worked in 20w18a, but the same value did not apply for any other version.

Linked issues

Attachments

Comments 6

Using 

{"structures"\:{"structures"\:{}},"layers"\:[{"block"\:"minecraft\:air", "height"\:1}],"biome"\: "minecraft\:plains","flat_world_options"\:{}}

in 1.16 works for generator-settings. In fact, I dont think "flat_world_options" is necessary either. 1.16.2 Pre-release 1 works correctly. 1.16.2 Pre-release 2 results in an IllegalStateException: Unregistered Biome and 1.16.2 Pre-release 3 is when a normal superflat is generated.

Still an issue in 1.16.5

net.minecraft.world.level.levelgen.WorldGenSettings#create does not use the correct DynamicOps when using generator-settings json.
Instead, it should use RegistryReadOps because of the FlatLevelGeneratorSettings codec is of the type RegistryLookupCodec. Currently, it uses JsonOps which is not recognizable by the RegistryLookupCodec.

This is still an issue in 1.18.2. WorldGenSettings now is instantiating the Dynamic used to parse generator-settings incorrectly. The dynamic needs to be backed by the registry, currently that is not the case.

There is an error message when trying to use generator settings: "Not a registry ops"
The json in server.properties:

{"layers"\:[{"block"\:"minecraft\:air","height"\:1}],"biome"\:"minecraft\:plains"}

For anyone seeking an answer, this formatting worked for me in 1.19. I created a superflat world on a home server (Curseforge) with the following:

generator-settings={"structures"\:{"structures"\:{}},"layers"\:[{"block"\:"minecraft\:dirt","height"\:50},{"block"\:"minecraft\:grass_block","height"\:1},{"block"\:"minecraft\:air","height"\:1}>

 

ShaneBee

(Unassigned)

Confirmed

Dedicated Server

1.16.4, 1.16.5, 21w13a, 1.17.1, 1.18.2

Retrieved