Package alexiil.mc.lib.attributes
Class AbstractAttributeList<T>
java.lang.Object
alexiil.mc.lib.attributes.AbstractAttributeList<T>
- Direct Known Subclasses:
AttributeList
,ItemAttributeList
public abstract class AbstractAttributeList<T>
extends java.lang.Object
The base class for
AttributeList
and ItemAttributeList
.-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractAttributeList(Attribute<T> attribute)
-
Method Summary
Modifier and Type Method Description protected void
assertAdding()
protected void
assertUsing()
T
combine(CombinableAttribute<T> combinable)
T
get(int index)
int
getCount()
T
getFirst(DefaultedAttribute<T> defaulted)
T
getFirstOrNull()
-
Field Details
-
Constructor Details
-
Method Details
-
getCount
public int getCount()- Returns:
- The number of attribute instances added to this list.
-
get
-
getFirstOrNull
-
getFirst
-
combine
- 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()
-