- Fix some chat issues

- Remove plugin field
This commit is contained in:
kaenganxt
2014-12-24 20:44:52 +01:00
parent adc2a1dde2
commit f83313827b

View File

@@ -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;
} }