Class APPARATE
java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.APPARATE
Apparition code for players who have over 100 uses in apparition.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe maximum apparate distance, value less than or equal 0 means no limitFields inherited from class net.pottercraft.ollivanders2.spell.O2Spell
branch, cooldownMessage, defaultRadius, flavorText, isAllowedFailureMessage, location, maxProjectileDistance, maxSpellLifetime, noProjectile, player, rightWand, spellMasteryLevel, spellType, text, usesModifier, vector -
Constructor Summary
ConstructorsConstructorDescriptionAPPARATE(@NotNull Ollivanders2 plugin, @NotNull org.bukkit.entity.Player player, @NotNull Double rightWand, @NotNull String[] wordsArray) Constructor.APPARATE(Ollivanders2 plugin) Default constructor for use in generating spell text. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddLocation(@NotNull String name, @NotNull org.bukkit.World world, double x, double y, double z) Add an apparate locationvoidTeleport the caster to the location, or close to it, depending on skill levelstatic voidClears all apparate locationsprotected voidSpell-specific effects and behavior executed each game tick.static booleandoesLocationExist(@NotNull String name) Check if a named apparate location exists.Return a map of all apparate locations@Nullable org.bukkit.LocationgetLocationByName(@NotNull String name) Return an apparate location by namestatic voidlistApparateLocations(@NotNull org.bukkit.entity.Player player) List all apparate locationsstatic voidLoad all saved apparate locationsstatic voidremoveLocation(@NotNull String name) Remove an apparate locationstatic voidSave all apparate locationsMethods inherited from class net.pottercraft.ollivanders2.spell.O2Spell
getCloseEntities, getCoolDown, getFailureMessage, getFlavorText, getLevel, getLifeTicks, getMagicBranch, getName, getNearbyDamageableEntities, getNearbyItems, getNearbyLivingEntities, getNearbyPlayers, getSuccessMessage, getTargetBlock, getText, getWorldGuardFlags, hasHitTarget, isAtMaxDistance, isKilled, isSpellAllowed, kill, move, revert, sendFailureMessage, sendSuccessMessage, setUsesModifier
-
Field Details
-
maxApparateDistance
public static int maxApparateDistanceThe maximum apparate distance, value less than or equal 0 means no limit
-
-
Constructor Details
-
APPARATE
Default constructor for use in generating spell text. Do not use to cast the spell.- Parameters:
plugin- the Ollivanders2 plugin
-
APPARATE
public APPARATE(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand, @NotNull @NotNull String[] wordsArray) Constructor.- Parameters:
plugin- a callback to the MC pluginplayer- the player who cast this spellrightWand- which wand the player was usingwordsArray- the arguments to the apparate spell
-
-
Method Details
-
checkEffect
public void checkEffect()Teleport the caster to the location, or close to it, depending on skill level- Overrides:
checkEffectin classO2Spell
-
listApparateLocations
public static void listApparateLocations(@NotNull @NotNull org.bukkit.entity.Player player) List all apparate locations- Parameters:
player- player to display the list to
-
addLocation
public static boolean addLocation(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.World world, double x, double y, double z) Add an apparate location- Parameters:
name- the name of the location to addworld- the location worldx- x-coordinatey- y-coordinatez- z-coordinate- Returns:
- true if successfully added, false otherwise
-
removeLocation
Remove an apparate location- Parameters:
name- the name of the location to remove
-
doesLocationExist
Check if a named apparate location exists.- Parameters:
name- the location name- Returns:
- true if it exists in the list, false otherwise
-
getLocationByName
Return an apparate location by name- Parameters:
name- the location name- Returns:
- the location if found, null otherwise
-
getAllApparateLocations
Return a map of all apparate locations- Returns:
- a map of all apparate locations
-
clearApparateLocations
public static void clearApparateLocations()Clears all apparate locations -
saveApparateLocations
public static void saveApparateLocations()Save all apparate locations -
loadApparateLocations
Load all saved apparate locations- Parameters:
p- a callback to the plugin
-
doCheckEffect
protected void doCheckEffect()Description copied from class:O2SpellSpell-specific effects and behavior executed each game tick.Called each tick from
O2Spell.checkEffect()after validation and movement logic. Subclasses must override this method to implement the spell's unique effects such as damage, block changes, particle effects, or other gameplay mechanics.- Specified by:
doCheckEffectin classO2Spell
-