fixed some wonky commit thing that happened, thus the following modifications are brought to you by Delbertina.

This commit is contained in:
CreedTheFreak 2017-09-03 19:49:57 -07:00 committed by delbertina
parent 4f8ea06db1
commit c8cb9b3735
6 changed files with 36 additions and 7 deletions

View File

@ -51,8 +51,13 @@ public class Commandafk extends EssentialsCommand {
private void toggleAfk(User sender, User user, String message) throws Exception {
if (message != null && sender != null) {
if (sender.isMuted()) {
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"));
}

View File

@ -48,8 +48,13 @@ public class Commandmail extends EssentialsCommand {
}
if (user.isMuted()) {
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);
if (u == null) {

View File

@ -24,8 +24,13 @@ public class Commandme extends EssentialsCommand {
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception {
if (user.isMuted()) {
if (user.getMuteReason ().equals ("")) {
throw new Exception(tl("voiceSilenced"));
}
else {
throw new Exception(tl("voiceSilenced") + tl("muteFormat", user.getMuteReason ()));
}
}
if (args.length < 1) {
throw new NotEnoughArgumentsException();

View File

@ -28,8 +28,13 @@ public class Commandr extends EssentialsCommand {
User user = ess.getUser(sender.getPlayer());
if (user.isMuted()) {
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);
messageSender = user;

View File

@ -117,8 +117,13 @@ public class Commandseen extends EssentialsCommand {
sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true"))));
}
if (user.isMuted()) {
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"))) {
sender.sendMessage(tl("whoisGeoLocation", location));

View File

@ -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"))));
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