com.nisovin.MagicSpells
Class MagicSpells

java.lang.Object
  extended by org.bukkit.plugin.java.JavaPlugin
      extended by com.nisovin.MagicSpells.MagicSpells
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.plugin.Plugin

public class MagicSpells
extends org.bukkit.plugin.java.JavaPlugin


Field Summary
protected static int broadcastRange
           
static java.util.List<java.lang.String> castForFree
           
protected static java.util.List<java.lang.String> castNoCooldown
           
protected static boolean debug
           
protected static boolean enableManaBars
           
protected static boolean ignoreDefaultBindings
           
protected static java.util.HashMap<org.bukkit.event.Event.Type,java.util.HashSet<Spell>> listeners
           
protected static java.util.List<java.lang.Integer> losTransparentBlocks
           
protected static ManaBarManager mana
           
protected static org.bukkit.ChatColor manaBarColorEmpty
           
protected static org.bukkit.ChatColor manaBarColorFull
           
protected static java.lang.String manaBarPrefix
           
protected static int manaBarSize
           
protected static int manaBarToolSlot
           
protected static int manaPotionCooldown
           
protected static java.util.HashMap<org.bukkit.entity.Player,java.lang.Long> manaPotionCooldowns
           
protected static java.util.HashMap<org.bukkit.material.MaterialData,java.lang.Integer> manaPotions
           
protected static int manaRegenPercent
           
protected static int manaRegenTickRate
           
protected static int maxMana
           
protected static NoMagicZoneManager noMagicZones
           
protected static boolean opsHaveAllSpells
           
static MagicSpells plugin
           
protected static boolean showManaOnRegen
           
protected static boolean showManaOnUse
           
protected static boolean showManaOnWoodTool
           
protected static java.util.HashMap<java.lang.String,Spellbook> spellbooks
           
protected static java.util.HashMap<java.lang.String,Spell> spellNames
           
protected static java.util.HashMap<java.lang.String,Spell> spells
           
protected static java.lang.String strCantCast
           
protected static java.lang.String strCastUsage
           
static java.lang.String strConsoleName
           
protected static java.lang.String strManaPotionOnCooldown
           
static java.lang.String strMissingReagents
           
protected static java.lang.String strNoMagicZone
           
protected static java.lang.String strOnCooldown
           
protected static java.lang.String strSpellChange
           
protected static java.lang.String strUnknownSpell
           
protected static org.bukkit.ChatColor textColor
           
 
Constructor Summary
MagicSpells()
           
 
Method Summary
protected static void addSpellListener(org.bukkit.event.Event.Type eventType, Spell spell)
           
static void debug(java.lang.String message)
          Writes a debug message to the console if the debug option is enabled.
static MagicSpells getInstance()
          Gets the instance of the MagicSpells plugin
static Spellbook getSpellbook(org.bukkit.entity.Player player)
          Gets a player's spellbook, which contains known spells and handles spell permissions.
static Spell getSpellByInGameName(java.lang.String spellName)
          Gets a spell by its in-game name (the name specified with the 'name' config option)
static Spell getSpellByInternalName(java.lang.String spellName)
          Gets a spell by its internal name (the key name in the config file)
 boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, java.lang.String label, java.lang.String[] args)
           
 void onDisable()
           
 void onEnable()
           
protected static void removeSpellListener(org.bukkit.event.Event.Type eventType, Spell spell)
           
static boolean teachSpell(org.bukkit.entity.Player player, java.lang.String spellName)
          Teaches a player a spell (adds it to their spellbook)
 
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfiguration, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getPluginLoader, getServer, initialize, installDDL, isEnabled, isInitialized, isNaggable, onLoad, removeDDL, setEnabled, setNaggable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

plugin

public static MagicSpells plugin

debug

protected static boolean debug

textColor

protected static org.bukkit.ChatColor textColor

broadcastRange

protected static int broadcastRange

opsHaveAllSpells

protected static boolean opsHaveAllSpells

castForFree

public static java.util.List<java.lang.String> castForFree

castNoCooldown

protected static java.util.List<java.lang.String> castNoCooldown

ignoreDefaultBindings

protected static boolean ignoreDefaultBindings

losTransparentBlocks

protected static java.util.List<java.lang.Integer> losTransparentBlocks

enableManaBars

protected static boolean enableManaBars

maxMana

protected static int maxMana

manaBarPrefix

protected static java.lang.String manaBarPrefix

manaBarSize

protected static int manaBarSize

manaBarColorFull

protected static org.bukkit.ChatColor manaBarColorFull

manaBarColorEmpty

protected static org.bukkit.ChatColor manaBarColorEmpty

manaRegenTickRate

protected static int manaRegenTickRate

manaRegenPercent

protected static int manaRegenPercent

showManaOnUse

protected static boolean showManaOnUse

showManaOnRegen

protected static boolean showManaOnRegen

showManaOnWoodTool

protected static boolean showManaOnWoodTool

manaBarToolSlot

protected static int manaBarToolSlot

manaPotionCooldown

protected static int manaPotionCooldown

strManaPotionOnCooldown

protected static java.lang.String strManaPotionOnCooldown

manaPotions

protected static java.util.HashMap<org.bukkit.material.MaterialData,java.lang.Integer> manaPotions

strCastUsage

protected static java.lang.String strCastUsage

strUnknownSpell

protected static java.lang.String strUnknownSpell

strSpellChange

protected static java.lang.String strSpellChange

strOnCooldown

protected static java.lang.String strOnCooldown

strMissingReagents

public static java.lang.String strMissingReagents

strCantCast

protected static java.lang.String strCantCast

strNoMagicZone

protected static java.lang.String strNoMagicZone

strConsoleName

public static java.lang.String strConsoleName

spells

protected static java.util.HashMap<java.lang.String,Spell> spells

spellNames

protected static java.util.HashMap<java.lang.String,Spell> spellNames

spellbooks

protected static java.util.HashMap<java.lang.String,Spellbook> spellbooks

listeners

protected static java.util.HashMap<org.bukkit.event.Event.Type,java.util.HashSet<Spell>> listeners

mana

protected static ManaBarManager mana

manaPotionCooldowns

protected static java.util.HashMap<org.bukkit.entity.Player,java.lang.Long> manaPotionCooldowns

noMagicZones

protected static NoMagicZoneManager noMagicZones
Constructor Detail

MagicSpells

public MagicSpells()
Method Detail

onEnable

public void onEnable()

addSpellListener

protected static void addSpellListener(org.bukkit.event.Event.Type eventType,
                                       Spell spell)

removeSpellListener

protected static void removeSpellListener(org.bukkit.event.Event.Type eventType,
                                          Spell spell)

onCommand

public boolean onCommand(org.bukkit.command.CommandSender sender,
                         org.bukkit.command.Command command,
                         java.lang.String label,
                         java.lang.String[] args)
Specified by:
onCommand in interface org.bukkit.command.CommandExecutor
Overrides:
onCommand in class org.bukkit.plugin.java.JavaPlugin

getInstance

public static MagicSpells getInstance()
Gets the instance of the MagicSpells plugin

Returns:
the MagicSpells plugin

getSpellByInternalName

public static Spell getSpellByInternalName(java.lang.String spellName)
Gets a spell by its internal name (the key name in the config file)

Parameters:
spellName - the internal name of the spell to find
Returns:
the Spell found, or null if no spell with that name was found

getSpellByInGameName

public static Spell getSpellByInGameName(java.lang.String spellName)
Gets a spell by its in-game name (the name specified with the 'name' config option)

Parameters:
spellName - the in-game name of the spell to find
Returns:
the Spell found, or null if no spell with that name was found

getSpellbook

public static Spellbook getSpellbook(org.bukkit.entity.Player player)
Gets a player's spellbook, which contains known spells and handles spell permissions. If a player does not have a spellbook, one will be created.

Parameters:
player - the player to get a spellbook for
Returns:
the player's spellbook

debug

public static void debug(java.lang.String message)
Writes a debug message to the console if the debug option is enabled.

Parameters:
message - the message to write to the console

teachSpell

public static boolean teachSpell(org.bukkit.entity.Player player,
                                 java.lang.String spellName)
Teaches a player a spell (adds it to their spellbook)

Parameters:
player - the player to teach
spellName - the spell name, either the in-game name or the internal name
Returns:
whether the spell was taught to the player

onDisable

public void onDisable()