Package net.minecraft.core
Class NonNullList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
net.minecraft.core.NonNullList<E>
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- List<E>
- 
Field SummaryFieldsFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidclear()static <E> com.mojang.serialization.Codec<NonNullList<E>>codecOf(com.mojang.serialization.Codec<E> entryCodec) Neo: utility method to construct a Codec for a NonNullListstatic <E> NonNullList<E>copyOf(Collection<? extends E> entries) Neo: utility method to construct an immutable NonNullList from a given collectionstatic <E> NonNullList<E>create()static <E> NonNullList<E>createWithCapacity(int p_182648_) get(int p_122791_) static <E> NonNullList<E>of(E p_122784_, E... p_122785_) remove(int p_122793_) intsize()static <E> NonNullList<E>withSize(int p_122781_, E p_122782_) Methods inherited from class java.util.AbstractListadd, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollectionaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.ListaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
- 
Field Details- 
list
- 
defaultValue
 
- 
- 
Constructor Details- 
NonNullList
 
- 
- 
Method Details- 
codecOfpublic static <E> com.mojang.serialization.Codec<NonNullList<E>> codecOf(com.mojang.serialization.Codec<E> entryCodec) Neo: utility method to construct a Codec for a NonNullList- Type Parameters:
- E- the element type
- Parameters:
- entryCodec- the codec to use for the elements
- Returns:
- a codec that encodes as a list, and decodes into NonNullList
 
- 
copyOfNeo: utility method to construct an immutable NonNullList from a given collection- Type Parameters:
- E- the type of the elements in the list
- Parameters:
- entries- the collection to make a copy of
- Returns:
- a new immutable NonNullList
- Throws:
- NullPointerException- if entries is null, or if it contains any nulls
 
- 
create
- 
createWithCapacity
- 
withSize
- 
of
- 
get
- 
set
- 
add
- 
remove
- 
sizepublic int size()- Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein interface- List<E>
- Specified by:
- sizein class- AbstractCollection<E>
 
- 
clearpublic void clear()- Specified by:
- clearin interface- Collection<E>
- Specified by:
- clearin interface- List<E>
- Overrides:
- clearin class- AbstractList<E>
 
 
-