Class ABERTO

java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.ABERTO

public class ABERTO extends O2Spell
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:
  • Constructor Details

    • ABERTO

      public ABERTO(Ollivanders2 plugin)
      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 plugin
      player - the player who cast this spell
      rightWand - 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:
      doCheckEffect in class O2Spell