diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-05 18:14:18 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-05 18:14:18 +0000 |
commit | 4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4 (patch) | |
tree | 172f2fd85fda6cce051a678d7afb6bc534dee385 | |
parent | 2442285d7bebe17fc963160f9a5886a1ee76790d (diff) | |
download | Essentials-4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4.tar Essentials-4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4.tar.gz Essentials-4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4.tar.lz Essentials-4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4.tar.xz Essentials-4b8ffabfb8c0e6ade5819f0a1939ee923f0556f4.zip |
[trunk] /msg /r Reply to the console. Add /r console command.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1134 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandmsg.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandr.java | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 422dc97a9..c14bfa72e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -33,8 +33,8 @@ public class Commandmsg extends EssentialsCommand String message = getFinalArg(args, 1); - IReplyTo replyTo = sender instanceof User?(User)sender:Console.getConsoleReplyTo(); - String senderName = sender instanceof User?((User)sender).getDisplayName():Console.NAME; + IReplyTo replyTo = sender instanceof Player?User.get((Player)sender):Console.getConsoleReplyTo(); + String senderName = sender instanceof Player?((Player)sender).getDisplayName():Console.NAME; if (args[0].equalsIgnoreCase(Console.NAME)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index 9b2aa9233..fe12562ee 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -25,10 +25,10 @@ public class Commandr extends EssentialsCommand } String message = getFinalArg(args, 0); - IReplyTo replyTo = sender instanceof User?(User)sender:Console.getConsoleReplyTo(); - String senderName = sender instanceof User?((User)sender).getDisplayName():Console.NAME; + IReplyTo replyTo = sender instanceof Player?User.get((Player)sender):Console.getConsoleReplyTo(); + String senderName = sender instanceof Player?((Player)sender).getDisplayName():Console.NAME; CommandSender target = replyTo.getReplyTo(); - String targetName = target instanceof User?((User)target).getDisplayName():Console.NAME; + String targetName = target instanceof Player?((Player)target).getDisplayName():Console.NAME; if (target == null) { @@ -39,10 +39,12 @@ public class Commandr extends EssentialsCommand sender.sendMessage("[Me -> " + targetName + "] " + message); target.sendMessage("[" + senderName + " -> Me] " + message); replyTo.setReplyTo(target); - if (target instanceof Player) { - User.get((Player)target).setReplyTo(sender); - } else { - Console.getConsoleReplyTo().setReplyTo(sender); + if (target != sender) { + if (target instanceof Player) { + User.get((Player)target).setReplyTo(sender); + } else { + Console.getConsoleReplyTo().setReplyTo(sender); + } } } } |