Class PROTEGO_HORRIBILIS
- All Implemented Interfaces:
Serializable
Protego Horribilis creates a protective barrier that prevents Dark Arts spells from crossing the shield boundary. The spell is a powerful defensive charm that intercepts malicious magic before it can reach those inside the protected area. However, the spell is not powerful enough to stop the Killing Curse (Avada Kedavra), which bypasses the shield due to its overwhelming dark magic.
Spell characteristics:
- Radius: 5-30 blocks (configurable)
- Duration: 30 seconds to 30 minutes (configurable)
- Effect: Blocks Dark Arts spells from entering the protected area
- Exception: Avada Kedavra (Killing Curse) bypasses the shield
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum spell duration (30 minutes).static final intMaximum spell radius (30 blocks).static final intMinimum spell duration (30 seconds).static final intMinimum spell radius (5 blocks). -
Constructor Summary
ConstructorsConstructorDescriptionPROTEGO_HORRIBILIS(@NotNull Ollivanders2 plugin) Simple constructor used for deserializing saved stationary spells at server start.PROTEGO_HORRIBILIS(@NotNull Ollivanders2 plugin, @NotNull UUID pid, @NotNull org.bukkit.Location location, int radius, int duration) Constructs a new PROTEGO_HORRIBILIS spell cast by a player. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeSpellData(@NotNull Map<String, String> spellData) Deserializes protego horribilis spell data from saved state.Serializes the protego horribilis spell data for persistence.voidupkeep()Age the spell by a tick.Methods inherited from class net.pottercraft.ollivanders2.stationaryspell.O2StationarySpell
age, age, ageByPercent, checkSpellDeserialization, decreaseRadius, flair, getBlock, getCasterID, getDuration, getLivingEntitiesInsideSpellRadius, getLocation, getMaxDuration, getMaxRadius, getMinDuration, getMinRadius, getPlayersInsideSpellRadius, getRadius, getSpellType, increaseDuration, increaseRadius, isActive, isKilled, isLocationInside, isPermanent, kill, setActive
-
Field Details
-
minRadiusConfig
public static final int minRadiusConfigMinimum spell radius (5 blocks).- See Also:
-
maxRadiusConfig
public static final int maxRadiusConfigMaximum spell radius (30 blocks).- See Also:
-
minDurationConfig
public static final int minDurationConfigMinimum spell duration (30 seconds).- See Also:
-
maxDurationConfig
public static final int maxDurationConfigMaximum spell duration (30 minutes).- See Also:
-
-
Constructor Details
-
PROTEGO_HORRIBILIS
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
-
PROTEGO_HORRIBILIS
public PROTEGO_HORRIBILIS(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull UUID pid, @NotNull @NotNull org.bukkit.Location location, int radius, int duration) Constructs a new PROTEGO_HORRIBILIS spell cast by a player.Creates a protective shield at the specified location with the given radius and duration. The shield will block Dark Arts spells from entering the protected area.
- 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)radius- the radius for this spell (will be clamped to min/max values)duration- the duration of the spell in ticks (will be clamped to min/max values)
-
-
Method Details
-
upkeep
public void upkeep()Age the spell by a tick.- Specified by:
upkeepin classO2StationarySpell
-
serializeSpellData
Serializes the protego horribilis spell data for persistence.The protego horribilis 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
Deserializes protego horribilis spell data from saved state.The protego horribilis spell has no extra data to deserialize, so this method does nothing.
- Parameters:
spellData- the serialized spell data map (not used)
-