Replies: 2 comments 6 replies
-
IDK what version you are looking at, but 1.21 uses a StreamCodec to write the Component into the FriendlyByteBuf. Not to mention that this is obviously internals. |
Beta Was this translation helpful? Give feedback.
-
The string tag only works for simple text, i.e. no formatting, etc, otherwise, it's an NBT compound tag, which needs to be encoded anyway, using the same codec system. There is 0 gain for supporting NBT here, and we generally do not change the internals to support plugins unless there is a good, strong-standing reason to do so. Messing with packet classes for plugins is generally a no-go for long-term maintenance reasons. |
Beta Was this translation helpful? Give feedback.
-
Currently the constructor for ClientboundSystemChatPacket takes in a Component or a BaseComponent and performs expensive calculations.
At the end of the day, the system chat message is sent as a String.
I am proposing one extra constructor with plain String to allow developers sending json messages without performance hits.
I am writing my own component parser and currently it has to be converted into JSON String, then CraftChatMessage.fromJSON, then back to String, wasting performance.
Beta Was this translation helpful? Give feedback.
All reactions