ProtocolLib

3M Downloads

Trying to recreate WrapperPlayServerAdvancements on 1.20

DoubleNico opened this issue ยท 3 comments

commented

I am trying to recreate the WrapperPlayServerAdvancements for 1.20 minecraft version, I am stuck because the SerializedAdvancement(net.minecraft.advancements.Advancement$SerializedAdvancement) has changed drastically and I don't know how to recreate it, I am trying to get the Advancement and modify the title and description of the advancement, here is what I am doing:

My wrapper class: https://pastes.dev/8zWTC0HpHv
My abstract packet class: https://pastes.dev/zMJcQUDkop

I am using PacketType.Play.Server.ADVANCEMENTS(PacketPlayOutAdvancements), so when an advancement is made it shows, and I wanna get the Advancement and modify it using #getAdvancements method, but the method is returning some errors, I am using #plm method to check what getAdvancements is printing and it's an empty optional and it throws that error there, the error surely appears because the SerializedAdvancement is not created good

My issue: I can't recreate the AutoWrapper for net.minecraft.advancements.Advancement$SerializedAdvancement because it's really confusing because it has a lot of custom classes and most of them are interfaces
Protocol Dump: https://pastes.dev/sWLkjorqhr

Thanks for reading! Any information are helpful !

commented

Good day! Can you tell me how you solved your problem?

commented

Good day! Can you tell me how you solved your problem?

Sorry for late response but I still did not fix that issue, it's hard

commented

I already solved the problem, I just added advancements. to classes. AdvancementDisplay -> advancement.AdvancementDisplay.

source: https://github.com/dmulloy2/PacketWrapper/blob/master/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerAdvancements.java