Pepperoni-Jabroni / MapAtlases

A vanilla-friendly mini-map & world-map mod using vanilla Maps!
GNU General Public License v3.0
24 stars 14 forks source link

Update to 1.20.6 #162

Open TechPro424 opened 5 months ago

TechPro424 commented 5 months ago

IMPORTANT: Do not merge this PR yet, one error is still to be fixed

This PR updates the mod to 1.20.6

Breaking changes in Minecraft include:

Check https://fabricmc.net/2024/04/19/1205.html for the full rundown of all the changes

The first change made it so that I had to rewrite all the packets from scratch and adapt the lifecycle event classes, among other things. The second change made modifying NBT a longer process, and maps now have a MapIdComponent that has the map's ID

There is still one error that is yet to be fixed

In line 767 of the MapAtlasesAtlasOverviewScreen class, we are trying to get a byte b using mapIcon.getTypeId();

However, due to the 3rd change, that method no longer exists, and the type is stored as a MapDecorationType, which does not have a byte value associated with it. This byte value is used in further calculations, which now have to be reworked, most probably. However, I have no clue on how to proceed with that 😅 .

TechPro424 commented 5 months ago

I looked though the 1.20.4 code just now, and found that the types are an enum, and the byte value associated with each type is just its ordinal/index in the enum. We could create a manual map of each type to a byte, and use that temporarily, if you agree with the idea.

TechPro424 commented 5 months ago

Added an enum, but the enum does not contain values for all the types, yet, will get to it later

Pepperoni-Jabroni commented 5 months ago

Thanks for creating this PR! Gotta love when minor versions have multiple major backend breaking changes. Let me know when you feel it's ready to be merged.

TechPro424 commented 5 months ago

Completed the enum, troubleshooting runtime errors

TechPro424 commented 5 months ago

Fixed quite a few runtime errors, but there is one case where I go into a brand new world, use the give command to give myself an atlas, and the game crashes while calling the getMapIntFromString() method because there is an id with a value of Map involved somehow.

I'm unable to find where this map id is coming from and why, and I need some help identifying that

Pepperoni-Jabroni commented 5 months ago

Interesting... I'll see if I can repro soon, thanks for the details. And thanks for putting in all the work thus far to get it to 1.20.6!

TechPro424 commented 5 months ago

You're welcome! Feel free to let me know if I can help again :)

vico93 commented 3 months ago

Any news about this PR?

TechPro424 commented 3 months ago

Interesting... I'll see if I can repro soon, thanks for the details. And thanks for putting in all the work thus far to get it to 1.20.6!

Still here I myself no longer have time to work on modding related projects, and it may be the same for Nick too.