public class SimpleRegistry<T> extends MutableRegistry<T>
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
LOGGER0 |
private int |
nextFreeId |
protected com.google.common.collect.BiMap<ResourceLocation,T> |
registryObjects |
protected IntIdentityHashBiMap<T> |
underlyingIntegerMap |
protected java.lang.Object[] |
values |
ACTIVITY, 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, EFFECTS, ENCHANTMENT, ENTITY_TYPE, FEATURE, FLUID, FOLIAGE_PLACER_TYPE, ITEM, LOGGER, MEMORY_MODULE_TYPE, MENU, MOTIVE, PARTICLE_TYPE, POINT_OF_INTEREST_TYPE, POTION, RECIPE_SERIALIZER, RECIPE_TYPE, REGISTRY, RULE_TEST, SCHEDULE, SENSOR_TYPE, SOUND_EVENT, STATS, STRUCTURE_FEATURE, STRUCTURE_PIECE, STRUCTURE_POOL_ELEMENT, STRUCTURE_PROCESSOR, SURFACE_BUILDER, TREE_DECORATOR_TYPE, VILLAGER_PROFESSION, VILLAGER_TYPE
Constructor and Description |
---|
SimpleRegistry() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(ResourceLocation name) |
T |
getByValue(int value) |
int |
getId(T value) |
ResourceLocation |
getKey(T value) |
T |
getOrDefault(ResourceLocation name) |
T |
getRandom(java.util.Random random) |
java.util.Optional<T> |
getValue(ResourceLocation key) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
java.util.Set<ResourceLocation> |
keySet() |
<V extends T> |
register(int id,
ResourceLocation name,
V instance) |
<V extends T> |
register(ResourceLocation name,
V instance) |
register, register, register, stream
protected static final org.apache.logging.log4j.Logger LOGGER0
protected final IntIdentityHashBiMap<T> underlyingIntegerMap
protected final com.google.common.collect.BiMap<ResourceLocation,T> registryObjects
protected java.lang.Object[] values
private int nextFreeId
public <V extends T> V register(int id, ResourceLocation name, V instance)
register
in class MutableRegistry<T>
public <V extends T> V register(ResourceLocation name, V instance)
register
in class MutableRegistry<T>
@Nullable public ResourceLocation getKey(T value)
@Nullable public T getByValue(int value)
public java.util.Iterator<T> iterator()
@Nullable public T getOrDefault(@Nullable ResourceLocation name)
getOrDefault
in class Registry<T>
public java.util.Optional<T> getValue(@Nullable ResourceLocation key)
public java.util.Set<ResourceLocation> keySet()
public boolean isEmpty()
isEmpty
in class MutableRegistry<T>
@Nullable public T getRandom(java.util.Random random)
public boolean containsKey(ResourceLocation name)
containsKey
in class Registry<T>