andrepl / ChatLib

A simple library for constructing and sending raw chat packets for CraftBukkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashes with % sign

mastergberry opened this issue · comments

As explained by evilmidget in #bukkitdev IRC, if a % is followed by a space it breaks the formatter, and screws up the TranslatableComponent that is sent to the client. Resulting in a client crash.

https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/ChatMessage.java#L64

This function in NMS is important and handles this edge case, and is not properly being called by this chat library at the moment. Naming a sword to "% ____" (needs to be a space after the %) will crash the client when they display a message using this chat library.

I'm too out of it at the moment to find in Craftbukkit where they are properly executing this stuff, they do some stuff in util.CraftChatMessage...but this library does not operate the same way Craftbukkit's does.

Thanks for the report, I'll look into this tonight.