Fix /mute to follow same convention as /tjail

Fixed #2056
This commit is contained in:
KHobbits 2012-06-10 19:56:24 +01:00
parent dd7f1bcf25
commit 20d439578b
2 changed files with 9 additions and 11 deletions

View File

@ -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()

View File

@ -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