mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-26 15:33:56 +00:00
Changed if else blocks to ternary operators. Not sure if way to avoid weird empty string usage.
This commit is contained in:
parent
d555c1b081
commit
849b329213
6 changed files with 12 additions and 36 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue