Class ALIQUAM_FLOO
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMessage sent to player when the floo event is cancelledstatic final intMaximum spell duration in ticks (not used - ALIQUAM_FLOO is permanent).static final intMaximum spell radius (2 blocks, hardcoded and cannot be changed).static final intMinimum spell duration in ticks (not used - ALIQUAM_FLOO is permanent).static final intMinimum spell radius (2 blocks, hardcoded and cannot be changed).static final StringMessage sent to player when the floo event happens successfully -
Constructor Summary
ConstructorsConstructorDescriptionALIQUAM_FLOO(@NotNull Ollivanders2 plugin) Constructs an ALIQUAM_FLOO spell from deserialized data at server startup.ALIQUAM_FLOO(@NotNull Ollivanders2 plugin, @NotNull UUID pid, @NotNull org.bukkit.Location location, @NotNull String flooName) Constructs a new ALIQUAM_FLOO spell cast by a player. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this spell has been properly deserialized with required data.static voidClears all floo network locations and removes active floo spells from the world.voiddeserializeSpellData(@NotNull Map<String, String> spellData) Deserializes and restores the floo location name from saved data.Gets the names of all registered floo network locations.Get the name of this floo locationbooleanChecks if this floo location is currently active and accepting teleportation requests.voidkill()Kills this floo spell and removes it from the network.Serializes the floo location name for persistence across server restarts.voidDeactivates the floo network connection and restores the original fireplace appearance.voidupkeep()Performs per-tick upkeep for this floo spell.Methods inherited from class net.pottercraft.ollivanders2.stationaryspell.O2StationarySpell
age, age, ageByPercent, decreaseRadius, flair, getBlock, getCasterID, getDuration, getLivingEntitiesInsideSpellRadius, getLocation, getMaxDuration, getMaxRadius, getMinDuration, getMinRadius, getPlayersInsideSpellRadius, getRadius, getSpellType, increaseDuration, increaseRadius, isActive, isKilled, isLocationInside, isPermanent, setActive
-
Field Details
-
minRadiusConfig
public static final int minRadiusConfigMinimum spell radius (2 blocks, hardcoded and cannot be changed).- See Also:
-
maxRadiusConfig
public static final int maxRadiusConfigMaximum spell radius (2 blocks, hardcoded and cannot be changed).- See Also:
-
minDurationConfig
public static final int minDurationConfigMinimum spell duration in ticks (not used - ALIQUAM_FLOO is permanent).- See Also:
-
maxDurationConfig
public static final int maxDurationConfigMaximum spell duration in ticks (not used - ALIQUAM_FLOO is permanent).- See Also:
-
successMessage
Message sent to player when the floo event happens successfully- See Also:
-
cancelledMessage
Message sent to player when the floo event is cancelled- See Also:
-
-
Constructor Details
-
ALIQUAM_FLOO
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 pluginpid- the UUID of the player who cast the spelllocation- the center location of the fireplaceflooName- 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:
killin classO2StationarySpell
-
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:
upkeepin classO2StationarySpell
-
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
Serializes the floo location name for persistence across server restarts.- Returns:
- a map containing the serialized floo name
-
deserializeSpellData
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:
checkSpellDeserializationin classO2StationarySpell- Returns:
- true if all required data is present and valid, false otherwise
-
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.
-