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

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

public class LightningAction extends BaseSpellAction {
    public SpellResult perform(CastContext context)
    {
        Block block = context.getTargetBlock();
        if (!context.hasBuildPermission(block))
        {
            return SpellResult.INSUFFICIENT_PERMISSION;
        }
        block.getWorld().strikeLightning(block.getLocation());
        return SpellResult.CAST;
    }

    @Override
    public boolean isUndoable()
    {
        return false;
    }

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

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

@@ -240,16 +240,70 @@
 k.Block;
+%0Aimport org.bukkit.configuration.ConfigurationSection;
 %0A%0Apublic
@@ -360,109 +360,477 @@
    p
-ublic SpellResult perform(CastContext context)%0A    %7B%0A        Block block = context.getTargetBlock();%0A
+rivate boolean effectOnly;%0A%0A    @Override%0A    public void prepare(CastContext context, ConfigurationSection parameters)%0A    %7B%0A        super.prepare(context, parameters);%0A        effectOnly = parameters.getBoolean(%22effect_only%22, false);%0A    %7D%0A%0A    public SpellResult perform(CastContext context)%0A    %7B%0A        Block block = context.getTargetBlock();%0A        if (effectOnly) %7B%0A            block.getWorld().strikeLightningEffect(block.getLocation());%0A        %7D else %7B%0A    
     
@@ -877,26 +877,34 @@
 k))%0A        
+  
-%7B%0A
+  %7B%0A    
             
@@ -959,18 +959,24 @@
     
-%7D%0A
+    %7D%0A  
         
 bloc
@@ -963,32 +963,34 @@
     %7D%0A          
+  
 block.getWorld()
@@ -1020,32 +1020,42 @@
 getLocation());%0A
+        %7D%0A
         return S
@@ -1231,36 +1231,43 @@
 %0A        return 
-true
+!effectOnly
 ;%0A    %7D%0A%0A    @Ov

Add effect_only parameter to Lightning action