Package net.minecraft.util.registry
Class DefaultedRegistry<T>
java.lang.Object
net.minecraft.util.registry.Registry<T>
net.minecraft.util.registry.MutableRegistry<T>
net.minecraft.util.registry.SimpleRegistry<T>
net.minecraft.util.registry.DefaultedRegistry<T>
- All Implemented Interfaces:
com.mojang.serialization.Codec<T>
,com.mojang.serialization.Decoder<T>
,com.mojang.serialization.Encoder<T>
,com.mojang.serialization.Keyable
,Iterable<T>
,IndexedIterable<T>
public class DefaultedRegistry<T> extends SimpleRegistry<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.util.registry.SimpleRegistry
SimpleRegistry.RegistryManagerEntry<T>
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object>
-
Field Summary
Fields Modifier and Type Field Description private Identifier
defaultId
private T
defaultValue
Fields inherited from class net.minecraft.util.registry.SimpleRegistry
LOGGER, randomEntries
Fields inherited from class net.minecraft.util.registry.Registry
ACTIVITY, ACTIVITY_KEY, ATTRIBUTE, ATTRIBUTE_KEY, 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, CONFIGURED_CARVER_WORLDGEN, CONFIGURED_FEATURE_WORLDGEN, CONFIGURED_STRUCTURE_FEATURE_WORLDGEN, CONFIGURED_SURFACE_BUILDER_WORLDGEN, 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, NOISE_SETTINGS_WORLDGEN, 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, PROCESSOR_LIST_WORLDGEN, 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, TEMPLATE_POOL_WORLDGEN, TREE_DECORATOR_TYPE, TREE_DECORATOR_TYPE_KEY, TRUNK_PLACER_TYPE, TRUNK_PLACER_TYPE_KEY, VILLAGER_PROFESSION, VILLAGER_PROFESSION_KEY, VILLAGER_TYPE, VILLAGER_TYPE_KEY
Fields inherited from interface com.mojang.serialization.Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
-
Constructor Summary
Constructors Constructor Description DefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle)
-
Method Summary
Modifier and Type Method Description T
get(int index)
T
get(Identifier id)
Identifier
getDefaultId()
Identifier
getId(T entry)
Optional<T>
getOrEmpty(Identifier id)
T
getRandom(Random random)
int
getRawId(T entry)
<V extends T>
Vset(int rawId, RegistryKey<T> key, V entry, com.mojang.serialization.Lifecycle lifecycle)
Methods inherited from class net.minecraft.util.registry.SimpleRegistry
add, containsId, createCodec, createRegistryCodec, createRegistryManagerCodec, createRegistryManagerEntryCodec, get, getEntries, getEntryLifecycle, getIds, getKey, getLifecycle, iterator, replace
Methods inherited from class net.minecraft.util.registry.Registry
decode, encode, getKey, getOrEmpty, getOrThrow, keys, register, register, register, stream, toString, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, withLifecycle, xmap
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminal
Methods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComap
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
defaultId
-
defaultValue
-
-
Constructor Details
-
DefaultedRegistry
public DefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle)
-
-
Method Details
-
set
public <V extends T> V set(int rawId, RegistryKey<T> key, V entry, com.mojang.serialization.Lifecycle lifecycle)- Overrides:
set
in classSimpleRegistry<T>
-
getRawId
- Specified by:
getRawId
in interfaceIndexedIterable<T>
- Overrides:
getRawId
in classSimpleRegistry<T>
-
getId
- Overrides:
getId
in classSimpleRegistry<T>
-
get
- Overrides:
get
in classSimpleRegistry<T>
-
getOrEmpty
- Overrides:
getOrEmpty
in classRegistry<T>
-
get
- Specified by:
get
in interfaceIndexedIterable<T>
- Overrides:
get
in classSimpleRegistry<T>
-
getRandom
- Overrides:
getRandom
in classSimpleRegistry<T>
-
getDefaultId
-