Merge branch 'mutes385' of https://github.com/delbertina/Essentials into mutes385

Updated local copy
Conflicts:
	Essentials/src/com/earth2me/essentials/commands/Commandafk.java
	Essentials/src/com/earth2me/essentials/commands/Commandmail.java
	Essentials/src/com/earth2me/essentials/commands/Commandme.java
	Essentials/src/com/earth2me/essentials/commands/Commandr.java
	Essentials/src/com/earth2me/essentials/commands/Commandseen.java
	Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
This commit is contained in:
delbertina 2017-12-17 00:02:52 -06:00
commit 127a7bb2ce
7 changed files with 16 additions and 36 deletions

View File

@ -536,6 +536,10 @@ public abstract class UserData extends PlayerExtension implements IConf {
config.save();
}
public boolean hasMuteReason(){
return getMuteReason().equals("");
}
private long muteTimeout;
private long _getMuteTimeout() {

View File

@ -51,12 +51,8 @@ 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("muteReason", sender.getMuteReason ()));
}
throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ?
tl("muteReason", sender.getMuteReason()) : ""));
}
if (!sender.isAuthorized("essentials.afk.message")) {
throw new Exception(tl("noPermToAFKMessage"));

View File

@ -48,12 +48,8 @@ public class Commandmail extends EssentialsCommand {
}
if (user.isMuted()) {
if (user.getMuteReason ().equals ("")) {
throw new Exception(tl("voiceSilenced"));
}
else {
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
}
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
tl("muteReason", user.getMuteReason()) : ""));
}
User u = getPlayer(server, args[1], true, true);

View File

@ -24,12 +24,8 @@ 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("muteReason", user.getMuteReason ()));
}
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
tl("muteReason", user.getMuteReason()) : ""));
}
if (args.length < 1) {

View File

@ -28,12 +28,8 @@ 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("muteReason", user.getMuteReason ()));
}
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
tl("muteReason", user.getMuteReason()) : ""));
}
message = FormatUtil.formatMessage(user, "essentials.msg", message);

View File

@ -117,12 +117,8 @@ 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("muteReason", user.getMuteReason ()));
}
throw new Exception(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ?
tl("muteReason", user.getMuteReason()) : ""));
}
final String location = user.getGeoLocation();
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) {

View File

@ -56,12 +56,8 @@ 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("muteReason", user.getMuteReason ())));
}
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
tl("muteReason", user.getMuteReason()) : ""));
}
@Override