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.block.MaterialBrush;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import org.bukkit.block.Block;

public class CheckBlockAction extends BaseSpellAction {
    @SuppressWarnings("deprecation")
    @Override
    public SpellResult perform(CastContext context) {
        MaterialBrush brush = context.getBrush();
        Block block = context.getTargetBlock();
        if (brush != null && brush.isErase()) {
            if (!context.hasBreakPermission(block)) {
                return SpellResult.STOP;
            }
        } else {
            if (!context.hasBuildPermission(block)) {
                return SpellResult.STOP;
            }
        }
        if (!context.isDestructible(block)) {
            return SpellResult.STOP;
        }
        return SpellResult.CAST;
    }

    @Override
    public boolean requiresTarget() {
        return true;
    }
}
@@ -263,103 +263,535 @@
 pell
-Result;%0Aimport org.bukkit.block.Block;%0A%0Apublic class CheckBlockAction extends BaseSpellAction %7B
+;%0Aimport com.elmakers.mine.bukkit.api.spell.SpellResult;%0Aimport org.bukkit.Material;%0Aimport org.bukkit.block.Block;%0Aimport org.bukkit.configuration.ConfigurationSection;%0A%0Aimport java.util.Set;%0A%0Apublic class CheckBlockAction extends BaseSpellAction %7B%0A    private Set%3CMaterial%3E allowed;%0A    %0A    @Override%0A    public void initialize(Spell spell, ConfigurationSection parameters)%0A    %7B%0A        super.initialize(spell, parameters);%0A        allowed = spell.getController().getMaterialSet(parameters.getString(%22allowed%22));%0A    %7D%0A    
 %0A   
@@ -986,24 +986,153 @@
 getBlock();%0A
+        if (allowed != null) %7B%0A            if (!allowed.contains(block.getType())) return SpellResult.STOP;%0A        %7D else %7B%0A    
         if (
@@ -1163,24 +1163,28 @@
 sErase()) %7B%0A
+    
             
@@ -1233,32 +1233,36 @@
                 
+   
+ 
 return SpellResu
@@ -1274,34 +1274,42 @@
 OP;%0A            
-%7D%0A
+    %7D%0A    
         %7D else %7B
@@ -1313,32 +1313,36 @@
 e %7B%0A            
+    
 if (!context.has
@@ -1375,32 +1375,36 @@
                 
+    
 return SpellResu
@@ -1424,26 +1424,33 @@
         
+  
-%7D%0A
+  %7D%0A   
         
 %7D%0A      
@@ -1433,32 +1433,33 @@
    %7D%0A           
+ 
 %7D%0A        if (!c
@@ -1444,32 +1444,36 @@
       %7D%0A        
+   
+ 
 if (!context.isD
@@ -1498,32 +1498,36 @@
 ) %7B%0A            
+    
 return SpellResu
@@ -1527,32 +1527,46 @@
 ellResult.STOP;%0A
+            %7D%0A
         %7D%0A      

Add "allowed" parameter to CheckBlock action