public interface IAffinityItem
Represents an item that has an affinity in the stack
  • Method Summary

    Modifier and Type
    Method
    Description
    default Affinity
    getAffinity(net.minecraft.world.item.ItemStack stack)
     
    default boolean
     
    default net.minecraft.world.item.ItemStack
    setAffinity(net.minecraft.world.item.ItemStack stack, Affinity affinity)
     
  • Method Details

    • hasNoneVariant

      default boolean hasNoneVariant()
      Returns:
      Whether this item should have a variant without an affinity or not.
    • getAffinity

      default Affinity getAffinity(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The stack to get the affinity from.
      Returns:
      The affinity stored in the stack, or the NONE affinity if the stack does not contain one.
    • setAffinity

      default net.minecraft.world.item.ItemStack setAffinity(net.minecraft.world.item.ItemStack stack, Affinity affinity)
      Parameters:
      stack - The item stack to set the affinity on.
      affinity - The affinity to set.
      Returns:
      The stack, now with the given affinity set on it.