@@ -0,0 +1,2866 @@
+package com.elmakers.mine.bukkit.action;%0A%0Aimport com.elmakers.mine.bukkit.api.action.CastContext;%0Aimport com.elmakers.mine.bukkit.api.spell.SpellResult;%0Aimport com.elmakers.mine.bukkit.spell.BaseSpell;%0Aimport org.bukkit.configuration.ConfigurationSection;%0Aimport org.bukkit.entity.Entity;%0A%0Aimport java.lang.ref.WeakReference;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Apublic abstract class CompoundEntityAction extends CompoundAction%0A%7B%0A    protected boolean targetSelf;%0A    private List%3CWeakReference%3CEntity%3E%3E entities = new ArrayList%3CWeakReference%3CEntity%3E%3E();%0A    private int currentEntity = 0;%0A    private CastContext actionContext;%0A%0A    public abstract void prepareEntities(CastContext context, ConfigurationSection parameters, List%3CWeakReference%3CEntity%3E%3E entities);%0A%0A    @Override%0A    public void prepare(CastContext context, ConfigurationSection parameters)%0A    %7B%0A        super.prepare(context, parameters);%0A        targetSelf = parameters.getBoolean(%22target_self%22, false);%0A        entities.clear();%0A        prepareEntities(context, parameters, entities);%0A    %7D%0A%0A    @Override%0A    public void reset(CastContext context)%0A    %7B%0A        super.reset(context);%0A        actionContext = createContext(context);%0A        currentEntity = 0;%0A    %7D%0A%0A%09@Override%0A    public SpellResult perform(CastContext context)%0A%09%7B%0A        SpellResult result = SpellResult.NO_TARGET;%0A        while (currentEntity %3C entities.size())%0A        %7B%0A            Entity entity = entities.get(currentEntity).get();%0A            if (entity == null)%0A            %7B%0A                skippedActions(context);%0A                continue;%0A            %7D%0A            actionContext.setTargetEntity(entity);%0A            actionContext.setTargetLocation(entity.getLocation());%0A            SpellResult entityResult = performActions(actionContext);%0A            result = result.min(entityResult);%0A            if (entityResult == SpellResult.PENDING) %7B%0A                break;%0A            %7D%0A            currentEntity++;%0A            if (currentEntity %3C entities.size())%0A            %7B%0A                super.reset(context);%0A            %7D%0A        %7D%0A%0A%09%09return result;%0A%09%7D%0A%0A    @Override%0A    public void getParameterNames(Collection%3CString%3E parameters) %7B%0A        super.getParameterNames(parameters);%0A        parameters.add(%22target_self%22);%0A    %7D%0A%0A    @Override%0A    public void getParameterOptions(Collection%3CString%3E examples, String parameterKey) %7B%0A        if (parameterKey.equals(%22target_self%22)) %7B%0A            examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_BOOLEANS)));%0A        %7D%0A    %7D%0A%0A    @Override%0A    public Object clone()%0A    %7B%0A        CompoundEntityAction action = (CompoundEntityAction)super.clone();%0A        if (action != null) %7B%0A            action.entities = new ArrayList%3CWeakReference%3CEntity%3E%3E(this.entities);%0A        %7D%0A        return action;%0A    %7D%0A%7D%0A

Add CompoundEntity base action