From c8cb9b373573e71dc8ae08910216a4b89c07b02c Mon Sep 17 00:00:00 2001 From: CreedTheFreak Date: Sun, 3 Sep 2017 19:49:57 -0700 Subject: [PATCH] fixed some wonky commit thing that happened, thus the following modifications are brought to you by Delbertina. --- .../src/com/earth2me/essentials/commands/Commandafk.java | 7 ++++++- .../src/com/earth2me/essentials/commands/Commandmail.java | 7 ++++++- .../src/com/earth2me/essentials/commands/Commandme.java | 7 ++++++- .../src/com/earth2me/essentials/commands/Commandr.java | 7 ++++++- .../src/com/earth2me/essentials/commands/Commandseen.java | 7 ++++++- .../com/earth2me/essentials/commands/Commandwhois.java | 8 ++++++-- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index a637f3b09..c89478382 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -51,7 +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")); + if (sender.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + tl("muteFormat", 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 526829881..cfec4e6ad 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -48,7 +48,12 @@ public class Commandmail extends EssentialsCommand { } if (user.isMuted()) { - throw new Exception(tl("voiceSilenced")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + tl("muteFormat", 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 8559b96d3..cbd644ed2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -24,7 +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")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + tl("muteFormat", user.getMuteReason ())); + } } if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index f105f5e28..5030a7bc7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -28,7 +28,12 @@ public class Commandr extends EssentialsCommand { User user = ess.getUser(sender.getPlayer()); if (user.isMuted()) { - throw new Exception(tl("voiceSilenced")); + if (user.getMuteReason ().equals ("")) { + throw new Exception(tl("voiceSilenced")); + } + else { + throw new Exception(tl("voiceSilenced") + tl("muteFormat", 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 f9bae3311..fec5e8d90 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -117,7 +117,12 @@ 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")))); + 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("muteFormat", 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 af002af5b..b09d1f1fc 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")))); - sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")))); - + 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("muteFormat", user.getMuteReason ()))); + } } @Override