use of com.elmakers.mine.bukkit.api.effect.EffectPlayer in project MagicPlugin by elBukkit.
the class CustomProjectileAction method startProjectileEffects.
protected void startProjectileEffects(CastContext context, String effectKey) {
Collection<EffectPlayer> projectileEffects = context.getEffects(effectKey);
for (EffectPlayer apiEffectPlayer : projectileEffects) {
if (effectLocation == null) {
effectLocation = new DynamicLocation(actionContext.getTargetLocation());
effectLocation.setDirection(velocity);
}
if (activeProjectileEffects == null) {
activeProjectileEffects = new ArrayList<>();
}
// Hrm- this is ugly, but I don't want the API to depend on EffectLib.
if (apiEffectPlayer instanceof com.elmakers.mine.bukkit.effect.EffectPlayer) {
com.elmakers.mine.bukkit.effect.EffectPlayer effectPlayer = (com.elmakers.mine.bukkit.effect.EffectPlayer) apiEffectPlayer;
effectPlayer.setEffectPlayList(activeProjectileEffects);
effectPlayer.startEffects(effectLocation, null);
}
}
}
Aggregations