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, waitisBannedprotected 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)
BanProcessorThe ban may not be executed for any processor-specific reason.
executeBan in interface BanProcessorban - the ban to executepublic BanResult revokeBan(UUID playerId)
BanProcessorThe 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 BanProcessorplayerId - the UUID of the player to unbannull if the revocation failed.public @Nullable Ban getActiveBan(UUID playerId)
getActiveBan in interface BanProcessorpublic List<Ban> getLoggedBans(UUID playerId)
BanProcessorgetLoggedBans in interface BanProcessorplayerId - the UUID of the player to get logged banpublic List<Ban> getActiveBanOnSameIP(String ip)
BanProcessorgetActiveBanOnSameIP in interface BanProcessorip - the IP where we are looking for banpublic List<Ban> getAllBans()
BanProcessorgetAllBans in interface BanProcessorpublic boolean isHandledByNegativity()
isHandledByNegativity in interface BanProcessorfalse if bans are handled by another plugin.public String getName()
BanProcessorgetName in interface BanProcessorpublic List<String> getDescription()
BanProcessorgetDescription in interface BanProcessor