Class HARMONIA_NECTERE_PASSUS
java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.HARMONIA_NECTERE_PASSUS
Creates a pair of vanishing cabinets for teleportation between two locations.
The spell requires two properly configured vanishing cabinet signs. Each sign must contain the world name and XYZ coordinates of the other cabinet on four separate lines. When cast on a sign, the spell creates a pair of stationary vanishing cabinets that allow players to teleport between them.
The spell validates:
- Target block is a sign
- Sign contains valid destination coordinates
- To and from locations are different
- No vanishing cabinet already exists at either location
- See Also:
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionHARMONIA_NECTERE_PASSUS(@NotNull Ollivanders2 plugin, @NotNull org.bukkit.entity.Player player, @NotNull Double rightWand) Constructor.HARMONIA_NECTERE_PASSUS(Ollivanders2 plugin) Default constructor for use in generating spell text. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreate vanishing cabinets when spell hits a valid sign target.Methods inherited from class net.pottercraft.ollivanders2.spell.O2Spell
checkEffect, 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
-
Constructor Details
-
HARMONIA_NECTERE_PASSUS
Default constructor for use in generating spell text. Do not use to cast the spell.- Parameters:
plugin- the Ollivanders2 plugin
-
HARMONIA_NECTERE_PASSUS
public HARMONIA_NECTERE_PASSUS(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand) Constructor.- Parameters:
plugin- a callback to the MC pluginplayer- the player who cast this spellrightWand- which wand the player was using
-
-
Method Details
-
doCheckEffect
protected void doCheckEffect()Create vanishing cabinets when spell hits a valid sign target.Validates the target sign and creates a pair of stationary vanishing cabinets if all requirements are met. Sends appropriate failure messages to the caster if validation fails.
Validation checks:
- Target block is a sign (
O2Spell.getTargetBlock()) - Sign contains valid destination coordinates via
getSignLocation(Block) - From and to locations are different (cannot create self-referential cabinet)
- No stationary vanishing cabinet already exists at either location
If all checks pass, creates two stationary HARMONIA_NECTERE_PASSUS spells (one at each location) that enable bidirectional teleportation.
- Specified by:
doCheckEffectin classO2Spell
- Target block is a sign (
-