Class REPELLO_MUGGLETON
- All Implemented Interfaces:
Serializable
When a muggle attempts to enter the spell area, they are repelled with an inexplicable compulsion to go elsewhere - they remember urgent tasks or important appointments. Muggles also cannot see wizards or witches who are concealed within the spell area, nor can they hear conversations happening inside. Unlike some concealment spells, this charm does not trigger proximity alarms when muggles approach.
Behavior:
- Muggles cannot enter the spell area (
canEnter(LivingEntity)returns false) - Muggles cannot see wizards inside (
canSee(LivingEntity)returns false) - Muggles cannot hear conversations from inside (
canHear(LivingEntity)returns false) - All entities (including muggles) can target players inside without restriction
- No proximity alarms are triggered when muggles approach the boundary
- Since:
- 2.21
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum spell duration in ticks (30 minutes).static final intMaximum spell radius in blocks (20 blocks).static final intMinimum spell duration in ticks (30 seconds).static final intMinimum spell radius in blocks (5 blocks).Fields inherited from class net.pottercraft.ollivanders2.stationaryspell.ConcealmentShieldSpell
alarmOnProximity, entryDenyMessages, proximityCooldownLimit, proximityCooldownTimer, proximityRadiusModifier -
Constructor Summary
ConstructorsConstructorDescriptionREPELLO_MUGGLETON(@NotNull Ollivanders2 plugin) Constructs a REPELLO_MUGGLETON spell from deserialized data.REPELLO_MUGGLETON(@NotNull Ollivanders2 plugin, @NotNull UUID pid, @NotNull org.bukkit.Location location, int radius, int duration) Constructs a new REPELLO_MUGGLETON spell cast by a player. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEnter(@NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity can enter the spell's protected area.protected booleancanHear(@NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can hear conversations from inside.protected booleancanSee(@NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can see players inside.booleancanTarget(@NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can target players inside.protected booleancheckAlarm(@NotNull org.bukkit.entity.LivingEntity entity) Checks if a non-player entity near the spell boundary should trigger a proximity alarm.protected booleancheckAlarm(@NotNull org.bukkit.entity.Player player) Checks if a player near the spell boundary should trigger a proximity alarm.protected voidExecutes the proximity alarm action for this spell.Methods inherited from class net.pottercraft.ollivanders2.stationaryspell.ConcealmentShieldSpell
deserializeSpellData, doesAlarmOnProximty, doProximityCheck, getAreaEntryDenialMessage, getEntryDenyMessages, getProximityRadius, handleEntityMove, hidePlayersInSpellArea, isInProximity, serializeSpellData, toggleVisibility, unhidePlayer, unhidePlayersInSpellArea, upkeepMethods 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 in blocks (5 blocks). The smallest protected area that can be created with this spell.- See Also:
-
maxRadiusConfig
public static final int maxRadiusConfigMaximum spell radius in blocks (20 blocks). The largest protected area that can be created with this spell.- See Also:
-
minDurationConfig
public static final int minDurationConfigMinimum spell duration in ticks (30 seconds). The shortest time a spell can persist after being cast.- See Also:
-
maxDurationConfig
public static final int maxDurationConfigMaximum spell duration in ticks (30 minutes). The longest time a spell can persist after being cast.- See Also:
-
-
Constructor Details
-
REPELLO_MUGGLETON
Constructs a REPELLO_MUGGLETON spell from deserialized data.Used only for loading saved spells from disk at server startup. This constructor should not be called directly when casting a new spell - use the full constructor instead.
- Parameters:
plugin- a callback to the MC plugin
-
REPELLO_MUGGLETON
public REPELLO_MUGGLETON(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull UUID pid, @NotNull @NotNull org.bukkit.Location location, int radius, int duration) Constructs a new REPELLO_MUGGLETON spell cast by a player.Creates the spell at the specified location with the given radius and duration. Initializes entry denial messages that muggles will see when blocked from entering.
- Parameters:
plugin- a callback to the MC pluginpid- the UUID of the player who cast the spelllocation- the center location of the spellradius- the initial radius of the protected area in blocksduration- the initial duration of the spell in ticks
-
-
Method Details
-
canSee
protected boolean canSee(@NotNull @NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can see players inside.Muggles (non-magical people) cannot see wizards and witches concealed within the spell area. Only magical beings have the ability to perceive those inside the protected zone.
- Specified by:
canSeein classConcealmentShieldSpell- Parameters:
entity- the entity outside the spell area checking visibility- Returns:
- false if the entity is a muggle, true if they can see inside
-
canTarget
public boolean canTarget(@NotNull @NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can target players inside.REPELLO_MUGGLETON does not prevent entities from targeting wizards inside the protected area. Unlike some concealment spells, it focuses on hiding and preventing entry rather than blocking attacks.
- Specified by:
canTargetin classConcealmentShieldSpell- Parameters:
entity- the entity outside the spell area attempting to target- Returns:
- true - all entities (including muggles) can target inside this spell
-
canEnter
public boolean canEnter(@NotNull @NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity can enter the spell's protected area.Only magical beings (wizards, witches, and non-player entities) can enter. Muggles are prevented from entering and receive an entry denial message explaining their compulsion to leave.
- Specified by:
canEnterin classConcealmentShieldSpell- Parameters:
entity- the entity attempting to enter the spell area- Returns:
- false if the entity is a muggle, true if they can enter
-
canHear
protected boolean canHear(@NotNull @NotNull org.bukkit.entity.LivingEntity entity) Determines if an entity outside the spell can hear conversations from inside.Muggles cannot hear sounds from protected wizards inside the spell area. Non-muggles can hear conversations normally.
- Specified by:
canHearin classConcealmentShieldSpell- Parameters:
entity- the entity outside the spell area checking hearing capability- Returns:
- true if the entity is not a Muggle, false if muggles cannot hear
-
checkAlarm
protected boolean checkAlarm(@NotNull @NotNull org.bukkit.entity.Player player) Checks if a player near the spell boundary should trigger a proximity alarm.REPELLO_MUGGLETON does not have proximity alarm functionality. This spell silently repels muggles without alerting the protected players.
- Specified by:
checkAlarmin classConcealmentShieldSpell- Parameters:
player- the player outside the spell near the proximity boundary- Returns:
- always false - no alarms are triggered for this spell
-
checkAlarm
protected boolean checkAlarm(@NotNull @NotNull org.bukkit.entity.LivingEntity entity) Checks if a non-player entity near the spell boundary should trigger a proximity alarm.REPELLO_MUGGLETON does not have proximity alarm functionality. Hostile entities approaching the boundary do not trigger alerts.
- Specified by:
checkAlarmin classConcealmentShieldSpell- Parameters:
entity- the entity outside the spell near the proximity boundary- Returns:
- always false - no alarms are triggered for this spell
-
proximityAlarm
protected void proximityAlarm()Executes the proximity alarm action for this spell.This method does nothing for REPELLO_MUGGLETON since the spell does not have proximity alarm functionality.
- Specified by:
proximityAlarmin classConcealmentShieldSpell
-