Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level heights should have a lower bound of 1 #64

Open
haykam821 opened this issue Nov 12, 2023 · 0 comments
Open

Level heights should have a lower bound of 1 #64

haykam821 opened this issue Nov 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@haykam821
Copy link
Contributor

haykam821 commented Nov 12, 2023

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),

@haykam821 haykam821 added the bug Something isn't working label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant