Search in sources :

Example 1 with ActionBatch

use of com.elmakers.mine.bukkit.batch.ActionBatch in project MagicPlugin by elBukkit.

the class ActionHandler method start.

public SpellResult start(CastContext context, ConfigurationSection parameters) {
    prepare(context, parameters);
    reset(context);
    SpellResult handlerResult = perform(context);
    if (handlerResult == SpellResult.PENDING) {
        ActionBatch batch = new ActionBatch(context, this);
        if (!context.getMage().addBatch(batch)) {
            handlerResult = SpellResult.FAIL;
            finish(context);
            context.finish();
        }
    } else {
        finish(context);
        context.finish();
    }
    return handlerResult;
}
Also used : ActionBatch(com.elmakers.mine.bukkit.batch.ActionBatch) SpellResult(com.elmakers.mine.bukkit.api.spell.SpellResult)

Aggregations

SpellResult (com.elmakers.mine.bukkit.api.spell.SpellResult)1 ActionBatch (com.elmakers.mine.bukkit.batch.ActionBatch)1