Skip to content

Comments

fix: initialization error for WrappedChatComponent on 1.20.4-1.21.5#3493

Merged
dmulloy2 merged 1 commit intodmulloy2:masterfrom
diogotcorreia:fix/wrappedchatcomponent-older-versions
Jun 27, 2025
Merged

fix: initialization error for WrappedChatComponent on 1.20.4-1.21.5#3493
dmulloy2 merged 1 commit intodmulloy2:masterfrom
diogotcorreia:fix/wrappedchatcomponent-older-versions

Conversation

@diogotcorreia
Copy link
Contributor

The ComponentSerialization class also exists on these versions, so the MinecraftReflection#getChatSerializerClass method would return a class that does not contain the expected methods, hence failing initialization.
This commit changes the lookup order, so that the subclasses are searched before the ComponentSerialization class.

Closes #3478
Closes #3482
Closes #3488

The ComponentSerialization class also exists on these versions, so the
MinecraftReflection#getChatSerializerClass method would return a class
that does not contain the expected methods, hence failing
initialization.
This commit changes the lookup order, so that the subclasses are
searched before the ComponentSerialization class.

Closes dmulloy2#3478
Closes dmulloy2#3482
Closes dmulloy2#3488
@diogotcorreia
Copy link
Contributor Author

I'm not sure if this is the preferred way to fix it. I think a better option would be to treat these as two different classes and add a new method to MinecraftReflection. Let me know your preferences.

@dmulloy2 dmulloy2 self-requested a review June 27, 2025 15:16
@dmulloy2 dmulloy2 merged commit 67e7375 into dmulloy2:master Jun 27, 2025
3 checks passed
@diogotcorreia diogotcorreia deleted the fix/wrappedchatcomponent-older-versions branch June 27, 2025 15:17
@dmulloy2
Copy link
Owner

makes sense to me. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants