Package com.binaris.wizardry.cca.stack
Class ConjureDataHolder
java.lang.Object
dev.onyxstudios.cca.api.v3.item.ItemComponent
com.binaris.wizardry.cca.stack.ConjureDataHolder
- All Implemented Interfaces:
ConjureData,dev.onyxstudios.cca.api.v3.component.Component,dev.onyxstudios.cca.api.v3.item.ItemTagInvalidationListener
public class ConjureDataHolder
extends dev.onyxstudios.cca.api.v3.item.ItemComponent
implements ConjureData
Here for loading/storing conjure item data. CCA components rely on NBT storage, so this could be easily synced and
persisted without any problems. This is also why there's no fields here; all data is stored in the ItemStack's NBT.
-
Field Summary
Fields inherited from class dev.onyxstudios.cca.api.v3.item.ItemComponent
stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the duration this item was conjured for (for display purposes).longGets the absolute game time when this conjured item should expire.booleanChecks whether this item was conjured.voidsetDuration(int duration) Sets the duration this item was conjured for (for display purposes).voidsetExpireTime(long expireTime) Sets the absolute game time when this conjured item should expire.voidsetSummoned(boolean summoned) Sets whether this item was conjured.Methods inherited from class dev.onyxstudios.cca.api.v3.item.ItemComponent
equals, getBoolean, getCompound, getDouble, getFloat, getInt, getKeys, getList, getList, getLong, getOrCreateRootTag, getRootTag, getRootTagKey, getString, getTag, getTag, getTag, getUuid, hashCode, hasTag, hasTag, hasTag, onTagInvalidated, putBoolean, putCompound, putDouble, putFloat, putInt, putList, putLong, putString, putUuid, readFromNbt, remove, wrapFactory, writeToNbtMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.binaris.wizardry.api.content.data.ConjureData
getRemainingLifetime, hasExpired
-
Constructor Details
-
ConjureDataHolder
public ConjureDataHolder(net.minecraft.world.item.ItemStack stack)
-
-
Method Details
-
getExpireTime
public long getExpireTime()Description copied from interface:ConjureDataGets the absolute game time when this conjured item should expire.- Specified by:
getExpireTimein interfaceConjureData- Returns:
- the expire time in game ticks, or -1 if not set
-
setExpireTime
public void setExpireTime(long expireTime) Description copied from interface:ConjureDataSets the absolute game time when this conjured item should expire.- Specified by:
setExpireTimein interfaceConjureData- Parameters:
expireTime- the expire time in game ticks
-
getDuration
public int getDuration()Description copied from interface:ConjureDataGets the duration this item was conjured for (for display purposes).- Specified by:
getDurationin interfaceConjureData- Returns:
- the duration in ticks
-
setDuration
public void setDuration(int duration) Description copied from interface:ConjureDataSets the duration this item was conjured for (for display purposes).- Specified by:
setDurationin interfaceConjureData- Parameters:
duration- the duration in ticks
-
isSummoned
public boolean isSummoned()Description copied from interface:ConjureDataChecks whether this item was conjured.- Specified by:
isSummonedin interfaceConjureData- Returns:
- true if the item was conjured
-
setSummoned
public void setSummoned(boolean summoned) Description copied from interface:ConjureDataSets whether this item was conjured.- Specified by:
setSummonedin interfaceConjureData- Parameters:
summoned- true if the item was conjured
-