public class NegativityBanProcessor extends Object implements BanProcessor
ActiveBanStorage
and BanLogsStorage
respectively).
It is important to know its sole purpose is to manage bans, and will not do anything on the game server,
like kicking the player when BanProcessor.executeBan(Ban)
executing a ban.
If you want direct actions on the game server use NegativityBanProcessor
instead.
Modifier and Type | Field and Description |
---|---|
protected ActiveBanStorage |
activeBanStorage |
protected @Nullable BanLogsStorage |
banLogsStorage |
protected String |
name |
Constructor and Description |
---|
NegativityBanProcessor(ActiveBanStorage activeBanStorage,
@Nullable BanLogsStorage banLogsStorage,
String name) |
Modifier and Type | Method and Description |
---|---|
BanResult |
executeBan(Ban ban)
Executes the given ban.
|
@Nullable Ban |
getActiveBan(UUID playerId) |
List<Ban> |
getActiveBanOnSameIP(String ip)
Get all active ban on the same IP
|
List<Ban> |
getAllBans()
Get all current ban.
|
List<String> |
getDescription()
Get the description of the processor, including what's not available with this
|
List<Ban> |
getLoggedBans(UUID playerId)
Get revoked ban of the specified player
Don't include active one
|
String |
getName()
Get the name of the processor
|
boolean |
isHandledByNegativity() |
BanResult |
revokeBan(UUID playerId)
Revokes the active ban of the player identified by the given UUID.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isBanned
protected final ActiveBanStorage activeBanStorage
protected final @Nullable BanLogsStorage banLogsStorage
protected final String name
public NegativityBanProcessor(ActiveBanStorage activeBanStorage, @Nullable BanLogsStorage banLogsStorage, String name)
public BanResult executeBan(Ban ban)
BanProcessor
The ban may not be executed for any processor-specific reason.
executeBan
in interface BanProcessor
ban
- the ban to executepublic BanResult revokeBan(UUID playerId)
BanProcessor
The revocation may fail for any processor-specific reason.
If the revocation was successful a LoggedBan must always be returned, even if it will not persist in any way.
revokeBan
in interface BanProcessor
playerId
- the UUID of the player to unbannull
if the revocation failed.public @Nullable Ban getActiveBan(UUID playerId)
getActiveBan
in interface BanProcessor
public List<Ban> getLoggedBans(UUID playerId)
BanProcessor
getLoggedBans
in interface BanProcessor
playerId
- the UUID of the player to get logged banpublic List<Ban> getActiveBanOnSameIP(String ip)
BanProcessor
getActiveBanOnSameIP
in interface BanProcessor
ip
- the IP where we are looking for banpublic List<Ban> getAllBans()
BanProcessor
getAllBans
in interface BanProcessor
public boolean isHandledByNegativity()
isHandledByNegativity
in interface BanProcessor
false
if bans are handled by another plugin.public String getName()
BanProcessor
getName
in interface BanProcessor
public List<String> getDescription()
BanProcessor
getDescription
in interface BanProcessor