GeyserMC / MCProtocolLib

A library for communication with a Minecraft client/server.
MIT License
724 stars 200 forks source link

Use translatable components like vanilla and cleanup type casts #831

Closed AlexProgrammerDE closed 2 months ago

AlexProgrammerDE commented 3 months ago

Just a few messages becoming dynamic using translatable components like vanilla instead of being hardcoded.

AlexProgrammerDE commented 3 months ago

This also removes the option not to specify a reason component or specifying a String as a reason. The reason for this change is to enforce providing a clear reason to the client. Developers who want to provide a String reason need to wrap it using Component.text(). Developers who want to provide no disconnect reason can just provide an empty reason like Component.text("Connection closed."). This should really not be done and a proper reason component should be provided when working on a client or server.