Resolves FS-318 by rewriting the /mute command

This has the fortunate side-effect of also fixing several bugs present in the original command.
This commit is contained in:
Video
2022-11-13 06:19:10 -07:00
parent f0d6549eec
commit af18299613
4 changed files with 95 additions and 147 deletions

View File

@ -294,7 +294,6 @@ public class FPlayer
public void setMuted(boolean muted, int minutes)
{
FUtil.cancel(unmuteTask);
plugin.mu.MUTED_PLAYERS.remove(getPlayer().getName());
unmuteTask = null;
if (!muted)
@ -307,8 +306,6 @@ public class FPlayer
return;
}
plugin.mu.MUTED_PLAYERS.add(getPlayer().getName());
// TODO: Simplify this into a Consumer<BukkitTask> lambda?
unmuteTask = new BukkitRunnable()
{
@ -323,7 +320,6 @@ public class FPlayer
else
{
FUtil.adminAction(ConfigEntry.SERVER_NAME.getString(), "Unmuting " + getName(), false);
plugin.mu.MUTED_PLAYERS.remove(getName());
}
}
}.runTaskLater(plugin, minutes * (60L * 20L));