Some blocks generate at wrong Y height in a superflat world
The bug
minecraft:grass, minecraft:flower_pot, carpets, snow and possibly more blocks generate on the wrong y level if min_y is below 0. (y of wrong level blocks = amount of layers) Basically forgets there are negative y levels.
How to reproduce
- Go to the flat world preset menu
- Fill in minecraft:bedrock,2*minecraft:dirt,minecraft:grass_block,minecraft:grass (you can replace grass with flower_pot or white_carpet for the same effect)
- Generate the world
The grass generated at y = 4
Code analysis
Using the official 21w08b mojmaps:
net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings public int getMinBuildHeight() { return 0; } public int getHeight() { return 256; }
These are hardcoded to the old limit, multiple things are calculated with that number, including the level height of the blocks like carpets, grass and snow etc(blocks that depend on blocks below it, flower_pot is a weird exception). Best solution is unhardcoding these.
2021-03-05, 05:42 PM
2021-03-22, 06:58 AM
2021-03-17, 10:11 AM
3
3