Phiwa

DragonTravel-NCP-checks

Mar 18th, 2013
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.08 KB | None | 0 0
  1.  * Exempts a player from the Cheat-check of AntiCheat-plugins
  2.      *
  3.      * @param player
  4.      *              the player to exempt from the check
  5.      */
  6.     private static void exemptPlayerFromCheatChecks(Player player) {
  7.         // AntiCheat
  8.         if (DragonTravelMain.anticheat  && !net.h31ix.anticheat.api.AnticheatAPI
  9.                 .isExempt(player, net.h31ix.anticheat.manage.CheckType.FLY)) {
  10.             net.h31ix.anticheat.api.AnticheatAPI
  11.                 .exemptPlayer(player,net.h31ix.anticheat.manage.CheckType.FLY);
  12.         }
  13.                
  14.         // NoCheatPlus
  15.         if (DragonTravelMain.nocheatplus
  16.             && !fr.neatmonster.nocheatplus.hooks.NCPExemptionManager
  17.                 .isExempted(player,
  18.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_SURVIVALFLY)
  19.             && !fr.neatmonster.nocheatplus.hooks.NCPExemptionManager
  20.                 .isExempted(player,
  21.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_CREATIVEFLY)
  22.             ) {
  23.             fr.neatmonster.nocheatplus.hooks.NCPExemptionManager.exemptPermanently(player,
  24.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_SURVIVALFLY);
  25.             fr.neatmonster.nocheatplus.hooks.NCPExemptionManager.exemptPermanently(player,
  26.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_CREATIVEFLY);
  27.         }  
  28.     }
  29.    
  30.     /**
  31.      * Unexempts a player from the Cheat-check of AntiCheat-plugins
  32.      *
  33.      * @param player
  34.      *              the player to unexempt from the check
  35.      */
  36.     private static void unexemptPlayerFromCheatChecks(Player player) {
  37.         // AntiCheat
  38.         if (DragonTravelMain.anticheat && net.h31ix.anticheat.api.AnticheatAPI
  39.             .isExempt(player,net.h31ix.anticheat.manage.CheckType.FLY)) {
  40.             net.h31ix.anticheat.api.AnticheatAPI
  41.                 .unexemptPlayer(player,net.h31ix.anticheat.manage.CheckType.FLY);
  42.         }
  43.        
  44.         // NoCheatPlus
  45.         if (DragonTravelMain.nocheatplus
  46.             && fr.neatmonster.nocheatplus.hooks.NCPExemptionManager
  47.                 .isExempted(player,
  48.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_SURVIVALFLY)
  49.             && fr.neatmonster.nocheatplus.hooks.NCPExemptionManager
  50.                 .isExempted(player,
  51.                 fr.neatmonster.nocheatplus.checks.CheckType.MOVING_CREATIVEFLY)                        
  52.             ) {
  53.             fr.neatmonster.nocheatplus.hooks.NCPExemptionManager.unexempt(player);
  54.         }
  55.     }
Advertisement
Add Comment
Please, Sign In to add comment