diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-06-10 19:56:24 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-06-10 19:56:24 +0100 |
commit | 20d439578beb8776290565c493fbd7985fbf959e (patch) | |
tree | e79bfc7ef3dee869789815652d28683e75fd09fe | |
parent | dd7f1bcf253c77d95567f20361102a12b2353bfe (diff) | |
download | Essentials-20d439578beb8776290565c493fbd7985fbf959e.tar Essentials-20d439578beb8776290565c493fbd7985fbf959e.tar.gz Essentials-20d439578beb8776290565c493fbd7985fbf959e.tar.lz Essentials-20d439578beb8776290565c493fbd7985fbf959e.tar.xz Essentials-20d439578beb8776290565c493fbd7985fbf959e.zip |
Fix /mute to follow same convention as /tjail
Fixed #2056
-rw-r--r-- | Essentials/src/com/earth2me/essentials/UserData.java | 10 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandmute.java | 10 |
2 files changed, 9 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index e0f638fb0..97fa02a2b 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -493,10 +493,9 @@ public abstract class UserData extends PlayerExtension implements IConf config.setProperty("godmode", set); config.save(); } - private boolean muted; - private boolean getMuted() + public boolean getMuted() { return config.getBoolean("muted", false); } @@ -512,13 +511,6 @@ public abstract class UserData extends PlayerExtension implements IConf config.setProperty("muted", set); config.save(); } - - public boolean toggleMuted() - { - boolean ret = !isMuted(); - setMuted(ret); - return ret; - } private long muteTimeout; private long _getMuteTimeout() diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java index 3e70cc507..fa86a8a02 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java @@ -28,13 +28,19 @@ public class Commandmute extends EssentialsCommand throw new Exception(_("muteExempt")); } long muteTimestamp = 0; + if (args.length > 1) { - String time = getFinalArg(args, 1); + final String time = getFinalArg(args, 1); muteTimestamp = Util.parseDateDiff(time, true); + player.setMuted(true); + } + else + { + player.setMuted(!player.getMuted()); } player.setMuteTimeout(muteTimestamp); - final boolean muted = player.toggleMuted(); + final boolean muted = player.getMuted(); sender.sendMessage( muted ? (muteTimestamp > 0 |