Class ABERTO
java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.ABERTO
Opening charm that unlocks and opens doors and trapdoors.
When cast at a door or trapdoor, the spell sets the block's Openable state to open. The spell fails if:
- The target block is not a door or trapdoor
- The door is protected by a COLLOPORTUS stationary spell (magical lock)
Note: Doors requiring continuous power to remain open (such as iron doors) will open momentarily but close again immediately when the redstone power applies. This is Minecraft's standard behavior, not a limitation of the spell.
World Guard: Requires the INTERACT flag when WorldGuard is enabled.
- Since:
- 2.21
- 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
ConstructorsConstructorDescriptionABERTO(@NotNull Ollivanders2 plugin, @NotNull org.bukkit.entity.Player player, @NotNull Double rightWand) Constructor.ABERTO(Ollivanders2 plugin) Default constructor for use in generating spell text. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidOpen the target door or trapdoor when the spell hits.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
-
ABERTO
Default constructor for use in generating spell text. Do not use to cast the spell.- Parameters:
plugin- the Ollivanders2 plugin
-
ABERTO
public ABERTO(@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()Open the target door or trapdoor when the spell hits.Validates that the target is a door, checks for COLLOPORTUS protection, and if all checks pass, sets the door's Openable state to true. Sends a failure message if the target is not a door or if a COLLOPORTUS stationary spell protects the door.
- Specified by:
doCheckEffectin classO2Spell
-