/** * Retrieve the attribute at a given index. * * @param index - the index to look up. * @return The attribute at that index. */ public Attribute get(int index) { return new Attribute((NbtCompound) attributes.get(index)); }
/** * Add a new attribute to the list. * * @param attribute - the new attribute. */ public void add(Attribute attribute) { Preconditions.checkNotNull(attribute.getName(), "must specify an attribute name."); attributes.add(attribute.data); }
public void clear() { attributes.clear(); }
/** * Retrieve the number of attributes. * * @return Number of attributes. */ public int size() { return attributes.size(); }