@@ -0,0 +1,1971 @@
+package com.elmakers.mine.bukkit.action.builtin;%0A%0Aimport com.elmakers.mine.bukkit.action.CompoundAction;%0Aimport com.elmakers.mine.bukkit.api.action.ActionHandler;%0Aimport com.elmakers.mine.bukkit.api.action.CastContext;%0Aimport com.elmakers.mine.bukkit.api.spell.SpellResult;%0Aimport com.elmakers.mine.bukkit.api.wand.Wand;%0Aimport org.bukkit.configuration.ConfigurationSection;%0A%0Apublic class CheckManaAction extends CompoundAction %7B%0A    private boolean requireNotFull = false;%0A    private boolean requireEmpty = false;%0A    private double requireAmount = 0;%0A%0A    @Override%0A    public void prepare(CastContext context, ConfigurationSection parameters) %7B%0A        super.prepare(context, parameters);%0A        requireAmount = parameters.getDouble(%22require_mana%22, 0);%0A        requireNotFull = parameters.getBoolean(%22require_mana_not_full%22, false);%0A        requireEmpty = parameters.getBoolean(%22require_mana_empty%22, false);%0A    %7D%0A%0A    protected boolean isAllowed(CastContext context) %7B%0A        Wand wand = context.getWand();%0A        if (wand == null) %7B%0A            return false;%0A        %7D%0A        double currentMana = wand.getMana();%0A        if (requireAmount %3E 0 && currentMana %3C requireAmount) %7B%0A            return false;%0A        %7D%0A        if (requireEmpty && currentMana %3E 0) %7B%0A            return false;%0A        %7D%0A        int manaMax = wand.getManaMax();%0A        if (requireNotFull && currentMana %3E= manaMax) %7B%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A    %0A    @Override%0A    public SpellResult step(CastContext context) %7B%0A        boolean allowed = isAllowed(context);%0A        ActionHandler actions = getHandler(%22actions%22);%0A        if (actions == null %7C%7C actions.size() == 0) %7B%0A            return allowed ? SpellResult.CAST : SpellResult.STOP;%0A        %7D%0A        %0A        if (!allowed) %7B%0A            return SpellResult.NO_TARGET;%0A        %7D%0A        return startActions();%0A    %7D%0A%0A    @Override%0A    public boolean requiresTarget() %7B%0A        return false;%0A    %7D%0A%7D

Add CheckMana action, for stopping a spell if mana does not meet some requirements (empty, full, certain amount)