Class ALIQUAM_FLOO

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

public class ALIQUAM_FLOO extends O2StationarySpell
A stationary spell that transforms a fireplace into a Floo Network connection point.

The Aliquam Floo spell enables magical teleportation between registered floo network locations. Players throw floo powder into the fireplace to activate it, then speak a destination name to teleport. If the destination name is not recognized, the player is randomly sent to another floo location.

Spell characteristics:

  • Fixed radius of 2 blocks (hardcoded, cannot be modified)
  • Permanent spell (never expires unless killed)
  • Activates when floo powder is thrown into the center fireplace block
  • 30-second active window for player to speak destination and teleport
  • Visual effects: legacy mob spawner flames or soul fire (configurable)
  • Prevents fire and combustion damage within the protected area

All active floo locations are registered in a static network list for teleportation discovery.

See Also:
  • Field Details

    • minRadiusConfig

      public static final int minRadiusConfig
      Minimum spell radius (2 blocks, hardcoded and cannot be changed).
      See Also:
    • maxRadiusConfig

      public static final int maxRadiusConfig
      Maximum spell radius (2 blocks, hardcoded and cannot be changed).
      See Also:
    • minDurationConfig

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

      public static final int maxDurationConfig
      Maximum spell duration in ticks (not used - ALIQUAM_FLOO is permanent).
      See Also:
    • successMessage

      public static final String successMessage
      Message sent to player when the floo event happens successfully
      See Also:
    • cancelledMessage

      public static final String cancelledMessage
      Message sent to player when the floo event is cancelled
      See Also:
  • Constructor Details

    • ALIQUAM_FLOO

      public ALIQUAM_FLOO(@NotNull @NotNull Ollivanders2 plugin)
      Constructs an ALIQUAM_FLOO spell from deserialized data at server startup.

      Used only for loading saved spells from disk. Registers this floo location in the network and loads visual effect configuration. Do not use to cast new spells - use the full constructor instead.

      Parameters:
      plugin - a callback to the MC plugin
    • ALIQUAM_FLOO

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

      Creates a new floo network location at the specified fireplace. Registers this spell in the network and loads visual effect configuration.

      Parameters:
      plugin - a callback to the MC plugin
      pid - the UUID of the player who cast the spell
      location - the center location of the fireplace
      flooName - the unique name for this floo network location
  • Method Details

    • kill

      public void kill()
      Kills this floo spell and removes it from the network.

      Called when the spell is destroyed or at server shutdown. Removes this location from the global floo network list and performs standard spell cleanup.

      Overrides:
      kill in class O2StationarySpell
    • upkeep

      public void upkeep()
      Performs per-tick upkeep for this floo spell.

      When active, decrements the cooldown timer and periodically shows fire effects. When inactive, checks for floo powder being thrown into the fireplace to activate it.

      Specified by:
      upkeep in class O2StationarySpell
    • getFlooName

      public String getFlooName()
      Get the name of this floo location
      Returns:
      the name of this floo location
    • isWorking

      public boolean isWorking()
      Checks if this floo location is currently active and accepting teleportation requests.
      Returns:
      true if the floo is active (within the 30-second activation window), false otherwise
    • stopWorking

      public void stopWorking()
      Deactivates the floo network connection and restores the original fireplace appearance.

      Resets the cooldown timer and reverses any visual effects (converts soul fire back to regular fire or removes particle effects).

    • serializeSpellData

      @NotNull public @NotNull Map<String,String> serializeSpellData()
      Serializes the floo location name for persistence across server restarts.
      Returns:
      a map containing the serialized floo name
    • deserializeSpellData

      public void deserializeSpellData(@NotNull @NotNull Map<String,String> spellData)
      Deserializes and restores the floo location name from saved data.
      Parameters:
      spellData - the map of saved spell data
    • checkSpellDeserialization

      public boolean checkSpellDeserialization()
      Checks if this spell has been properly deserialized with required data.

      Verifies that the spell has caster UUID, location, and a non-empty floo name set, which are all required for a floo network location to function.

      Overrides:
      checkSpellDeserialization in class O2StationarySpell
      Returns:
      true if all required data is present and valid, false otherwise
    • getFlooFireplaceNames

      @NotNull public static @NotNull List<String> getFlooFireplaceNames()
      Gets the names of all registered floo network locations.

      Returns a list of unique names for all active floo fireplace locations in the network. Used for displaying available teleportation destinations to players.

      Returns:
      a list of all registered floo fireplace names (not null, may be empty)
    • clearFlooNetwork

      public static void clearFlooNetwork()
      Clears all floo network locations and removes active floo spells from the world.

      Called during server shutdown or plugin reload. Clears the network location list and removes all active ALIQUAM_FLOO spell instances from the spell manager.