Badel2 / slime_seed_finder

https://badel2.github.io/slime_seed_finder
GNU General Public License v3.0
49 stars 4 forks source link

Minecraft 1.15 support #10

Open Badel2 opened 4 years ago

Badel2 commented 4 years ago

Some tools in this repo currently don't support Minecraft Java 1.15. This is because the 1.15 version changes the way biomes are stored:

1.14: biomes are stored inside the chunk as a 2D array with 16x16 elements, one per each block (full resolution biome map). 1.15: biomes are stored inside the chunk as a 3D array with 4x4x64 elements, one per each 4x4x4 volume, and the value of each individual block (full resolution biome map) is calculated at runtime.

Since the full resolution biome map is calculated at runtime, the server sends the 4x4x64 biome map and the client calculates the full resolution 16x16x256. This is new to 1.15, so the biome borders slightly changed. This step depends on the world seed, but the server obviously doesn't send the world seed. It sends the hash of the world seed. Surprisingly, it's a cryptographically secure hash function (SHA256 truncated to 64 bits), so the only possible attack is bruteforce. But that's good enough: if we assume the 26-bit bruteforce step from biomes was successful, we only need (64 - 26 =) 38 bits more. A 38-bit bruteforce at 10 million hashes per second (an estimate for a modern CPU) takes about 7 hours. GPUs can be 10 times faster than that, so less than 1 hour. But by adding a few structures or slime chunks we can get the lower 48 bits of the seed, and then it's only a (64 - 48 =) 16 bit bruteforce, which is instant. The biggest problem with this method is how to get the hash of the world seed: you would need to install a mod.

The logic to calculate the full resolution given the seed hash is implemented as MapVoronoiZoom115. But we would need to:

And optionally:

The important difference is that 1.14 stores the biome value after the last MapVoronoiZoom, while 1.15 stores the biome before MapVoronoiZoom, and applies that layer later on. This is both good and bad for this project: it's good because in 1.15 we don't need to reverse the voronoi zoom, and therefore the 26-bit bruteforce should be more robust. And it's also good because of the new attack vector of bruteforcing the hash. But it's bad because we have no easy way to get the full-resolution biome map, which is needed for the 34-bit bruteforce. And it's also bad because now we need to distinguish between 1.14 biomes and 1.15 biomes, as they only are equal before the MapVoronoiZoom step. And most importantly, it's bad because the next update may change the biome generation code, making this project outdated.

So I think the priorities should be: