Пример #1
0
  /**
   * Target embedded effects
   *
   * @param event event details
   */
  @EventHandler
  public void onProjectileHit(EntityDamageByEntityEvent event) {

    if (projectiles.containsKey(event.getDamager().getEntityId())
        && event.getEntity() instanceof LivingEntity) {
      EmbedData data = projectiles.get(event.getDamager().getEntityId());
      data.getSkill().beginUsage();
      data.resolveTarget((LivingEntity) event.getEntity());
      data.getSkill().stopUsage();
    }
  }
Пример #2
0
 /**
  * Non-target embedded effects
  *
  * @param event event details
  */
 @EventHandler
 public void onProjectileHit(final ProjectileHitEvent event) {
   Bukkit.getScheduler()
       .runTaskLater(
           Bukkit.getPluginManager().getPlugin("SkillAPI"),
           new Runnable() {
             @Override
             public void run() {
               projectiles.remove(event.getEntity().getEntityId());
             }
           },
           1);
   if (projectiles.containsKey(event.getEntity().getEntityId())) {
     EmbedData data = projectiles.get(event.getEntity().getEntityId());
     data.getSkill().beginUsage();
     data.resolveNonTarget(event.getEntity().getLocation());
     data.getSkill().stopUsage();
   }
 }