MC@h Matt
- atleast3chars
- JIRAUSER619541
- Europe/Stockholm
- Yes
- No
Added Attachments:
Removed Attachments:
Changed Description:
A few members of our community have been studying the latest snapshot code and they claim to have found an issue in the class LegacyRandomSource.
Java documentation specifies that Next(bits) should return (int)(seed >>> (48 - bits)). However, current code seems to return (int)(seed >> (48 - bits)).
This could cause future issues related to nextInt returning negative numbers in rare cases, and incomplete parity with Bedrock.Members that confirmed this issue in our community: cortex and MrSpike.


I'm also from the MC@H community. Basically, it seems like your world's seed was changed during playthrough - possibly a corruption caused by an unexpected shutdown or crash while it was saving the data? -.
If you want your original seed back instead of seed 0, please provide the region files for your save and we'll try recovering it for you. The process itself shouldn't take more than a few minutes if you still have the save files.
I have confirmation that the image "2021-02-27_22.44.59.png" has been generated using seed 0 (left side, beach) and another seed (right side), possibly the original. Coords are 73 69 78 for the player.
See image
This bug has been in the game since its origins. It's caused by chunk loading order - if you load a chunk with a mountain in it and then load a chunk that's supposed to spawn a tree touching that mountain, it won't spawn. If you generate the tree chunk before the mountain chunk, though, it'll appear in-game.
For reference, https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#next-int- specifies >>> (logical shift operation) usage.
I also noticed this problem a while ago when researching MC 1.13 code. All features attempt to generate in all chunks, the most funny being Nether Fortress trying to generate in the Overworld. Trying to find the screenshot I had of the code running, but that might take a while.
This issue isn't relevant anymore, as LegacyRandomSource is not being used in any important place of the game anymore, except for stronghold layouts, which can't be affected by that problem. (Mojang switched to XoroShiro128++ for features in pre-release 1)