public class ItemComponentList extends java.lang.Object implements java.lang.Iterable<ItemComponent<?>>
| Constructor and Description |
|---|
ItemComponentList() |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.Optional<ItemComponent<T>> |
getById(int id)
Get a component by its id.
|
<T> java.util.Optional<ItemComponent<T>> |
getByName(com.viaversion.viaversion.libs.mcstructs.core.Identifier identifier)
Get a component by its name.
|
<T> java.util.Optional<ItemComponent<T>> |
getByName(java.lang.String name)
Get a component by its name.
The name is prepended with the namespace if required. |
int |
getId(ItemComponent<?> component)
Get the id of a component.
|
java.util.Iterator<ItemComponent<?>> |
iterator() |
int |
size() |
public int size()
public <T> java.util.Optional<ItemComponent<T>> getByName(java.lang.String name)
T - The type of the componentname - The name of the componentpublic <T> java.util.Optional<ItemComponent<T>> getByName(com.viaversion.viaversion.libs.mcstructs.core.Identifier identifier)
T - The type of the componentidentifier - The name of the componentpublic <T> java.util.Optional<ItemComponent<T>> getById(int id)
T - The type of the componentid - The id of the componentpublic int getId(ItemComponent<?> component)
component - The component to get the id frompublic java.util.Iterator<ItemComponent<?>> iterator()
iterator in interface java.lang.Iterable<ItemComponent<?>>