mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-10 10:28:22 +01:00
Fixed logic error in hasMuteReason and errors being thrown from seen and whois.
This commit is contained in:
parent
afe0ff0ca7
commit
e3ee9cb4c7
@ -81,12 +81,8 @@ public class EssentialsPlayerListener implements Listener {
|
||||
if (user.isMuted()) {
|
||||
event.setCancelled(true);
|
||||
|
||||
if (user.getMuteReason().equals ("")) {
|
||||
user.sendMessage(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
user.sendMessage(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
||||
}
|
||||
user.sendMessage(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||
|
||||
LOGGER.info(tl("mutedUserSpeaks", user.getName(), event.getMessage()));
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
}
|
||||
|
||||
public boolean hasMuteReason(){
|
||||
return getMuteReason().equals("");
|
||||
return !getMuteReason().equals("");
|
||||
}
|
||||
|
||||
private long muteTimeout;
|
||||
|
@ -117,7 +117,7 @@ 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() ?
|
||||
sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ?
|
||||
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||
}
|
||||
final String location = user.getGeoLocation();
|
||||
|
@ -56,7 +56,7 @@ 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() ?
|
||||
sender.sendMessage(tl("whoisMuted") + (user.hasMuteReason() ?
|
||||
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user