package com.elmakers.mine.bukkit.action.builtin;

import com.elmakers.mine.bukkit.action.CompoundAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;

public class CoverAction extends CompoundAction
{
	@Override
	public SpellResult step(CastContext context) {
        Block targetBlock = context.getTargetBlock();
        targetBlock = context.findSpaceAbove(targetBlock);
        targetBlock = context.findBlockUnder(targetBlock);
        Block coveringBlock = targetBlock.getRelative(BlockFace.UP);
        if (context.isTransparent(targetBlock.getType()) || !context.isTransparent(coveringBlock.getType())) {
            skippedActions(context);
            return SpellResult.NO_TARGET;
        }
        actionContext.setTargetLocation(targetBlock.getLocation());
        return startActions();
	}

    @Override
    public boolean requiresTarget() {
        return true;
    }
}

@@ -279,58 +279,369 @@
 ce;%0A
-%0Apublic class CoverAction extends CompoundAction%0A%7B
+import org.bukkit.configuration.ConfigurationSection;%0A%0Apublic class CoverAction extends CompoundAction%0A%7B%0A    protected boolean targetAbove = false;%0A%0A    @Override%0A    public void prepare(CastContext context, ConfigurationSection parameters) %7B%0A        super.prepare(context, parameters);%0A        targetAbove = parameters.getBoolean(%22target_above%22, false);%0A    %7D%0A
 %0A%09@O
@@ -1137,16 +1137,138 @@
       %7D%0A
+        if (targetAbove) %7B%0A            actionContext.setTargetLocation(coveringBlock.getLocation());%0A        %7D else %7B%0A    
         
@@ -1319,32 +1319,42 @@
 getLocation());%0A
+        %7D%0A
         return s

Add target_above option to Cover action