- Fix some chat issues
- Remove plugin field
This commit is contained in:
@@ -12,18 +12,16 @@ public class PlayerChat implements Listener {
|
||||
|
||||
public PlayerChat(AnuraCore plugin) {
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
||||
try {
|
||||
if (event.isAsynchronous()) {
|
||||
event.setFormat(event.getPlayer().getDisplayName() + ChatColor.GRAY + ":" + ChatColor.WHITE + " " + event.getMessage());
|
||||
event.setFormat("%s" + ChatColor.GRAY + ":" + ChatColor.WHITE + " %s");
|
||||
}
|
||||
} catch(IllegalFormatException | NullPointerException e) {
|
||||
Errors.reportException(e);
|
||||
}
|
||||
}
|
||||
private final AnuraCore plugin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user