Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an NBT converter for components on Velocity #237

Conversation

FluxCapacitor2
Copy link
Contributor

This is a workaround to allow Prototolize to send NBT components until KyoriPowered/adventure#995 is resolved.

Using Velocity's ComponentHolder, I convert the component to an Adventure NBT tag (see adventure-nbt), then convert the Adventure NBT tag to a Querz NBT tag using a custom mapper class.

Basic testing with item names, lores, and inventory titles (using Protocolize's OpenWindow and WindowItems packets) works fine on 1.20.4.

I have not tested on lower versions or old versions of Velocity that don't support 1.20.3 and therefore don't have a ComponentHolder class. Let me know if there is a better way to get the protocol version than hard-coding ProtocolVersion.MINECRAFT_1_20_3.

@Exceptionflug
Copy link
Owner

It's sufficient for now. Thank you for your contribution. The Adventure to Querz NBT mapper would have been necessary anyway so thank you also for including that.

@Exceptionflug Exceptionflug merged commit e6af024 into Exceptionflug:master Mar 18, 2024
FluxCapacitor2 added a commit to BlueDragonMC/Jukebox that referenced this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants