Fix a whole bunch of bugs

- Rewrite how bans are handled
- Add /unfreeze command
- Rename LoginListener to BanListener
- Persistent commandspy
This commit is contained in:
2022-02-06 23:53:57 -06:00
parent fddf57d7f5
commit 2631867e27
27 changed files with 84 additions and 120 deletions

View File

@ -1,5 +1,6 @@
package dev.plex.command.impl;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
@ -20,11 +21,15 @@ public class CommandSpyCMD extends PlexCommand
@Override
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, @NotNull String[] args)
{
PlexPlayer plexPlayer = getPlexPlayer(playerSender);
plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy());
Component component = Component.text("CommandSpy has been").color(NamedTextColor.GRAY)
.append(Component.space())
.append(Component.text(plexPlayer.isCommandSpy() ? "enabled." : "disabled.").color(NamedTextColor.GRAY));
return component;
if (playerSender != null)
{
PlexPlayer plexPlayer = DataUtils.getPlayer(playerSender.getUniqueId());
plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy());
DataUtils.update(plexPlayer);
return Component.text("CommandSpy has been").color(NamedTextColor.GRAY)
.append(Component.space())
.append(Component.text(plexPlayer.isCommandSpy() ? "enabled." : "disabled.").color(NamedTextColor.GRAY));
}
return null;
}
}