mojira.dev
MC-212347

Importing custom world file height is limited to 2047 instead of 2048

The bug

The minecraft world setting's file has a limit that min_y + height has to be lower than 2047 (min_y + height < 2047).

Note: the explanation takes min_y as 0. Height has to be a multiple of 16

This makes generating a world with height 2048 with as highest y value 2047 (likewise height 256, has as highest y value 255) impossible, because 0 + 2048 > 2047. 

[media]

Old explanation: blocks start generating at y = 0, y = 0 contains a block. Counting from(and including) y = 0 till y = 2047 is 2048 blocks. In a normal minecraft world with a 256 world height, 255 is your highest block, included with the block at y = 0 your world height is 256 again.

In the world settings the world height is 256 by default, it includes 0. So, the height in the custom world height settings should be 2048 instead of 2047, since 2048 includes 0 and 2047 doesn't.

Supposed fix:
min_y + height ≤ 2048; min_y + cannot be higher than: 2048;

 

The bug after the fix

 

This has not been fully fixed!

This has only been fixed for the the json "height" in "type"

[media]

and not for "height" in "noise", which is now off by 1 again, just like the original issue, this should be changed to 2032(or 2048 but see opinions on the fix for this), this is broken right now.

[media]

 

Opinions on the fix

The currently given fix limits min_y to 2032, and height to 4064(not counting the currently still 1 off in the height from "noise"), is there any specific reason the height isn't max 4096, with min_y -2048?

Panda has replied to this in the comments.

Linked issues

Attachments

Comments 9

Please include a data pack for testing this

Added a worldgen settings file, you can add it when generating a world by clicking
More World Options > Import Settings

Is indeed "fixed" for "type", max became 2032 for both positive and negative.

This has not been fully fixed! This has only been fixed for the "type" and not for "noise", even worse, now it's (noise) min_y + height < 2031 which should be min_y + height ≤ 2032.

 

[media]

I also don't understand why the number was just dropped down by 16 instead of fixing that off by 1; it seems like a needless removal of possibility.

Yes, I also think they need to solve the problem for real, not just simply change its definition.

Hello, the reason why +/-2032 is the limits is that these are the maximum values currently supported.
Parts of Minecraft pack block positions into an 32bit integer, using 12 bits for the y-coordinate. This is the cause for the current limit of minY and maxY.
The reason the limits are 2032 rather than 2048 is that there is an additional light section below and above the world, as light can shine out and back into the bottom/top section.
Having a maxY higher than 2032 would cause light changes with values higher than 2048, which would cause light updates to stop working correctly.

Hi @unknown, thanks for making that clear, I've edited the issue a bit(before seeing your message), is it clear to you there still is an issue in your fix? As said in the edited issue, the "noise" min_y + height has a limit of 2031, which is 1 off, if I'm correct this 2031 should be 2032 just like the other "type" min_y + height. 

Yes, thank you for pointing that out!

BBLZ

Panda4994

Confirmed

Important

Custom Worlds

21w03a

21w05a

Retrieved