Field with type byte in PacketPlayOutChat
AlonsoAliaga opened this issue ยท 3 comments
Describe the bug
Everything seems fine, but trying to send action bar as in other versions throws error.
To Reproduce
Steps to reproduce the behavior:
- Use code:
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager(); PacketContainer chatPacket = protocolManager.createPacket(PacketType.Play.Server.CHAT); chatPacket.getChatComponents().write(0, WrappedChatComponent.fromText(message)); chatPacket.getBytes().write(0, (byte) 2); try { protocolManager.sendServerPacket(player, chatPacket); } catch (InvocationTargetException e) {}
- Run it
- Error in console:
Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type byte exists in class PacketPlayOutChat. at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:363) ~[?:?] at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:343) ~[?:?]
Expected behavior
Send actionbar. But its saying that it doesnt exists byte type in PacketPlayOutChat, i've used it before.
Screenshots
None
Version Info
https://hastebin.com/ofuhufazek
Additional context
Nothing
Oh, its working now. That means i need to use that from now on? I mean for 1.8 - 1.15 using ProtocolLib 4.5.0? (latest) or i still need to use byte when using 1.8?