Open TechPro424 opened 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.
Added an enum, but the enum does not contain values for all the types, yet, will get to it later
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.
Completed the enum, troubleshooting runtime errors
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
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!
You're welcome! Feel free to let me know if I can help again :)
Any news about this PR?
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.
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:
PacketByteBuf
, packets are now serialized usingPacketCodecs
. In Fabric Networking API, the previousPacketByteBuf
-based APIs were removed; the newer,FabricPacket
-based API was rewritten to make use of the vanillaCustomPayload
interface.MapIcon
has been renamed toMapDecoration
and has been heavily refactoredCheck 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 IDThere is still one error that is yet to be fixed
In line 767 of the
MapAtlasesAtlasOverviewScreen
class, we are trying to get abyte b
usingmapIcon.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 😅 .