diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-08-15 01:53:22 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-08-15 01:53:22 +0100 |
commit | ffae86dd42f424a0c14c17bcb65db287923852c1 (patch) | |
tree | 95911a2895afe1b1cbd2050004c5357184691ca5 | |
parent | ff41588c3ba6d36309f81cb955d1930b22ff1081 (diff) | |
download | Essentials-ffae86dd42f424a0c14c17bcb65db287923852c1.tar Essentials-ffae86dd42f424a0c14c17bcb65db287923852c1.tar.gz Essentials-ffae86dd42f424a0c14c17bcb65db287923852c1.tar.lz Essentials-ffae86dd42f424a0c14c17bcb65db287923852c1.tar.xz Essentials-ffae86dd42f424a0c14c17bcb65db287923852c1.zip |
Use user object to send messages when possible.
5 files changed, 9 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 8e790009d..437aac85b 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -303,7 +303,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials if (user.isVanished()) { user.setVanished(false); - p.sendMessage(_("unvanishedReload")); + user.sendMessage(_("unvanishedReload")); } } cleanupOpenInventories(); @@ -715,7 +715,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } for (String messageText : broadcast.getLines()) { - player.sendMessage(messageText); + user.sendMessage(messageText); } } } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index d112aea88..6eb3e1134 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -404,7 +404,7 @@ public class EssentialsPlayerListener implements Listener final User spyer = ess.getUser(onlinePlayer); if (spyer.isSocialSpyEnabled() && !player.equals(onlinePlayer)) { - onlinePlayer.sendMessage(player.getDisplayName() + " : " + event.getMessage()); + spyer.sendMessage(player.getDisplayName() + " : " + event.getMessage()); } } } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 7bd4ae0bf..ba1bdf4db 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -568,7 +568,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es final User user = ess.getUser(player); if (user.isAuthorized("essentials.kick.notify")) { - player.sendMessage(_("playerKicked", Console.NAME, getName(), kickReason)); + user.sendMessage(_("playerKicked", Console.NAME, getName(), kickReason)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index 50d764652..e806a0141 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -51,17 +51,18 @@ public class Commandlightning extends EssentialsCommand final List<Player> matchedPlayers = server.matchPlayer(args[0]); for (Player matchPlayer : matchedPlayers) { + User matchUser = ess.getUser(matchPlayer); sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName())); final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation()); - if (!ess.getUser(matchPlayer).isGodModeEnabled()) + if (!matchUser.isGodModeEnabled()) { matchPlayer.damage(power, strike); } if (ess.getSettings().warnOnSmite()) { - matchPlayer.sendMessage(_("lightningSmited")); + matchUser.sendMessage(_("lightningSmited")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 1a02f09d7..f378f163d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -80,9 +80,9 @@ public class Commandmsg extends EssentialsCommand continue; } - matchPlayer.sendMessage(_("msgFormat", senderName, translatedMe, message)); + matchedUser.sendMessage(_("msgFormat", senderName, translatedMe, message)); replyTo.setReplyTo(matchPlayer); - ess.getUser(matchPlayer).setReplyTo(sender); + matchedUser.setReplyTo(sender); } if (!foundUser) |