diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 0df6aa7a5..ceb4c3b79 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -81,8 +81,7 @@ public class EssentialsPlayerListener implements Listener { if (user.isMuted()) { event.setCancelled(true); - user.sendMessage(tl("voiceSilenced") + (user.hasMuteReason() ? - (" " + tl("muteReason", user.getMuteReason())) : "")); + user.sendMessage(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced")); LOGGER.info(tl("mutedUserSpeaks", user.getName(), event.getMessage())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index df5847274..d9f73be86 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -51,8 +51,7 @@ 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())) : "")); + throw new Exception(sender.hasMuteReason() ? tl("voiceSilencedReason", sender.getMuteReason()) : tl("voiceSilenced")); } 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 a1f78674a..5fd17b152 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -48,8 +48,7 @@ public class Commandmail extends EssentialsCommand { } if (user.isMuted()) { - throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ? - (" " + tl("muteReason", user.getMuteReason())) : "")); + throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced")); } 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 f5d31ffc7..098406103 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -24,8 +24,7 @@ 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())) : "")); + throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced")); } 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 2a7c1fa82..f86cf0403 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("mutedPlayerForReason", user.getDisplayName(), muteTime, user.getMuteReason())); + user.sendMessage(tl("playerMutedForReason", muteTime, 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("mutedPlayerReason", user.getDisplayName(), user.getMuteReason())); /** Send the player a message, why they were muted **/ - user.sendMessage(tl("playerMuted") + " " + tl("muteReason",user.getMuteReason())); + user.sendMessage(tl("playerMutedReason", 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("muteNotifyForReason", sender.getSender().getName(), user.getName(), muteTime, 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("muteNotifyReason", sender.getSender().getName(), user.getName(), 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 2e251c666..67a2d1dec 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -28,8 +28,7 @@ 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())) : "")); + throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced")); } 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 601044f97..4791ce623 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -117,8 +117,9 @@ public class Commandseen extends EssentialsCommand { sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true")))); } if (user.isMuted()) { - sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ? - (" " + tl("muteReason", user.getMuteReason())) : "")); + sender.sendMessage(user.hasMuteReason() ? (tl("whoisMutedReason", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true")), user.getMuteReason())) : + tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true")))); + sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true")))); } 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 be4d65c78..c92059358 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -56,8 +56,9 @@ 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")))); - sender.sendMessage(tl("whoisMuted") + (user.hasMuteReason() ? - (" " + tl("muteReason", user.getMuteReason())) : "")); + sender.sendMessage(user.hasMuteReason() ? tl("whoisMutedReason", (user.isMuted() ? user.getMuteTimeout() > 0 ? + DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")),user.getMuteReason()) : tl("whoisMuted", (user.isMuted() ? + user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")))); } @Override