- Start the indefinite ban system, currently working with manually adding to the configuration.

- /plex reload reloads the indefinite bans
- Fixed bug where AdminChat showed up with symbols still and not colorized in adminchat
This commit is contained in:
Taah
2022-02-27 22:28:00 -08:00
parent fea21195da
commit 8550240754
10 changed files with 166 additions and 43 deletions

View File

@ -13,6 +13,27 @@ public class BanListener extends PlexListener
@EventHandler
public void onPreLogin(AsyncPlayerPreLoginEvent event)
{
if (plugin.getPunishmentManager().isIndefUUIDBanned(event.getUniqueId()))
{
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED,
Punishment.generateIndefBanMessage("UUID"));
return;
}
if (plugin.getPunishmentManager().isIndefIPBanned(event.getAddress().getHostAddress()))
{
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED,
Punishment.generateIndefBanMessage("IP"));
return;
}
if (plugin.getPunishmentManager().isIndefUserBanned(event.getName()))
{
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED,
Punishment.generateIndefBanMessage("username"));
return;
}
if (plugin.getPunishmentManager().isBanned(event.getUniqueId()))
{
PunishedPlayer player = PlayerCache.getPunishedPlayer(event.getUniqueId());