FeuSalamander / Vmessage

the repository of my Velocity Plugin "Vmessage"
https://forums.papermc.io/threads/v-message-simple-global-chatting-w-luckperms-support.527/
18 stars 3 forks source link

Improved Plugin Logic #3

Closed 4drian3d closed 1 year ago

4drian3d commented 1 year ago
FeuSalamander commented 1 year ago

if I understood correctly(correct me if it's not good), to add the hex colors support I just need to add a variable like this: private static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder() .character('&') .hexColors() .build(); and after to set the color to the string I need to do this: SERIALIZER.deserialize(string)

4drian3d commented 1 year ago

if I understood correctly(correct me if it's not good), to add the hex colors support I just need to add a variable like this: private static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder() .character('&') .hexColors() .build(); and after to set the color to the string I need to do this: SERIALIZER.deserialize(string)

The LegacyComponentSerializer converts a string to components applying the colors correctly simulating how Minecraft used to apply the colors (currently it is deprecated to use the "§" symbol and in any update Mojang may remove it)