package com.elmakers.mine.bukkit.api.event;

import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.magic.Mage;
import com.elmakers.mine.bukkit.api.spell.Spell;
import com.elmakers.mine.bukkit.api.spell.SpellResult;

/**
 * A custom event that the Magic plugin will fire any time a
 * Mage casts a Spell.
 */
public class CastEvent extends Event {
    private final CastContext context;

    private static final HandlerList handlers = new HandlerList();

    public CastEvent(CastContext context) {
        this.context = context;
    }

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

    public Mage getMage() {
        return context.getMage();
    }

    public Spell getSpell() {
        return context.getSpell();
    }

    public CastContext getContext() {
        return context;
    }

    public SpellResult getSpellResult() {
        return context.getResult();
    }
}

@@ -555,16 +555,230 @@
 ist();%0A%0A
+    public CastEvent(Mage mage, Spell spell, SpellResult result) %7B%0A        throw new IllegalArgumentException(%22Please create a CastEvent with CastContext now .. but also why are you creating a CastEvent?%22);%0A    %7D%0A%0A
     publ

Add back in previous constructor to make revapi happy, but no one should really be creating these anyway