From d73521e0a023b872e54915592b83fd23798ff56f Mon Sep 17 00:00:00 2001 From: bm01 Date: Mon, 25 Jun 2012 15:05:20 +0200 Subject: [PATCH] Fixed admin chat being seen by everyone --- Changelog.txt | 1 + .../java/com/gmail/nossr50/listeners/PlayerListener.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index b3ab86bf1..71990f14b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,6 +8,7 @@ Key: - Removal Version 1.3.10-dev + = Fixed admin chat being seen by everyone = Fixed players never being removed from memory (memory leak) Version 1.3.09 diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index d3b235e17..1bb5da2c7 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -360,9 +360,9 @@ public class PlayerListener implements Listener { plugin.getLogger().info("[A]<" + playerName + "> " + chatEvent.getMessage()); - for (Player p : plugin.getServer().getOnlinePlayers()) { - if (Permissions.getInstance().adminChat(player) || player.isOp()) { - p.sendMessage(prefix + chatEvent.getMessage()); + for (Player otherPlayer : plugin.getServer().getOnlinePlayers()) { + if (Permissions.getInstance().adminChat(otherPlayer) || otherPlayer.isOp()) { + otherPlayer.sendMessage(prefix + chatEvent.getMessage()); } }