Instead of calculating the format a user uses every time a player send a message in chat, we should calculate it on player join and on plugin reload. This would allow other plugins and addons to change the formats of players without us overwriting them. To also make sure we override the format on reload, we should add a ReloadEvent that is called when the plugin is reloaded. This event should not be Cancellable.
|
@NotNull Format format(); |
|
|
|
void format(@NotNull final Format format); |
|
FormatUtils.findFormat(user.player(), plugin.configManager().formats()), |
Instead of calculating the format a user uses every time a player send a message in chat, we should calculate it on player join and on plugin reload. This would allow other plugins and addons to change the formats of players without us overwriting them. To also make sure we override the format on reload, we should add a ReloadEvent that is called when the plugin is reloaded. This event should not be Cancellable.
ChatChat/api/src/main/java/at/helpch/chatchat/api/User.java
Lines 15 to 17 in 4941d60
ChatChat/plugin/src/main/java/at/helpch/chatchat/util/MessageProcessor.java
Line 73 in 4941d60