package com.elmakers.mine.bukkit.api.effect;

import org.bukkit.Color;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.block.Block;

import com.elmakers.mine.bukkit.api.block.MaterialAndData;
import org.bukkit.entity.Entity;

import java.util.Collection;
import java.util.Map;

public interface EffectPlayer {
    public void setEffectPlayList(Collection<EffectPlay> plays);
    public void setEffect(Effect effect);
    public void setEffectData(int data);
    public void setScale(float scale);

    public void setSound(Sound sound);
    public void setSound(Sound sound, float volume, float pitch);
    public void setParameterMap(Map<String, String> parameters);

    public void setDelayTicks(int ticks);

    public void setParticleOverride(String particleType);
    public void setMaterial(MaterialAndData material);
    public void setMaterial(Block block);
    public void setColor(Color color);
    public boolean shouldUseHitLocation();
    public boolean shouldUseWandLocation();
    public boolean shouldUseEyeLocation();
    public boolean shouldUseBlockLocation();

    public void start(Location origin, Location target);
    public void start(Entity origin, Entity target);
    public void start(Location origin, Entity originEntity, Location target, Entity targetEntity);
    public void start(Location origin, Entity originEntity, Location target, Entity targetEntity, Collection<Entity> targets);
}

@@ -39,16 +39,72 @@
 ffect;%0A%0A
+import com.elmakers.mine.bukkit.api.action.CastContext;%0A
 import o
@@ -1083,32 +1083,76 @@
 WandLocation();%0A
+    public boolean shouldUseCastLocation();%0A
     public boole
@@ -1222,16 +1222,76 @@
 ation();
+%0A    public Location getSourceLocation(CastContext context);
 %0A%0A    pu

Move responsibility for calculating effect source location to EffectPlayer. I'm not too crazy about the CastContext dependency I added here, but I found it difficult to do it any other way.