Class ImbuementEnchantDataHolder

java.lang.Object
dev.onyxstudios.cca.api.v3.item.ItemComponent
com.binaris.wizardry.cca.stack.ImbuementEnchantDataHolder
All Implemented Interfaces:
ImbuementEnchantData, dev.onyxstudios.cca.api.v3.component.Component, dev.onyxstudios.cca.api.v3.item.ItemTagInvalidationListener

public class ImbuementEnchantDataHolder extends dev.onyxstudios.cca.api.v3.item.ItemComponent implements ImbuementEnchantData
  • Field Summary

    Fields inherited from class dev.onyxstudios.cca.api.v3.item.ItemComponent

    stack
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImbuementEnchantDataHolder(net.minecraft.world.item.ItemStack stack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addImbuement(net.minecraft.world.item.enchantment.Enchantment enchant, long expireTime)
    Adds a temporary enchantment with expiration time.
    long
    getExpirationTime(net.minecraft.world.item.enchantment.Enchantment enchantment)
    Gets the expiration time for a specific enchantment.
    Map<net.minecraft.resources.ResourceLocation,Long>
    Gets all temporary enchantments and their expiration times.
    boolean
    isImbuement(net.minecraft.world.item.enchantment.Enchantment enchant)
    Checks if an enchantment is tracked as temporary.
    void
    removeImbuement(net.minecraft.world.item.enchantment.Enchantment enchant)
    Removes a temporary enchantment from tracking.

    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.ImbuementEnchantData

    getRemainingTime
  • Constructor Details

    • ImbuementEnchantDataHolder

      public ImbuementEnchantDataHolder(net.minecraft.world.item.ItemStack stack)
  • Method Details

    • addImbuement

      public void addImbuement(net.minecraft.world.item.enchantment.Enchantment enchant, long expireTime)
      Description copied from interface: ImbuementEnchantData
      Adds a temporary enchantment with expiration time. This only adds tracking; the actual enchantment should be applied to the item separately.
      Specified by:
      addImbuement in interface ImbuementEnchantData
      Parameters:
      enchant - the Enchantment to track as temporary
      expireTime - the absolute game time when this enchantment expires
    • getImbuements

      public Map<net.minecraft.resources.ResourceLocation,Long> getImbuements()
      Description copied from interface: ImbuementEnchantData
      Gets all temporary enchantments and their expiration times. Returns a map of enchantment location -> expiration time
      Specified by:
      getImbuements in interface ImbuementEnchantData
      Returns:
      map of enchantment ResourceLocations to expiration times
    • removeImbuement

      public void removeImbuement(net.minecraft.world.item.enchantment.Enchantment enchant)
      Description copied from interface: ImbuementEnchantData
      Removes a temporary enchantment from tracking.
      Specified by:
      removeImbuement in interface ImbuementEnchantData
      Parameters:
      enchant - the enchantment to remove
    • isImbuement

      public boolean isImbuement(net.minecraft.world.item.enchantment.Enchantment enchant)
      Description copied from interface: ImbuementEnchantData
      Checks if an enchantment is tracked as temporary.
      Specified by:
      isImbuement in interface ImbuementEnchantData
      Parameters:
      enchant - the Enchantment to check
      Returns:
      true if the enchantment is temporary
    • getExpirationTime

      public long getExpirationTime(net.minecraft.world.item.enchantment.Enchantment enchantment)
      Description copied from interface: ImbuementEnchantData
      Gets the expiration time for a specific enchantment.
      Specified by:
      getExpirationTime in interface ImbuementEnchantData
      Parameters:
      enchantment - the enchantment
      Returns:
      the expiration time in game ticks, or -1 if not found