-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix field length for command packets #3715
Conversation
Change looks good. 256 might be a left over? |
please take a look into all minecraft versions the protocol wiki is not guaranteed to be right For the ClientCommand packet take a look into the networking for all versions that packet is registered for |
Thanks for looking. It looks like it was increased with PVN 766, ie 1.20.5/1.20.6 -- how should I go about handling the difference between versions? |
Use the protocolVersion argument, check the version, and use the matching value Like this: readString( buf, protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ? 32767 : 256 ); |
Should be good now! Thanks for the tip @Outfluencer |
Should probably be a ternary like the example Outfluencer gave in his comment |
@md-5 Sounds good -- was trying to match the existing style but if ternary is preferred can do that |
Updates the field length for
ClientCommand
andUnsingedClientCommand
packets.Resolves
OverflowPacketException
being thrown, I imagine this is only encountered with usage of therun_command
chat click event, as players can't send a command this length in the chat bar.https://wiki.vg/Protocol#Chat_Command