public class SimpleRegistry<T> extends MutableRegistry<T>
| Modifier and Type | Field and Description |
|---|---|
protected BiMap<Identifier,T> |
entriesById |
private BiMap<RegistryKey<T>,T> |
entriesByKey |
protected Int2ObjectBiMap<T> |
indexedEntries |
private Set<RegistryKey<T>> |
loadedKeys |
protected static Logger |
LOGGER |
private int |
nextId |
protected Object[] |
randomEntries |
ACTIVITY, ACTIVITY_KEY, ATTRIBUTE, ATTRIBUTE_KEY, BIOME, BIOME_KEY, BIOME_SOURCE, BIOME_SOURCE_KEY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_KEY, BLOCK_KEY, BLOCK_PLACER_TYPE, BLOCK_PLACER_TYPE_KEY, BLOCK_STATE_PROVIDER_TYPE, BLOCK_STATE_PROVIDER_TYPE_KEY, CARVER, CARVER_KEY, CHUNK_GENERATOR, CHUNK_GENERATOR_KEY, CHUNK_STATUS, CHUNK_STATUS_KEY, CUSTOM_STAT, CUSTOM_STAT_KEY, DECORATOR, DECORATOR_KEY, DIMENSION, DIMENSION_OPTIONS, DIMENSION_TYPE_KEY, ENCHANTMENT, ENCHANTMENT_KEY, ENTITY_TYPE, ENTITY_TYPE_KEY, FEATURE, FEATURE_KEY, FEATURE_SIZE_TYPE, FEATURE_SIZE_TYPE_KEY, FLUID, FLUID_KEY, FOLIAGE_PLACER_TYPE, FOLIAGE_PLACER_TYPE_KEY, ITEM, ITEM_KEY, LOOT_CONDITION_TYPE, LOOT_CONDITION_TYPE_KEY, LOOT_FUNCTION_TYPE, LOOT_FUNCTION_TYPE_KEY, LOOT_POOL_ENTRY_TYPE, LOOT_POOL_ENTRY_TYPE_KEY, MEMORY_MODULE_TYPE, MEMORY_MODULE_TYPE_KEY, MENU_KEY, MOB_EFFECT_KEY, MOTIVE_KEY, PAINTING_MOTIVE, PARTICLE_TYPE, PARTICLE_TYPE_KEY, POINT_OF_INTEREST_TYPE, POINT_OF_INTEREST_TYPE_KEY, POS_RULE_TEST, POS_RULE_TEST_KEY, POTION, POTION_KEY, RECIPE_SERIALIZER, RECIPE_SERIALIZER_KEY, RECIPE_TYPE, RECIPE_TYPE_KEY, REGISTRIES, ROOT, ROOT_KEY, RULE_TEST, RULE_TEST_KEY, SCHEDULE, SCHEDULE_KEY, SCREEN_HANDLER, SENSOR_TYPE, SENSOR_TYPE_KEY, SOUND_EVENT, SOUND_EVENT_KEY, STAT_TYPE, STAT_TYPE_KEY, STATUS_EFFECT, STRUCTURE_FEATURE, STRUCTURE_FEATURE_KEY, STRUCTURE_PIECE, STRUCTURE_PIECE_KEY, STRUCTURE_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_KEY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_KEY, SURFACE_BUILD_KEY, SURFACE_BUILDER, TREE_DECORATOR_TYPE, TREE_DECORATOR_TYPE_KEY, TRUNK_PLACER_TYPE, TRUNK_PLACER_TYPE_KEY, VILLAGER_PROFESSION, VILLAGER_PROFESSION_KEY, VILLAGER_TYPE, VILLAGER_TYPE_KEY| Constructor and Description |
|---|
SimpleRegistry(RegistryKey<Registry<T>> registryKey,
com.mojang.serialization.Lifecycle lifecycle) |
| Modifier and Type | Method and Description |
|---|---|
<V extends T> |
add(RegistryKey<T> key,
V entry) |
boolean |
containsId(Identifier id) |
boolean |
containsId(int id) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
createCodec(RegistryKey<Registry<T>> registryRef,
com.mojang.serialization.Lifecycle lifecycle,
com.mojang.serialization.MapCodec<T> mapCodec) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
createEmptyCodec(RegistryKey<Registry<T>> registryRef,
com.mojang.serialization.Lifecycle lifecycle,
com.mojang.serialization.MapCodec<T> mapCodec) |
T |
get(Identifier id) |
T |
get(int index) |
T |
get(RegistryKey<T> key) |
Set<Map.Entry<RegistryKey<T>,T>> |
getEntries() |
Identifier |
getId(T entry) |
Set<Identifier> |
getIds() |
Optional<RegistryKey<T>> |
getKey(T value) |
Optional<T> |
getOrEmpty(Identifier id) |
T |
getRandom(Random random) |
int |
getRawId(T entry) |
boolean |
isLoaded(RegistryKey<T> registryKey) |
Iterator<T> |
iterator() |
void |
markLoaded(RegistryKey<T> registryKey) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
method_29098(RegistryKey<Registry<T>> registryKey,
com.mojang.serialization.Lifecycle lifecycle,
com.mojang.serialization.MapCodec<T> mapCodec) |
<V extends T> |
set(int rawId,
RegistryKey<T> key,
V entry) |
decode, encode, keys, register, register, register, stream, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomapFlatMap, compoundList, deprecated, dispatch, dispatch, dispatchDeprecated, dispatchDeprecated, dispatchDeprecatedMap, dispatchDeprecatedMap, dispatchMap, dispatchMap, dispatchStable, dispatchStable, dispatchStableMap, dispatchStableMap, either, fieldOf, flatComapMap, flatXmap, list, listOf, mapEither, mapPair, mapResult, of, of, of, of, optionalField, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, pair, partialDispatch, partialDispatchMap, promotePartial, simpleMap, stable, unboundedMap, unit, unit, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withLifecycle, xmapcomap, empty, encodeStart, error, flatComapboxed, decode, error, flatMap, map, ofBoxed, ofSimple, ofTerminal, parse, parse, simple, terminalforEach, spliteratorprotected static final Logger LOGGER
protected final Int2ObjectBiMap<T> indexedEntries
protected final BiMap<Identifier,T> entriesById
private final BiMap<RegistryKey<T>,T> entriesByKey
private final Set<RegistryKey<T>> loadedKeys
protected Object[] randomEntries
private int nextId
public SimpleRegistry(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle)
public <V extends T> V set(int rawId, RegistryKey<T> key, V entry)
set in class MutableRegistry<T>public <V extends T> V add(RegistryKey<T> key, V entry)
add in class MutableRegistry<T>public Optional<T> getOrEmpty(@Nullable Identifier id)
getOrEmpty in class Registry<T>public Set<Identifier> getIds()
public Set<Map.Entry<RegistryKey<T>,T>> getEntries()
public boolean containsId(Identifier id)
containsId in class Registry<T>public boolean containsId(int id)
containsId in class Registry<T>public boolean isLoaded(RegistryKey<T> registryKey)
public void markLoaded(RegistryKey<T> registryKey)
markLoaded in class MutableRegistry<T>public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> method_29098(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle, com.mojang.serialization.MapCodec<T> mapCodec)
public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> createCodec(RegistryKey<Registry<T>> registryRef, com.mojang.serialization.Lifecycle lifecycle, com.mojang.serialization.MapCodec<T> mapCodec)
public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> createEmptyCodec(RegistryKey<Registry<T>> registryRef, com.mojang.serialization.Lifecycle lifecycle, com.mojang.serialization.MapCodec<T> mapCodec)