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
    Constructor
    Description
    ConjureDataHolder(net.minecraft.world.item.ItemStack stack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the duration this item was conjured for (for display purposes).
    long
    Gets the absolute game time when this conjured item should expire.
    boolean
    Checks whether this item was conjured.
    void
    setDuration(int duration)
    Sets the duration this item was conjured for (for display purposes).
    void
    setExpireTime(long expireTime)
    Sets the absolute game time when this conjured item should expire.
    void
    setSummoned(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, writeToNbt

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods 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: ConjureData
      Gets the absolute game time when this conjured item should expire.
      Specified by:
      getExpireTime in interface ConjureData
      Returns:
      the expire time in game ticks, or -1 if not set
    • setExpireTime

      public void setExpireTime(long expireTime)
      Description copied from interface: ConjureData
      Sets the absolute game time when this conjured item should expire.
      Specified by:
      setExpireTime in interface ConjureData
      Parameters:
      expireTime - the expire time in game ticks
    • getDuration

      public int getDuration()
      Description copied from interface: ConjureData
      Gets the duration this item was conjured for (for display purposes).
      Specified by:
      getDuration in interface ConjureData
      Returns:
      the duration in ticks
    • setDuration

      public void setDuration(int duration)
      Description copied from interface: ConjureData
      Sets the duration this item was conjured for (for display purposes).
      Specified by:
      setDuration in interface ConjureData
      Parameters:
      duration - the duration in ticks
    • isSummoned

      public boolean isSummoned()
      Description copied from interface: ConjureData
      Checks whether this item was conjured.
      Specified by:
      isSummoned in interface ConjureData
      Returns:
      true if the item was conjured
    • setSummoned

      public void setSummoned(boolean summoned)
      Description copied from interface: ConjureData
      Sets whether this item was conjured.
      Specified by:
      setSummoned in interface ConjureData
      Parameters:
      summoned - true if the item was conjured