Skip to content

Instantly share code, notes, and snippets.

@konsolas
Created November 1, 2015 20:58
Show Gist options
  • Save konsolas/2cfac653a69668d1318c to your computer and use it in GitHub Desktop.
Save konsolas/2cfac653a69668d1318c to your computer and use it in GitHub Desktop.
-______-
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);
}
}
}
@Vinc0682
Copy link

Doesn't the API of AAC allow you to exempt players for certain hack type already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment