Package com.binaris.wizardry.cca.player
Class SpellManagerDataHolder
java.lang.Object
com.binaris.wizardry.cca.player.SpellManagerDataHolder
- All Implemented Interfaces:
SpellManagerData,dev.onyxstudios.cca.api.v3.component.Component,dev.onyxstudios.cca.api.v3.component.ComponentV3,dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent,dev.onyxstudios.cca.api.v3.component.sync.ComponentPacketWriter,dev.onyxstudios.cca.api.v3.component.sync.PlayerSyncPredicate
public class SpellManagerDataHolder
extends Object
implements SpellManagerData, dev.onyxstudios.cca.api.v3.component.ComponentV3, dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandiscoverSpell(Spell spell) Marks the given spell as discovered for the player.Returns a map of all spell variables and their corresponding values.<T> TgetVariable(ISpellVar<T> var) Retrieves the value of a specific spell variable.booleanhasSpellBeenDiscovered(Spell spell) Checks if the given spell has been discovered by the player.voidreadFromNbt(@NotNull net.minecraft.nbt.CompoundTag tag) <T> voidsetVariable(ISpellVar<? super T> variable, T value) Sets the value of a specific spell variable.voidsync()Synchronises this SpellManagerData with the client.booleanundiscoverSpell(Spell spell) Deletes the given spell from the player's discovered spells.voidwriteToNbt(@NotNull net.minecraft.nbt.CompoundTag tag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent
applySyncPacket, shouldSyncWith, writeSyncPacketMethods inherited from interface dev.onyxstudios.cca.api.v3.component.Component
equals
-
Field Details
-
storedVariables
-
spellData
-
spellsDiscovered
-
-
Constructor Details
-
SpellManagerDataHolder
public SpellManagerDataHolder(net.minecraft.world.entity.player.Player provider)
-
-
Method Details
-
sync
public void sync()Description copied from interface:SpellManagerDataSynchronises this SpellManagerData with the client.- Specified by:
syncin interfaceSpellManagerData
-
getVariable
Description copied from interface:SpellManagerDataRetrieves the value of a specific spell variable.- Specified by:
getVariablein interfaceSpellManagerData- Type Parameters:
T- the type of the spell variable- Parameters:
var- the spell variable to retrieve- Returns:
- the value of the specified spell variable
-
setVariable
Description copied from interface:SpellManagerDataSets the value of a specific spell variable.- Specified by:
setVariablein interfaceSpellManagerData- Type Parameters:
T- the type of the spell variable- Parameters:
variable- the spell variable to setvalue- the value to set for the spell variable
-
getSpellData
Description copied from interface:SpellManagerDataReturns a map of all spell variables and their corresponding values.- Specified by:
getSpellDatain interfaceSpellManagerData- Returns:
- a Map containing all spell variables and their values
-
hasSpellBeenDiscovered
Description copied from interface:SpellManagerDataChecks if the given spell has been discovered by the player.- Specified by:
hasSpellBeenDiscoveredin interfaceSpellManagerData- Parameters:
spell- the Spell to check- Returns:
- true if the spell has been discovered, false otherwise
-
discoverSpell
Description copied from interface:SpellManagerDataMarks the given spell as discovered for the player.- Specified by:
discoverSpellin interfaceSpellManagerData- Parameters:
spell- the Spell to mark as discovered- Returns:
- true if the spell was not already discovered, false otherwise
-
undiscoverSpell
Description copied from interface:SpellManagerDataDeletes the given spell from the player's discovered spells.- Specified by:
undiscoverSpellin interfaceSpellManagerData- Parameters:
spell- the Spell to mark as undiscovered- Returns:
- true if the spell was previously discovered, false otherwise
-
readFromNbt
public void readFromNbt(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Specified by:
readFromNbtin interfacedev.onyxstudios.cca.api.v3.component.Component
-
writeToNbt
public void writeToNbt(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Specified by:
writeToNbtin interfacedev.onyxstudios.cca.api.v3.component.Component
-