public class DefaultedRegistry<T> extends SimpleRegistry<T>
Modifier and Type | Field and Description |
---|---|
private T |
defaultValue |
private ResourceLocation |
defaultValueKey |
LOGGER0, registryObjects, underlyingIntegerMap, 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 |
---|
DefaultedRegistry(java.lang.String defaultName) |
Modifier and Type | Method and Description |
---|---|
T |
getByValue(int value) |
ResourceLocation |
getDefaultKey() |
int |
getId(T value) |
ResourceLocation |
getKey(T value) |
T |
getOrDefault(ResourceLocation name) |
T |
getRandom(java.util.Random random) |
<V extends T> |
register(int id,
ResourceLocation name,
V instance) |
containsKey, getValue, isEmpty, iterator, keySet, register
register, register, register, stream
private final ResourceLocation defaultValueKey
private T defaultValue
public <V extends T> V register(int id, ResourceLocation name, V instance)
register
in class SimpleRegistry<T>
public int getId(@Nullable T value)
getId
in class SimpleRegistry<T>
@Nonnull public ResourceLocation getKey(T value)
getKey
in class SimpleRegistry<T>
@Nonnull public T getOrDefault(@Nullable ResourceLocation name)
getOrDefault
in class SimpleRegistry<T>
@Nonnull public T getByValue(int value)
getByValue
in interface IObjectIntIterable<T>
getByValue
in class SimpleRegistry<T>
@Nonnull public T getRandom(java.util.Random random)
getRandom
in class SimpleRegistry<T>
public ResourceLocation getDefaultKey()