public class SimpleRegistry<T> extends MutableRegistry<T>
Modifier and Type | Field and Description |
---|---|
protected BiMap<Identifier,T> |
entries |
protected Int2ObjectBiMap<T> |
indexedEntries |
protected static Logger |
LOGGER |
private int |
nextId |
protected Object[] |
randomEntries |
ACTIVITY, ATTRIBUTES, BIOME, BIOME_SOURCE_TYPE, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_PLACER_TYPE, BLOCK_STATE_PROVIDER_TYPE, CARVER, CHUNK_GENERATOR_TYPE, CHUNK_STATUS, CUSTOM_STAT, DECORATOR, DIMENSION_TYPE, ENCHANTMENT, ENTITY_TYPE, FEATURE, FLUID, FOLIAGE_PLACER_TYPE, ITEM, MEMORY_MODULE_TYPE, PAINTING_MOTIVE, PARTICLE_TYPE, POINT_OF_INTEREST_TYPE, POS_RULE_TEST, POTION, RECIPE_SERIALIZER, RECIPE_TYPE, REGISTRIES, RULE_TEST, SCHEDULE, SCREEN_HANDLER, SENSOR_TYPE, SOUND_EVENT, STAT_TYPE, STATUS_EFFECT, STRUCTURE_FEATURE, STRUCTURE_PIECE, STRUCTURE_POOL_ELEMENT, STRUCTURE_PROCESSOR, SURFACE_BUILDER, TREE_DECORATOR_TYPE, TRUNK_PLACER_TYPE, VILLAGER_PROFESSION, VILLAGER_TYPE
Constructor and Description |
---|
SimpleRegistry() |
Modifier and Type | Method and Description |
---|---|
<V extends T> |
add(Identifier id,
V entry) |
boolean |
containsId(Identifier id) |
T |
get(Identifier id) |
T |
get(int index) |
Identifier |
getId(T entry) |
Set<Identifier> |
getIds() |
Optional<T> |
getOrEmpty(Identifier id) |
T |
getRandom(Random random) |
int |
getRawId(T entry) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
<V extends T> |
set(int rawId,
Identifier id,
V entry) |
register, register, register, stream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected static final Logger LOGGER
protected final Int2ObjectBiMap<T> indexedEntries
protected final BiMap<Identifier,T> entries
protected Object[] randomEntries
private int nextId
public <V extends T> V set(int rawId, Identifier id, V entry)
set
in class MutableRegistry<T>
public <V extends T> V add(Identifier id, V entry)
add
in class MutableRegistry<T>
public Optional<T> getOrEmpty(@Nullable Identifier id)
getOrEmpty
in class Registry<T>
public Set<Identifier> getIds()
public boolean isEmpty()
isEmpty
in class MutableRegistry<T>
@Environment(value=CLIENT) public boolean containsId(Identifier id)
containsId
in class Registry<T>