Class AbstractAttributeList<T>

java.lang.Object
alexiil.mc.lib.attributes.AbstractAttributeList<T>
Direct Known Subclasses:
AttributeList, ItemAttributeList

public abstract class AbstractAttributeList<T> extends Object
The base class for AttributeList and ItemAttributeList.
  • Field Details

    • attribute

      public final Attribute<T> attribute
    • list

      protected final net.minecraft.util.collection.DefaultedList<T> list
  • Constructor Details

    • AbstractAttributeList

      public AbstractAttributeList(Attribute<T> attribute)
  • Method Details

    • getCount

      public int getCount()
      Returns:
      The number of attribute instances added to this list.
    • get

      @Nonnull public T get(int index)
    • getFirstOrNull

      @Nullable public T getFirstOrNull()
    • getFirst

      @Nonnull public T getFirst(DefaultedAttribute<T> defaulted)
    • combine

      @Nonnull public T combine(CombinableAttribute<T> combinable)
      Returns:
      A combined version of this list, or the attribute's default value if this list is empty.
    • assertAdding

      protected void assertAdding()
    • assertUsing

      protected void assertUsing()