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

/**
 * Every Spell will return a SpellResult when cast. This result
 * will determine the messaging and effects used, as well as whether 
 * or not the Spell cast consumes its CastingCost costs. 
 * 
 * A Spell that fails to cast will not consume costs or register for cooldown.
 */
public enum SpellResult {
    CAST,
    AREA,
    FIZZLE,
    BACKFIRE,
    CURSED,
    FAIL,
    CANCEL,
    EVENT_CANCELLED,
    INSUFFICIENT_RESOURCES,
    INSUFFICIENT_PERMISSION,
    COOLDOWN,
    NO_TARGET,
    RESTRICTED,
    TARGET_SELECTED,
    ENTITY_REQUIRED,
    LIVING_ENTITY_REQUIRED,
    PLAYER_REQUIRED,
    LOCATION_REQUIRED,
    WORLD_REQUIRED,
    INVALID_WORLD,
    COST_FREE;

    /**
     * Determine if this result is a success or not.
     *
     * @return True if this cast was a success.
     */
    public boolean isSuccess() {
        return this == CAST || this == AREA || this == FIZZLE || this == BACKFIRE;
    }
}

@@ -347,16 +347,51 @@
 esult %7B%0A
+    // Cast should always be first%0A
     CAST
@@ -392,16 +392,17 @@
   CAST,%0A
+%0A
     AREA
@@ -752,16 +752,66 @@
 OST_FREE
+,%0A%0A    // This should always be last%0A    NO_ACTION
 ;%0A%0A    /
@@ -962,16 +962,16 @@
 ess() %7B%0A
-
         
@@ -1050,11 +1050,132 @@
 E;%0A    %7D
+%0A%0A    public SpellResult min(SpellResult other) %7B%0A        return (this.ordinal() %3C other.ordinal()) ? this : other;%0A    %7D
 %0A%7D%0A

Add SpellResult.NO_ACTION, which should never actually show up.