Class COLLOPORTUS
java.lang.Object
net.pottercraft.ollivanders2.stationaryspell.O2StationarySpell
net.pottercraft.ollivanders2.stationaryspell.COLLOPORTUS
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum spell duration (not used - colloportus is permanent).static final intMaximum spell radius (5 blocks).static final intMinimum spell duration (not used - colloportus is permanent).static final intMinimum spell radius (5 blocks). -
Constructor Summary
ConstructorsConstructorDescriptionCOLLOPORTUS(@NotNull Ollivanders2 plugin) Simple constructor used for deserializing saved stationary spells at server start.COLLOPORTUS(@NotNull Ollivanders2 plugin, @NotNull UUID pid, @NotNull org.bukkit.Location location) Constructs a new COLLOPORTUS spell cast by a player. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeSpellData(@NotNull Map<String, String> spellData) Deserializes colloportus spell data from saved state.Serializes the colloportus spell data for persistence.voidupkeep()No upkeep for this spellMethods 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 (5 blocks).- See Also:
-
minDurationConfig
public static final int minDurationConfigMinimum spell duration (not used - colloportus is permanent).- See Also:
-
maxDurationConfig
public static final int maxDurationConfigMaximum spell duration (not used - colloportus is permanent).- See Also:
-
-
Constructor Details
-
COLLOPORTUS
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:
upkeepin classO2StationarySpell
-
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
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)
-