com.nisovin.MagicSpells
Class InstantSpell
java.lang.Object
com.nisovin.MagicSpells.Spell
com.nisovin.MagicSpells.InstantSpell
- All Implemented Interfaces:
- java.lang.Comparable<Spell>
- Direct Known Subclasses:
- BlinkSpell, BuildSpell, CombustSpell, ConfusionSpell, DrainlifeSpell, EntombSpell, ExplodeSpell, FireballSpell, FirenovaSpell, ForcepushSpell, GateSpell, GeyserSpell, HealSpell, LeapSpell, LightningSpell, PainSpell, PrayerSpell, PurgeSpell, RepairSpell, TelekinesisSpell, VolleySpell, WallSpell, ZapSpell
public abstract class InstantSpell
- extends Spell
|
Field Summary |
protected int |
range
|
| Fields inherited from class com.nisovin.MagicSpells.Spell |
broadcastRange, castItem, cooldown, cost, description, healthCost, internalName, manaCost, name, strCastOthers, strCastSelf, strCost |
|
Constructor Summary |
InstantSpell(org.bukkit.util.config.Configuration config,
java.lang.String spellName)
|
|
Method Summary |
boolean |
canCastByCommand()
|
boolean |
canCastWithItem()
|
protected org.bukkit.entity.LivingEntity |
getTargetedEntity(org.bukkit.entity.Player player,
int range,
boolean targetPlayers,
boolean checkLos)
Gets the living entity a player is currently looking at |
protected org.bukkit.entity.Player |
getTargetedPlayer(org.bukkit.entity.Player player,
int range,
boolean checkLos)
Gets the player a player is currently looking at, ignoring other living entities |
protected boolean |
inRange(org.bukkit.Location loc1,
org.bukkit.Location loc2,
int range)
Checks whether two locations are within a certain distance from each other. |
| 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, 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 |
range
protected int range
InstantSpell
public InstantSpell(org.bukkit.util.config.Configuration config,
java.lang.String spellName)
canCastWithItem
public boolean canCastWithItem()
- Specified by:
canCastWithItem in class Spell
canCastByCommand
public boolean canCastByCommand()
- Specified by:
canCastByCommand in class Spell
inRange
protected boolean inRange(org.bukkit.Location loc1,
org.bukkit.Location loc2,
int range)
- Checks whether two locations are within a certain distance from each other.
- Parameters:
loc1 - The first locationloc2 - The second locationrange - The maximum distance
- Returns:
- true if the distance is less than the range, false otherwise
getTargetedEntity
protected org.bukkit.entity.LivingEntity getTargetedEntity(org.bukkit.entity.Player player,
int range,
boolean targetPlayers,
boolean checkLos)
- Gets the living entity a player is currently looking at
- Parameters:
player - player to get target forrange - the maximum range to checktargetPlayers - whether to allow players as targetscheckLos - whether to obey line-of-sight restrictions
- Returns:
- the targeted LivingEntity, or null if none was found
getTargetedPlayer
protected org.bukkit.entity.Player getTargetedPlayer(org.bukkit.entity.Player player,
int range,
boolean checkLos)
- Gets the player a player is currently looking at, ignoring other living entities
- Parameters:
player - the player to get the target forrange - the maximum range to checkcheckLos - whether to obey line-of-sight restrictions
- Returns:
- the targeted Player, or null if none was found