@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onPlayerKick(PlayerKickEvent event) {
    if (Bloodbending.isBloodbended(event.getPlayer())) {
      event.setCancelled(true);
      event.setReason(null);
    }
    if (EntityTools.isFallImmune(event.getPlayer())) {
      event.setCancelled(true);
      event.setReason(null);
    }

    Bending.getInstance().getBendingDatabase().release(event.getPlayer().getUniqueId());
  }
  @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
  public void onPlayerDamage(EntityDamageEvent event) {
    if (event.getEntity() instanceof Player) {
      Player player = (Player) event.getEntity();
      BendingPlayer bender = BendingPlayer.getBendingPlayer(player);
      String ability = bender.getAbility();

      if (event.getCause() == DamageCause.FALL) {
        BendingPassiveAbility ab = null;
        if (bender != null && bender.isBender(BendingElement.EARTH)) {
          ab =
              new EarthPassive(
                  AbilityManager.getManager().getRegisteredAbility(EarthPassive.NAME), player);
          if (ab.start()) {
            AbilityManager.getManager().addInstance(ab);
            player.setFallDistance(0);
            event.setDamage(0);
            event.setCancelled(true);
            return;
          }

          if (MetalWire.hasNoFallDamage(player)) {
            player.setFallDistance(0);
            event.setDamage(0);
            event.setCancelled(true);
            return;
          }
        }

        if (bender != null
            && bender.isBender(BendingElement.AIR)
            && EntityTools.canBendPassive(player, BendingElement.AIR)) {
          if (AirBurst.NAME.equals(ability)) {
            BendingActiveAbility burst =
                AbilityManager.getManager().buildAbility(AirBurst.NAME, player);
            if (burst.canBeInitialized()) {
              burst.fall();
              if (burst.getState() != BendingAbilityState.START
                  && burst.getState() != BendingAbilityState.ENDED) {
                AbilityManager.getManager().addInstance(burst);
              }
            }
          }
          player.setFallDistance(0);
          event.setDamage(0);
          event.setCancelled(true);
          return;
        }

        if (!event.isCancelled() && EntityTools.isBender(player, BendingElement.WATER)) {
          ab =
              new WaterPassive(
                  AbilityManager.getManager().getRegisteredAbility(WaterPassive.NAME), player);
          AbilityManager.getManager().addInstance(ab);
          if (ab.start()) {
            player.setFallDistance(0);
            event.setDamage(0);
            event.setCancelled(true);
            return;
          }
        }

        if (!event.isCancelled()
            && bender.isBender(BendingElement.MASTER)
            && EntityTools.canBendPassive(player, BendingElement.MASTER)) {
          event.setDamage((int) (event.getDamage() * (Settings.MASTER_FALL_REDUCTION / 100.)));
          if (event.getEntity().getFallDistance() < 10) {
            event.setCancelled(true);
            return;
          }
        }

        if (!event.isCancelled() && EntityTools.isFallImmune(player)) {
          event.setCancelled(true);
          return;
        }
      }

      if (EntityTools.canBendPassive(player, BendingElement.FIRE)
          && EntityTools.isBender(player, BendingElement.FIRE)
          && ((event.getCause() == DamageCause.FIRE)
              || (event.getCause() == DamageCause.FIRE_TICK))) {
        event.setCancelled(!Enflamed.canBurn(player));
      }

      if (EntityTools.isBender(player, BendingElement.EARTH)
          && ((event.getCause() == DamageCause.SUFFOCATION)
              && TempBlock.isTempBlock(player.getEyeLocation().getBlock()))) {
        event.setDamage(0);
        event.setCancelled(true);
      }

      if (bender != null) {
        Map<Object, BendingAbility> instances =
            AbilityManager.getManager().getInstances(AvatarShield.NAME);
        if (instances.containsKey(player)) {
          AvatarShield ab = (AvatarShield) instances.get(player);
          if (ab.hit()) {
            event.setCancelled(true);
          }
        }
      }
    }
  }