Java 类org.bukkit.entity.AreaEffectCloud 实例源码

项目:ProjectAres    文件:DamageMatchModule.java   
@EventHandler
public void onPotionLinger(final AreaEffectCloudApplyEvent event) {
    final AreaEffectCloud cloud = event.getEntity();
    if(PotionClassification.classify(cloud) != PotionClassification.HARMFUL) return;

    for(Iterator<LivingEntity> iterator = event.getAffectedEntities().iterator(); iterator.hasNext(); ) {
        final LivingEntity victim = iterator.next();
        final ParticipantState victimState = getMatch().getParticipantState(victim);
        final DamageInfo damageInfo = damageResolver.resolveDamage(EntityDamageEvent.DamageCause.MAGIC, victim, cloud);

        if(victimState != null && queryDamage(event, victimState, damageInfo).isDenied()) {
            iterator.remove();
        }
    }
}
项目:SpigotSource    文件:CraftEventFactory.java   
public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) {
       ThrownPotion thrownPotion = (ThrownPotion) potion.getBukkitEntity();
       AreaEffectCloud effectCloud = (AreaEffectCloud) cloud.getBukkitEntity();

       LingeringPotionSplashEvent event = new LingeringPotionSplashEvent(thrownPotion, effectCloud);
       Bukkit.getPluginManager().callEvent(event);
       return event;
}
项目:ProjectAres    文件:PotionUtils.java   
public static Collection<PotionEffect> effects(AreaEffectCloud cloud) {
    return effects(cloud.getBasePotionData(), cloud.getCustomEffects());
}
项目:SpigotSource    文件:CraftEventFactory.java   
public static AreaEffectCloudApplyEvent callAreaEffectCloudApplyEvent(EntityAreaEffectCloud cloud, List<LivingEntity> entities) {
    AreaEffectCloudApplyEvent event = new AreaEffectCloudApplyEvent((AreaEffectCloud) cloud.getBukkitEntity(), entities);
    cloud.world.getServer().getPluginManager().callEvent(event);
    return event;
}