Interface WizardData

All Known Implementing Classes:
WizardDataHolder

public interface WizardData
  • Method Details

    • setTierReached

      void setTierReached(SpellTier tier)
      Sets the highest spell tier reached by the player, use this with caution as it can only be increased.
      Parameters:
      tier - The SpellTier to set as reached.
    • hasReachedTier

      boolean hasReachedTier(SpellTier tier)
      Checks if the player has reached the specified spell tier.
      Parameters:
      tier - The SpellTier to check.
      Returns:
      true if the player has reached the specified tier, false otherwise.
    • toggleAlly

      boolean toggleAlly(net.minecraft.world.entity.player.Player friend)
      Toggles the ally status of a friend for the original player.
      Parameters:
      friend - The player whose ally status is being toggled.
      Returns:
      true if the friend was added as an ally, false if they were removed.
    • isPlayerAlly

      boolean isPlayerAlly(net.minecraft.world.entity.player.Player ally)
      Checks if the given player is an ally of the original player. This checks both the list of ally UUIDs and the original player's team.
      Parameters:
      ally - the Player to check
      Returns:
      true if the player is an ally, false otherwise
    • isPlayerAlly

      boolean isPlayerAlly(UUID playerUUID)
      Checks if the given player UUID is an ally of the original player. This checks both the list of ally UUIDs and the original player's team.
      Parameters:
      playerUUID - the UUID of the player to check
      Returns:
      true if the player is an ally, false otherwise
    • getSpellModifiers

      SpellModifiers getSpellModifiers()
      Gets the spell modifiers associated with the player.
      Returns:
      The SpellModifiers for the player.
    • setSpellModifiers

      void setSpellModifiers(SpellModifiers modifiers)
    • trackRecentSpell

      void trackRecentSpell(Spell spell, long timestamp)
      Records a spell cast for tracking recent spells by the player, used especially to avoid spell spam for quick wand level progression and similar things.
      Parameters:
      spell - The Spell that was just cast.
      timestamp - The time at which the spell was cast, in game ticks.
    • countRecentCasts

      int countRecentCasts(Spell spell)
      Counts how many times a spell has been cast recently by the player. It could be 0 if it hasn't been cast recently.
      Parameters:
      spell - The Spell to count recent casts of.
      Returns:
      The number of times the spell has been cast recently.
    • getRecentSpells

      List<WizardData.RecentSpellCast> getRecentSpells()
      Gets the recent spells cast by the player.
      Returns:
      A list of recent spells cast by the player.
    • getRecentlyCastSpell

      @Nullable @Nullable WizardData.RecentSpellCast getRecentlyCastSpell()
      Gets the most recently cast spell by the player.
      Returns:
      The most recently cast spell by the player, or null if no spells have been cast recently.
    • removeRecentCasts

      void removeRecentCasts(Predicate<WizardData.RecentSpellCast> predicate)
      Removes recent spell casts that match the given predicate, allowing for custom filtering of which entries to remove.
      Parameters:
      predicate - A Predicate that tests AbstractMap.SimpleEntry<Spell, Long> objects representing recent spell casts. If the predicate returns true for an entry, that entry will be removed.
    • getRandom

      Random getRandom()
      Gets a Random instance associated with this WizardData.
      Returns:
      A Random instance.