diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index 0206dd00e..c431482fe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -51,8 +51,12 @@ public class Commandafk extends EssentialsCommand { private void toggleAfk(User sender, User user, String message) throws Exception { if (message != null && sender != null) { if (sender.isMuted()) { - throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ? - tl("muteReason", sender.getMuteReason()) : "")); + if (sender.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", sender.getMuteReason ())); + } } if (!sender.isAuthorized("essentials.afk.message")) { throw new Exception(tl("noPermToAFKMessage")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index 3c1f736e1..f96b1e128 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -48,8 +48,12 @@ public class Commandmail extends EssentialsCommand { } if (user.isMuted()) { - throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ? - tl("muteReason", user.getMuteReason()) : "")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ())); + } } User u = getPlayer(server, args[1], true, true); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index f3aa2db86..ed4031dcf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -24,8 +24,12 @@ public class Commandme extends EssentialsCommand { @Override public void run(Server server, User user, String commandLabel, String[] args) throws Exception { if (user.isMuted()) { - throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ? - tl("muteReason", user.getMuteReason()) : "")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ())); + } } if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java index 1510c3a27..2a7c1fa82 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java @@ -72,8 +72,8 @@ public class Commandmute extends EssentialsCommand { sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime)); user.sendMessage(tl("playerMutedFor", muteTime)); } else { - sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime) + tl("muteReason",user.getMuteReason())); - user.sendMessage(tl("playerMutedFor", muteTime) + tl("muteReason",user.getMuteReason())); + sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime) + " " + tl("muteReason",user.getMuteReason())); + user.sendMessage(tl("playerMutedFor", muteTime) + " " + tl("muteReason",user.getMuteReason())); } } else { if (user.getMuteReason ().equals ("")) { @@ -82,9 +82,9 @@ public class Commandmute extends EssentialsCommand { user.sendMessage(tl("playerMuted")); } else { - sender.sendMessage(tl("mutedPlayer", user.getDisplayName()) + tl("muteReason",user.getMuteReason())); + sender.sendMessage(tl("mutedPlayer", user.getDisplayName()) + " " + tl("muteReason",user.getMuteReason())); /** Send the player a message, why they were muted **/ - user.sendMessage(tl("playerMuted")+ tl("muteReason",user.getMuteReason())); + user.sendMessage(tl("playerMuted") + " " + tl("muteReason",user.getMuteReason())); } } final String message; @@ -93,14 +93,14 @@ public class Commandmute extends EssentialsCommand { message = tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime); } else { - message = (tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime) + tl("muteReason",user.getMuteReason())); + message = (tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime) + " " + tl("muteReason",user.getMuteReason())); } } else { if (user.getMuteReason ().equals ("")) { message = tl("muteNotify", sender.getSender().getName(), user.getName()); } else { - message = (tl("muteNotify", sender.getSender().getName(), user.getName()) + tl("muteReason",user.getMuteReason())); + message = (tl("muteNotify", sender.getSender().getName(), user.getName()) + " " + tl("muteReason",user.getMuteReason())); } } server.getLogger().log(Level.INFO, message); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index 9b997ca1f..64a5693de 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -28,8 +28,12 @@ public class Commandr extends EssentialsCommand { User user = ess.getUser(sender.getPlayer()); if (user.isMuted()) { - throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ? - tl("muteReason", user.getMuteReason()) : "")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ())); + } } message = FormatUtil.formatMessage(user, "essentials.msg", message); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 41a8f0501..b42de1370 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -117,8 +117,12 @@ public class Commandseen extends EssentialsCommand { sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true")))); } if (user.isMuted()) { - throw new Exception(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ? - tl("muteReason", user.getMuteReason()) : "")); + if (user.getMuteReason ().equals ("")) { + sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true")))); + } + else { + sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + " " + tl("muteReason", user.getMuteReason ())); + } } final String location = user.getGeoLocation(); if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index d9598f77c..4fc96d04e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -56,8 +56,12 @@ public class Commandwhois extends EssentialsCommand { sender.sendMessage(tl("whoisAFK", tl("false"))); } sender.sendMessage(tl("whoisJail", (user.isJailed() ? user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true") : tl("false")))); - throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ? - tl("muteReason", user.getMuteReason()) : "")); + if (user.getMuteReason ().equals ("")) { + sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")))); + } + else { + sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")) + " " + tl("muteReason", user.getMuteReason ()))); + } } @Override