public class WarnManager extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
warnActive |
Constructor and Description |
---|
WarnManager() |
Modifier and Type | Method and Description |
---|---|
static WarnResult |
executeWarn(Warn warn)
Executes the given warn.
|
static List<Warn> |
getActiveWarn(UUID playerId) |
static List<Warn> |
getActiveWarnOnSameIP(String ip)
Get all active warn on the given IP
Return an empty array if warn feature is disabled
|
static int |
getInt(Cheat where,
String key) |
static @Nullable WarnProcessor |
getProcessor() |
static List<String> |
getProcessorDescription() |
static String |
getProcessorId() |
static String |
getProcessorName() |
static Map<String,WarnProcessor> |
getProcessors() |
static List<Sanction> |
getSanctions() |
static String |
getString(Cheat where,
String key) |
static List<Warn> |
getWarn(UUID playerId) |
static Configuration |
getWarnConfig() |
static void |
init() |
static boolean |
isWarned(UUID playerId) |
static void |
registerProcessor(String id,
WarnProcessor processor) |
static WarnResult |
revokeWarn(UUID playerId,
String revoker)
Revokes the active warns of the player identified by the given UUID.
|
static WarnResult |
revokeWarn(Warn w,
String revoker)
Revokes the given warn
The revocation may fail if warns are disabled.
|
static void |
setProcessorId(String processorId) |
static void |
setWarnActive(boolean b)
Change the state of warn
This doesn't save the config |
public static boolean isWarned(UUID playerId)
public static WarnResult executeWarn(Warn warn)
WarnResult
data instead of what was passed to this method's parameters.
The warn may not be executed if warns are disabled, or for any WarnProcessor
-specific reason, like if the player bypassed the warn.
warn
- the warn to executepublic static WarnResult revokeWarn(UUID playerId, String revoker)
The revocation may fail if the player is not warned or warns are disabled.
playerId
- the UUID of the player to unwarnrevoker
- who revoke the warnnull
if the revocation failed.public static WarnResult revokeWarn(Warn w, String revoker)
The revocation may fail if warns are disabled.
w
- the warn to revokerevoker
- who revoke the warnnull
if the revocation failed.public static List<Warn> getActiveWarnOnSameIP(String ip)
Return an empty array if warn feature is disabled
ip
- the IP where we are looking for warnpublic static String getProcessorId()
public static void setProcessorId(String processorId)
public static @Nullable WarnProcessor getProcessor()
public static String getProcessorName()
public static Map<String,WarnProcessor> getProcessors()
public static void registerProcessor(String id, WarnProcessor processor)
public static void init()
public static void setWarnActive(boolean b)
b
- true if the warn feature should be enabledpublic static Configuration getWarnConfig()