public class BanManager extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
autoBan |
static boolean |
banActive |
Constructor and Description |
---|
BanManager() |
Modifier and Type | Method and Description |
---|---|
static BanResult |
executeBan(Ban ban)
Executes the given ban.
|
static @Nullable Ban |
getActiveBan(UUID playerId) |
static List<Ban> |
getActiveBanOnSameIP(String ip)
Get all active ban on the given IP
Return an empty array if ban feature is disabled
|
static AltAccountBan |
getAltBanFor(int nb) |
static Configuration |
getBanConfig() |
static int |
getInt(Cheat where,
String key) |
static List<Ban> |
getLoggedBans(UUID playerId) |
static @Nullable BanProcessor |
getProcessor() |
static List<String> |
getProcessorDescription() |
static String |
getProcessorId() |
static String |
getProcessorName() |
static Map<String,BanProcessor> |
getProcessors() |
static List<Sanction> |
getSanctions() |
static String |
getString(Cheat where,
String key) |
static void |
init() |
static boolean |
isBanned(UUID playerId) |
static void |
registerProcessor(String id,
BanProcessor processor) |
static BanResult |
revokeBan(UUID playerId)
Revokes the active ban of the player identified by the given UUID.
|
static void |
setAutoBan(boolean b)
Change the state of auto ban
This doesn't save the config |
static void |
setBanActive(boolean b)
Change the state of ban
This doesn't save the config |
static void |
setProcessorId(String processorId) |
static boolean |
shouldNegativityHandleBans()
Indicates whether Negativity should kick banned players
|
public static boolean isBanned(UUID playerId)
public static BanResult executeBan(Ban ban)
BanResult
data instead of what was passed to this method's parameters.
The ban may not be executed if bans are disabled, or for any BanProcessor
-specific reason, like if the player bypassed the ban.
public static BanResult revokeBan(UUID playerId)
The revocation may fail if the player is not banned or bans are disabled.
If ban logging is disabled, a LoggedBan will still be returned even though it will not be saved.
playerId
- the UUID of the player to unbannull
if the revocation failed.public static List<Ban> getActiveBanOnSameIP(String ip)
Return an empty array if ban feature is disabled
ip
- the IP where we are looking for banpublic static AltAccountBan getAltBanFor(int nb)
public static boolean shouldNegativityHandleBans()
public static String getProcessorId()
public static void setProcessorId(String processorId)
public static @Nullable BanProcessor getProcessor()
public static String getProcessorName()
public static Map<String,BanProcessor> getProcessors()
public static void registerProcessor(String id, BanProcessor processor)
public static void init()
public static void setBanActive(boolean b)
b
- true if the ban feature should be enabledpublic static void setAutoBan(boolean b)
b
- true if the auto ban feature should be enabledpublic static Configuration getBanConfig()