com.nisovin.MagicSpells
Class CommandSpell

java.lang.Object
  extended by com.nisovin.MagicSpells.Spell
      extended by com.nisovin.MagicSpells.CommandSpell
All Implemented Interfaces:
java.lang.Comparable<Spell>
Direct Known Subclasses:
BindSpell, ForgetSpell, HelpSpell, ListSpell, MarkSpell, RecallSpell, ScrollSpell, SpellbookSpell, TeachSpell, TomeSpell

public abstract class CommandSpell
extends Spell


Nested Class Summary
 
Nested classes/interfaces inherited from class com.nisovin.MagicSpells.Spell
Spell.PostCastAction, Spell.SpellCastState
 
Field Summary
 
Fields inherited from class com.nisovin.MagicSpells.Spell
broadcastRange, castItem, cooldown, cost, description, healthCost, internalName, manaCost, name, strCastOthers, strCastSelf, strCost
 
Constructor Summary
CommandSpell(org.bukkit.util.config.Configuration config, java.lang.String spellName)
           
 
Method Summary
 boolean canCastByCommand()
           
 boolean canCastWithItem()
           
abstract  boolean castFromConsole(org.bukkit.command.CommandSender sender, java.lang.String[] args)
          This method is called when the spell is cast from the console.
 
Methods inherited from class com.nisovin.MagicSpells.Spell
addListener, cast, cast, castSpell, compareTo, formatMessage, getCastItem, getConfigBoolean, getConfigInt, getConfigIntList, getConfigString, getConfigStringList, getCooldown, getCostStr, getDescription, getHealthCost, getInternalName, getManaCost, getName, getReagentCost, hasReagents, hasReagents, hasReagents, initialize, onBlockBreak, onBlockPlace, onCooldown, onEntityCombust, onEntityDamage, onEntityTarget, onExplosionPrime, onItemHeldChange, onPlayerCommandPreprocess, onPlayerInteract, onPlayerJoin, onPlayerMove, onPlayerQuit, onPlayerTeleport, onPlayerToggleSneak, removeListener, removeReagents, removeReagents, removeReagents, sendMessage, sendMessage, sendMessageNear, sendMessageNear, setCooldown, turnOff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandSpell

public CommandSpell(org.bukkit.util.config.Configuration config,
                    java.lang.String spellName)
Method Detail

canCastWithItem

public boolean canCastWithItem()
Specified by:
canCastWithItem in class Spell

canCastByCommand

public boolean canCastByCommand()
Specified by:
canCastByCommand in class Spell

castFromConsole

public abstract boolean castFromConsole(org.bukkit.command.CommandSender sender,
                                        java.lang.String[] args)
Description copied from class: Spell
This method is called when the spell is cast from the console.

Overrides:
castFromConsole in class Spell
Parameters:
sender - the console sender.
args - the command arguments
Returns:
true if the spell was handled, false otherwise