- 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) {
|
public PlayerChat(AnuraCore plugin) {
|
||||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
||||||
try {
|
try {
|
||||||
if (event.isAsynchronous()) {
|
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) {
|
} catch(IllegalFormatException | NullPointerException e) {
|
||||||
Errors.reportException(e);
|
Errors.reportException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private final AnuraCore plugin;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user