Skip to content

Level heights should have a lower bound of 1 #64

@haykam821

Description

@haykam821

If a negative level height is provided, the server crashes:

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 16
	at net.minecraft.class_2791.method_38259(class_2791.java:162)
	at xyz.nucleoid.plasmid.game.world.generator.TemplateChunkGenerator.lambda$populateNoise$0(TemplateChunkGenerator.java:74)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at net.minecraft.class_3900.method_17634(class_3900.java:62)

If a level height of zero is provided, an unplayable map with a single layer covered by a barrier ceiling and no lava is generated:

image

The codec for the level height of the map should be restricted to a minimum of 1 to prevent these issues from occurring:

Codec.INT.fieldOf("level_height").forGetter(SpleefGeneratedMapConfig::levelHeight),

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions