public abstract class Cheat extends AbstractDetection<CheatKeys>
Modifier and Type | Class and Description |
---|---|
static class |
Cheat.CheatCategory |
static class |
Cheat.CheatDescription |
static class |
Cheat.CheatHover |
Modifier and Type | Field and Description |
---|---|
static List<Cheat> |
CHEATS |
config, key, material
Constructor and Description |
---|
Cheat(CheatKeys key,
Cheat.CheatCategory type,
Material m,
Cheat.CheatDescription... options)
Create a new cheat object and load default config
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowKick()
Check if the cheat is allowed to kick player
|
boolean |
checkActive(Check check)
Check if a detection is active
|
boolean |
checkActive(String checkName)
Check if a detection is active
|
static Cheat |
forKey(CheatKeys key)
Get the cheat according to the key
|
static Cheat |
fromString(String name)
Get cheat from a name
Can be the key, the name or one of the alias
|
int |
getAlertToKick()
Get the amount of needed alert to kick.
|
static Map<CheatKeys,Cheat> |
getCheatByKeys()
Return a map of cheat keys and their corresponding cheat instance
|
Cheat.CheatCategory |
getCheatCategory()
Get the category of the cheat
|
static Set<CheatKeys> |
getCheatKeys()
Get all cheat keys
|
static CheckManager |
getCheckManager() |
List<Check> |
getChecks() |
String |
getCommandName()
Get the exact name of the cheat but for command (without special char, space ...)
|
static List<Cheat> |
getEnabledCheat() |
int |
getMaxAlertPing()
Get the maximum ping to create alert
By default it's 150ms
|
String |
getName()
Get the exact name of the cheat
|
List<Cheat.CheatDescription> |
getOptions() |
int |
getReliabilityAlert()
Get needed reliability to see alert
By default it's 60%
|
boolean |
hasOption(Cheat.CheatDescription o) |
boolean |
hasVerif()
Check if the cheat can verif someone
|
Cheat.CheatHover |
hoverMsg(String key,
Object... placeholders)
Create a new hover message
|
boolean |
isSetBack()
Check if the setBack option is enabled
|
static void |
loadCheat()
Load all cheat
Support reload
|
@Nullable String |
makeVerificationSummary(VerifData data,
NegativityPlayer np)
Create a verification summary
|
void |
performSetBack(Player p)
Use set back option of the player
Warn: this doesn't check if setBack option is enabled
|
<T> void |
recordData(UUID target,
VerifData.DataType<T> type,
T value)
Add data to verification
|
boolean |
setAllowKick(boolean b)
Set the allowability to kick.
|
boolean |
setBack(boolean b)
Set if setback option is active
Warn: this don't save the config
|
void |
setCheckActive(Check check,
boolean active)
Check if a detection is active
|
void |
setCheckActive(String checkName,
boolean active)
Check if a detection is active
|
void |
setVerif(boolean verif)
Set if the cheat is used in verif
Warn: this don't save the config
|
static List<Cheat> |
values() |
compareTo, getConfig, getKey, getMaterial, isActive, isDisabledForBedrock, saveConfig, setActive
public Cheat(CheatKeys key, Cheat.CheatCategory type, Material m, Cheat.CheatDescription... options)
key
- the cheat keytype
- the cheat categorym
- the material used in inventory to represent this cheatoptions
- all options that describe the cheatpublic static CheckManager getCheckManager()
public String getName()
getName
in class AbstractDetection<CheatKeys>
public String getCommandName()
public boolean checkActive(String checkName)
checkName
- the name of the detectionpublic boolean checkActive(Check check)
check
- the check that we are looking to checkpublic void setCheckActive(String checkName, boolean active)
checkName
- the name of the detectionactive
- if the check will be activepublic void setCheckActive(Check check, boolean active)
check
- the check of the detectionactive
- if the check will be activepublic Cheat.CheatCategory getCheatCategory()
public int getReliabilityAlert()
public boolean isSetBack()
public boolean allowKick()
public boolean setAllowKick(boolean b)
b
- the new valuepublic int getAlertToKick()
public boolean setBack(boolean b)
b
- the new valuepublic int getMaxAlertPing()
public void setVerif(boolean verif)
verif
- the new valuepublic boolean hasVerif()
public void performSetBack(Player p)
p
- the player which have to be set backpublic Cheat.CheatHover hoverMsg(String key, Object... placeholders)
key
- the key of the messageplaceholders
- all placeholders of the messagepublic @Nullable String makeVerificationSummary(VerifData data, NegativityPlayer np)
data
- the verif datanp
- the negativity playerpublic final <T> void recordData(UUID target, VerifData.DataType<T> type, T value)
T
- The type of the recorded datatarget
- the player which create the datatype
- the data typevalue
- the value recordedpublic List<Cheat.CheatDescription> getOptions()
public boolean hasOption(Cheat.CheatDescription o)
public static Cheat fromString(String name)
name
- the cheat namepublic static Cheat forKey(CheatKeys key)
key
- the cheat keypublic static Map<CheatKeys,Cheat> getCheatByKeys()
public static void loadCheat()