Changed if else blocks to ternary operators. Not sure if way to avoid weird empty string usage.

This commit is contained in:
delbertina 2017-12-02 20:35:44 -06:00
parent d555c1b081
commit 849b329213
6 changed files with 12 additions and 36 deletions

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