All Implemented Interfaces:
Serializable

public class MUFFLIATO extends ShieldSpell
A stationary shield spell that muffles sound and prevents eavesdropping on conversations.

The Muffliato charm creates a protective barrier where conversations are silenced from outside listeners. Only players inside the spell area can hear chats from other inside players. Players outside the spell cannot hear any conversations occurring within the protected area, effectively preventing eavesdropping. The spell lasts for a configurable duration based on caster skill level.

Spell characteristics:

  • Radius: 5-20 blocks (configurable)
  • Duration: 30 seconds to 30 minutes (configurable)
  • Effect: Prevents outside players from hearing inside conversations
  • Inside players can hear outside conversations
See Also:
  • Field Details

    • minRadiusConfig

      public static final int minRadiusConfig
      Minimum spell radius (5 blocks).
      See Also:
    • maxRadiusConfig

      public static final int maxRadiusConfig
      Maximum spell radius (20 blocks).
      See Also:
    • minDurationConfig

      public static final int minDurationConfig
      Minimum spell duration (30 seconds).
      See Also:
    • maxDurationConfig

      public static final int maxDurationConfig
      Maximum spell duration (30 minutes).
      See Also:
  • Constructor Details

    • MUFFLIATO

      public MUFFLIATO(@NotNull @NotNull Ollivanders2 plugin)
      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
    • MUFFLIATO

      public MUFFLIATO(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull UUID pid, @NotNull @NotNull org.bukkit.Location location, int radius, int duration)
      Constructs a new MUFFLIATO spell cast by a player.

      Creates a muffliato charm at the specified location with the given radius and duration. The spell will prevent outside players from hearing conversations within 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 1 tick
      Specified by:
      upkeep in class O2StationarySpell
    • serializeSpellData

      @NotNull public @NotNull Map<String,String> serializeSpellData()
      Serializes the muffliato spell data for persistence.

      The muffliato 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

      public void deserializeSpellData(@NotNull @NotNull Map<String,String> spellData)
      Deserializes muffliato spell data from saved state.

      The muffliato spell has no extra data to deserialize, so this method does nothing.

      Parameters:
      spellData - the serialized spell data map (not used)