com.nisovin.MagicSpells
Class ChanneledSpell
java.lang.Object
com.nisovin.MagicSpells.Spell
com.nisovin.MagicSpells.ChanneledSpell
- All Implemented Interfaces:
- java.lang.Comparable<Spell>
- Direct Known Subclasses:
- SummonSpell, SunSpell
public abstract class ChanneledSpell
- extends Spell
| Fields inherited from class com.nisovin.MagicSpells.Spell |
broadcastRange, castItem, cooldown, cost, description, healthCost, internalName, manaCost, name, strCastOthers, strCastSelf, strCost |
|
Constructor Summary |
ChanneledSpell(org.bukkit.util.config.Configuration config,
java.lang.String spellName)
|
|
Method Summary |
protected boolean |
addChanneler(java.lang.String key,
org.bukkit.entity.Player player)
Adds a player to the list of channelers for the channeling "session" defined by the provided key. |
boolean |
canCastByCommand()
|
boolean |
canCastWithItem()
|
protected abstract void |
finishSpell(java.lang.String key,
org.bukkit.Location location)
This method is called when the number of channelers for the session meets the required amount, and the spell is ready to perform its action. |
protected int |
getChannelerCount(java.lang.String key)
Gets the current number of channelers for the specified channeling "session" |
void |
onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event)
|
void |
onPlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
|
| Methods inherited from class com.nisovin.MagicSpells.Spell |
addListener, cast, cast, castFromConsole, 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, 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 |
ChanneledSpell
public ChanneledSpell(org.bukkit.util.config.Configuration config,
java.lang.String spellName)
addChanneler
protected boolean addChanneler(java.lang.String key,
org.bukkit.entity.Player player)
- Adds a player to the list of channelers for the channeling "session" defined by the provided key.
- Parameters:
key - the name of the channeling sessionplayer - the player to add as a channeler
- Returns:
- whether the player was added to the list of channelers (can return false if the player was out of range, for example)
getChannelerCount
protected int getChannelerCount(java.lang.String key)
- Gets the current number of channelers for the specified channeling "session"
- Parameters:
key - the channeling session name
- Returns:
- the number of channelers for the session
finishSpell
protected abstract void finishSpell(java.lang.String key,
org.bukkit.Location location)
- This method is called when the number of channelers for the session meets the required amount, and the spell is ready to perform its action.
- Parameters:
key - the name of the channeling sessionlocation - the location of the first channeling player
canCastWithItem
public boolean canCastWithItem()
- Specified by:
canCastWithItem in class Spell
canCastByCommand
public boolean canCastByCommand()
- Specified by:
canCastByCommand in class Spell
onPlayerMove
public final void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event)
- Overrides:
onPlayerMove in class Spell
onPlayerQuit
public final void onPlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
- Overrides:
onPlayerQuit in class Spell