World Map breaks in 1.18
Describe the bug biome() changed in 1.18 - depth, scale, top_material and under_material are gone, exceptions will be thrown.
biome sampling needs to be done higher up because at y=0 you get can get cave biomes.
To Reproduce Load world_map in a 1.18.1 save, eat a berry.
Environment
- Carpet version: 1.4.56
- Minecraft version: 1.18.1
Additional context
https://github.com/random-j-farmer/scarpet/blob/master/programs/survival/world_map.sc works for me in 1.18.1, but I assume I broke it for earlier Minecraft versions.
I don't really know enough about minecraft to make a clean fix.
Setting the biome on the world map is also broken, I suspect setting it a y=0 does not work anymore in the overworld.
Awsome that you fixed it for the newer versions!
Since 1.18, biome_set is supposed to work at every y level in the OW, so you'd need to change it. The function responsible for dooing that seems to be this one, so add overworld to that with the appropiate y level.
Regarding biome "querying" of the workd, I think best option is to use the top function to get the biome at the surfase in the overworld (not sure if the app already does that, didn't check that thoroughly). I don't think cave biomes should be taken into account here.
Once that's done, the app should work as it did before 1.18. To make it compatible with older versions too, I'd sugges that, if you want to, you add a check system_info('game_major_target') <18 and have all your changes only apply when that doesn't hold. Mind you, only the changes that are not backwards compatible. For example, adding new biome names to the global map you can do regardless of the version, they just won't be used if they are not present in the version.
If you are willing to do this, I'd much appreciate it! Just make a PR and I'll test and review it :3
I did try to use top() to get the y coordinate of the sampled blocks, but I had to kill the minecraft process after waiting a minute or two. I think biome() does not need to load the chunks being mapped, but top() does. Right now it's hard coded to 255 for the overworld, but of course it ccould be made conditional on the version.
As for setting the biome, I have a hunch I have to call it with the y level of the map; I think I did that by accident at one point (I was trying to set the y coord of the sampled block).
I will try to clean it up over the weekend, but no promises.
Don't worry, no need to hurry!
-Querrying at y255 seems like a decent idea, works across all versions -Setting biome as the y levle of the map is what I meant, yes. The function I linked is the one that handles doing that.