Interface WizardData
- All Known Implementing Classes:
WizardDataHolder
public interface WizardData
-
Method Summary
Modifier and TypeMethodDescriptionintcountRecentCasts(Spell spell) Counts how many times a spell has been cast recently by the player.Gets a Random instance associated with this WizardData.Gets the spell modifiers associated with the player.booleanhasReachedTier(SpellTier tier) Checks if the player has reached the specified spell tier.booleanisPlayerAlly(UUID playerUUID) Checks if the given player UUID is an ally of the original player.booleanisPlayerAlly(net.minecraft.world.entity.player.Player ally) Checks if the given player is an ally of the original player.voidremoveRecentCasts(Predicate<AbstractMap.SimpleEntry<Spell, Long>> predicate) Removes recent spell casts that match the given predicate, allowing for custom filtering of which entries to remove.voidsetSpellModifiers(SpellModifiers modifiers) voidsetTierReached(SpellTier tier) Sets the highest spell tier reached by the player, use this with caution as it can only be increased.booleantoggleAlly(net.minecraft.world.entity.player.Player friend) Toggles the ally status of a friend for the original player.voidtrackRecentSpell(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.
-
Method Details
-
setTierReached
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
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
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
-
trackRecentSpell
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
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.
-
removeRecentCasts
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.
-