java.lang.Object
net.pottercraft.ollivanders2.stationaryspell.O2StationarySpell
net.pottercraft.ollivanders2.stationaryspell.COLLOPORTUS
All Implemented Interfaces:
Serializable

public class COLLOPORTUS extends O2StationarySpell
A stationary locking spell that prevents access to doors, trapdoors, and chests.

The Colloportus charm (Locking Spell) creates a protective barrier that prevents entities from opening, breaking, or interacting with doors, trapdoors, and chests within the spell's protected area. The spell is permanent and cannot be dispelled by normal means. Any attempt to open or break a protected door or trapdoor will fail silently.

Spell characteristics:

  • Radius: 5 blocks (fixed)
  • Duration: Permanent (cannot be dispelled)
  • Effect: Prevents opening/breaking doors, trapdoors, and chests within the protected area
Since:
2.21
See Also:
  • Field Details

    • minRadiusConfig

      public static final int minRadiusConfig
      Minimum spell radius (5 blocks).
      See Also:
    • maxRadiusConfig

      public static final int maxRadiusConfig
      Maximum spell radius (5 blocks).
      See Also:
    • minDurationConfig

      public static final int minDurationConfig
      Minimum spell duration (not used - colloportus is permanent).
      See Also:
    • maxDurationConfig

      public static final int maxDurationConfig
      Maximum spell duration (not used - colloportus is permanent).
      See Also:
  • Constructor Details

    • COLLOPORTUS

      public COLLOPORTUS(@NotNull @NotNull Ollivanders2 plugin)
      Simple constructor used for deserializing saved stationary spells at server start. Do not use to cast spell.
      Parameters:
      plugin - a callback to the MC plugin
    • COLLOPORTUS

      public COLLOPORTUS(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull UUID pid, @NotNull @NotNull org.bukkit.Location location)
      Constructs a new COLLOPORTUS spell cast by a player.

      Creates a colloportus charm at the specified location. The spell prevents opening and breaking of doors, trapdoors, and chests within a 5-block radius.

      Parameters:
      plugin - a callback to the MC plugin (not null)
      pid - the UUID of the player who cast the spell (not null)
      location - the center location of the spell (not null)
  • Method Details

    • upkeep

      public void upkeep()
      No upkeep for this spell
      Specified by:
      upkeep in class O2StationarySpell
    • serializeSpellData

      @NotNull public @NotNull Map<String,String> serializeSpellData()
      Serializes the colloportus spell data for persistence.

      The colloportus spell has no extra data to serialize beyond the base spell properties, so this method returns an empty map.

      Returns:
      an empty map (the spell has no custom data to serialize)
    • deserializeSpellData

      public void deserializeSpellData(@NotNull @NotNull Map<String,String> spellData)
      Deserializes colloportus spell data from saved state.

      The colloportus spell has no extra data to deserialize, so this method does nothing.

      Parameters:
      spellData - the serialized spell data map (not used)