Closed EthMC closed 1 year ago
Just set 35 here instead of 31 in prismarine-nbt/compiler-zigzag.js
Can confirm with your buffer, seems like issue in packet_item_component
decoding
OK, after looking into it, the issue seems to be NBT-related. One of the NBT tags' 32-bit varints is too big causing an integer overflow
{"type":"compound","name":"","value":{"name":{"type":"string","value":"cubecraft:dragon_bow"},"id":{"type":"int","value":25102},"components":{"type":"compound","value":{"item_properties":{"type":"compound","value":{"stacked_by_data":{"type":"byte","value":0},"hand_equipped":{"type":"byte","value":1},"frame_count":{"type":"int","value":3},"minecraft:icon":{"type":"compound","value":{"texture":{"type":"string","value":"cubecraft:dragon_bow"}}},"use_animation":{"type":"int","value":4},"animates_in_toolbar":{"type":"byte","value":1},"max_stack_size":{"type":"int","value":1},"use_duration":{"type":"int","value":["OVER",-2147483648]}}},"minecraft:shooter":{"type":"compound","value":{"charge_on_draw":{"type":"byte","value":0},"max_draw_duration":{"type":"float","value":1},"launch_power_scale":{"type":"float","value":1},"max_launch_power":{"type":"float","value":1}}},"minecraft:durability":{"type":"compound","value":{"max_durability":{"type":"int","value":384}}}}}}}
The server is not encoding the value correctly
I guess one fix would be to allow overflows up to the 64-bit limit, then throwing. The server is still wrong, and re-encoding will fail because of data-loss, but it may not be necessary to throw an exception there if the data can otherwise be read ok
When using a relay on CubeCraft I get kicked while joining and I get this error in my console.
I've attached code as well as the packet read error below.
1690075685189_packetReadError.txt