Created
November 1, 2015 20:58
-
-
Save konsolas/2cfac653a69668d1318c to your computer and use it in GitHub Desktop.
-______-
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AACWrapperAhemReloaded implements Listener { | |
private final Map<HackType, Set<UUID>> exempt = new HashMap<>(); | |
public AACWrapperAhemReloaded(JavaPlugin plugin) { | |
plugin.getServer().getPluginManager().registerEvents(this, plugin); | |
for(HackType hackType : HackType.values()) { | |
exempt.put(hackType, new HashSet<UUID>()); | |
} | |
} | |
public void exempt(Player player, HackType from) { | |
exempt.get(from).add(player.getUniqueId()); | |
} | |
public boolean isExempt(Player player, HackType from) { | |
return exempt.get(from).contains(player.getUniqueId()); | |
} | |
public void unexempt(Player player, HackType from) { | |
exempt.get(from).remove(player.getUniqueId()); | |
} | |
@EventHandler | |
public void onPlayerViolation(PlayerViolationEvent event) { | |
if(isExempt(event.getPlayer(), event.getHackType())) { | |
event.setCancelled(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't the API of AAC allow you to exempt players for certain hack type already?