public void clicked() {
   EntityPlayer p = GuiPerks.player;
   if (ExtendedPlayer.hasPlayerAquired(p, PlayerClass.values()[cls], lvl)) {
     ExtendedPlayer.toggleAbilityChecked(
         p,
         !ExtendedPlayer.isAbilityEnabled(p, PlayerClass.values()[cls], lvl),
         PlayerClass.values()[cls],
         lvl);
   } else {
     ExtendedPlayer.requestUnlockLevel(p, PlayerClass.values()[cls], lvl);
   }
 }
  public boolean isAbilityEnabled() {

    return ExtendedPlayer.isAbilityEnabled(GuiPerks.player, PlayerClass.values()[cls], lvl)
        || ExtendedPlayer.isAbilityEnabled(
            Minecraft.getMinecraft().thePlayer, PlayerClass.values()[cls], lvl);
  }
 public boolean isAbilityPurchased() {
   return ExtendedPlayer.getAbilityLevelFor(GuiPerks.player, PlayerClass.values()[cls]) >= lvl
       || ExtendedPlayer.getAbilityLevelFor(
               Minecraft.getMinecraft().thePlayer, PlayerClass.values()[cls])
           >= lvl;
 }
 public void setup(PlayerClass clazz, int level) {
   dx = (level - 1) * 18;
   dy = (clazz.ordinal()) * 18;
   lvl = level;
   cls = clazz.ordinal();
 }