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

import java.util.ArrayList;
import java.util.Collection;

import org.bukkit.configuration.ConfigurationSection;

import com.elmakers.mine.bukkit.action.CheckAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.requirements.Requirement;
import com.elmakers.mine.bukkit.utility.ConfigurationUtils;

public class CheckRequirementsAction extends CheckAction {
    private Collection<Requirement> requirements;

    @Override
    public void prepare(CastContext context, ConfigurationSection parameters)
    {
        super.prepare(context, parameters);
        requirements = new ArrayList<>();
        Collection<ConfigurationSection> requirementConfigurations = ConfigurationUtils.getNodeList(parameters, "requirements");
        if (requirementConfigurations != null) {
            for (ConfigurationSection requirementConfiguration : requirementConfigurations) {
                requirements.add(new Requirement(requirementConfiguration));
            }
        }
    }

    @Override
    protected boolean isAllowed(CastContext context) {
        return context.getController().checkRequirements(context, requirements) == null;
    }
}

@@ -495,16 +495,49 @@
 rements;
+%0A    private boolean sendMessage;
 %0A%0A    @O
@@ -672,16 +672,77 @@
 eters);%0A
+        sendMessage = parameters.getBoolean(%22send_message%22);%0A
         
@@ -1236,14 +1236,24 @@
     
-return
+String message =
  con
@@ -1313,16 +1313,148 @@
 rements)
+;%0A        if (sendMessage && message != null) %7B%0A            context.getMage().sendMessage(message);%0A        %7D%0A        return message
  == null

Add send_message option to CheckRequirements