mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
A bit of cleaning up and explaining, moved javadocs to AnticheatAPI.java
This commit is contained in:
1 parent
51557c20a6
commit
a50a57353a
5 files changed
+114
-65
No files matched your search
@@ -27,46 +27,105 @@ import net.h31ix.anticheat.manage.CheckType;
|
||||
import net.h31ix.anticheat.manage.PlayerManager;
|
||||
import net.h31ix.anticheat.xray.XRayTracker;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Developer's interface for all things AntiCheat.
|
||||
*/
|
||||
|
||||
|
||||
public class AnticheatAPI
|
||||
{
|
||||
private static CheckManager chk = Anticheat.getManager().getCheckManager();
|
||||
private static PlayerManager pmr = Anticheat.getManager().getPlayerManager();
|
||||
private static XRayTracker xtracker = Anticheat.getManager().getXRayTracker();
|
||||
|
||||
//CheckManager API.
|
||||
|
||||
|
||||
//CheckManager API
|
||||
|
||||
/**
|
||||
* Start running a certain check
|
||||
*
|
||||
* @param type Check to start watching for
|
||||
*/
|
||||
public static void activateCheck(CheckType type)
|
||||
{
|
||||
chk.activateCheck(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop running a certain check
|
||||
*
|
||||
* @param type Check to stop watching for
|
||||
*/
|
||||
public static void deactivateCheck(CheckType type)
|
||||
{
|
||||
chk.deactivateCheck(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out if a check is currently being watched for
|
||||
*
|
||||
* @param type Type to check
|
||||
* @return true if plugin is watching for this check
|
||||
*/
|
||||
public static boolean isActive(CheckType type)
|
||||
{
|
||||
return chk.isActive(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow a player to skip a certain check
|
||||
*
|
||||
* @param player Player to stop watching
|
||||
* @param type Check to stop watching for
|
||||
*/
|
||||
public static void exemptPlayer(Player player, CheckType type)
|
||||
{
|
||||
chk.exemptPlayer(player, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop allowing a player to skip a certain check
|
||||
*
|
||||
* @param player Player to start watching
|
||||
* @param type Check to start watching for
|
||||
*/
|
||||
public static void unexemptPlayer(Player player, CheckType type)
|
||||
{
|
||||
chk.unexemptPlayer(player, type);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find out if a player is currently exempt from a certain check
|
||||
*
|
||||
* @param player Player to check
|
||||
* @param type Type to check
|
||||
* @return true if plugin is ignoring this check on this player
|
||||
*/
|
||||
public static boolean isExempt(Player player, CheckType type)
|
||||
{
|
||||
return chk.isExempt(player, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out if a check will occur for a player. This checks if they are being tracked, the check is active, the player isn't exempt from the check, and the player doesn't have override permission.
|
||||
*
|
||||
* @param player Player to check
|
||||
* @param type Type to check
|
||||
* @return true if plugin will check this player, and that all things allow it to happen.
|
||||
*/
|
||||
public boolean willCheck(Player player, CheckType type)
|
||||
{
|
||||
return chk.willCheck(player, type);
|
||||
}
|
||||
|
||||
//PlayerManager API
|
||||
|
||||
/**
|
||||
* Get a player's integer hack level (0-19 = Low, 20-49 = Medium, 50-60 = High)
|
||||
*
|
||||
* @param player Player to check
|
||||
* @return player's hack level
|
||||
*/
|
||||
public static int getLevel(Player player)
|
||||
{
|
||||
if(!pmr.hasLevel(player))
|
||||
@@ -76,13 +135,25 @@ public class AnticheatAPI
|
||||
return pmr.getLevel(player);
|
||||
}
|
||||
|
||||
public static void setLevel(Player player, int x)
|
||||
/**
|
||||
* Set a player's hack level (Min = 0, Max = 60)
|
||||
*
|
||||
* @param player Player to set
|
||||
* @param level Level to set to
|
||||
*/
|
||||
public static void setLevel(Player player, int level)
|
||||
{
|
||||
pmr.setLevel(player, x);
|
||||
pmr.setLevel(player, level);
|
||||
}
|
||||
|
||||
//XrayTracker API
|
||||
|
||||
/**
|
||||
* Find out if a player is detected as using xray hacks (on any ore)
|
||||
*
|
||||
* @param player Player to check
|
||||
* @return true if the player has any xray anomalies.
|
||||
*/
|
||||
public static boolean isXrayer(Player player)
|
||||
{
|
||||
String name = player.getName();
|
||||
@@ -94,7 +165,12 @@ public class AnticheatAPI
|
||||
}
|
||||
|
||||
//Advanced Users Only API.
|
||||
|
||||
|
||||
/**
|
||||
* Get access to all the other managers, advanced users ONLY
|
||||
*
|
||||
* @return the AntiCheat Manager
|
||||
*/
|
||||
public static AnticheatManager getManager()
|
||||
{
|
||||
return Anticheat.getManager();
|
||||
|
||||
Reference in new issue
Block a user