Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Check implements IDebugPlayer
- {
- protected static Map<String, ExecutionHistory> histories = new HashMap();
- protected final CheckType type;
- protected final IGenericInstanceHandle<MCAccess> mcAccess;
- protected static ExecutionHistory getHistory(Player player)
- {
- if (!histories.containsKey(player.getName())) {
- histories.put(player.getName(), new ExecutionHistory());
- }
- return (ExecutionHistory)histories.get(player.getName());
- }
- public Check(CheckType type)
- {
- this.type = type;
- this.mcAccess = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(MCAccess.class);
- ViolationHistory.checkTypeMap.put(getClass().getName(), type);
- DataManager.registerExecutionHistory(type, histories);
- }
- public ViolationData executeActions(Player player, double vL, double addedVL, ActionList actions, IPenaltyList penaltyList)
- {
- return executeActions(new ViolationData(this, player, vL, addedVL, actions, penaltyList));
- }
- public ViolationData executeActions(Player player, double vL, double addedVL, ActionList actions)
- {
- return executeActions(new ViolationData(this, player, vL, addedVL, actions));
- }
- public ViolationData executeActions(ViolationData violationData)
- {
- if (NCPHookManager.shouldCancelVLProcessing(violationData)) {
- violationData.preventCancel();
- } else if (Bukkit.isPrimaryThread()) {
- violationData.executeActions();
- } else {
- TickTask.requestActionsExecution(violationData);
- }
- return violationData;
- }
- public CheckType getType()
- {
- return this.type;
- }
- public boolean isEnabled(Player player, ICheckData data, ICheckConfig cc)
- {
- return (cc.isEnabled(this.type)) && (!CheckUtils.hasBypass(this.type, player, data));
- }
- public boolean isEnabled(Player player, ICheckConfig cc)
- {
- return (cc.isEnabled(this.type)) && (!CheckUtils.hasBypass(this.type, player, null));
- }
- public boolean isEnabled(Player player)
- {
- return (this.type.isEnabled(player)) && (!CheckUtils.hasBypass(this.type, player, null));
- }
- public boolean hasBypass(Player player)
- {
- return CheckUtils.hasBypass(this.type, player, null);
- }
- public void debug(Player player, String message)
- {
- CheckUtils.debug(player, this.type, message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement