Package net.minecraft.util.registry
Class Registry<T>
java.lang.Object
net.minecraft.util.registry.Registry<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>
- Direct Known Subclasses:
MutableRegistry
public abstract class Registry<T> extends Object implements com.mojang.serialization.Codec<T>, com.mojang.serialization.Keyable, IndexedIterable<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object> -
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedRegistry(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle) -
Method Summary
Modifier and Type Method Description abstract booleancontainsId(int id)abstract booleancontainsId(Identifier id)private static <T> Registry<T>create(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle, Supplier<T> defaultEntry)private static <T> DefaultedRegistry<T>create(RegistryKey<Registry<T>> registryKey, String defaultId, com.mojang.serialization.Lifecycle lifecycle, Supplier<T> defaultEntry)private static <T> DefaultedRegistry<T>create(RegistryKey<Registry<T>> registryKey, String defaultId, Supplier<T> defaultEntry)private static <T> Registry<T>create(RegistryKey<Registry<T>> registryKey, Supplier<T> defaultEntry)private static <T, R extends MutableRegistry<T>>
Rcreate(RegistryKey<Registry<T>> registryKey, R registry, Supplier<T> defaultEntry)private static <T> RegistryKey<Registry<T>>createRegistryKey(String registryId)<U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,U>>decode(com.mojang.serialization.DynamicOps<U> dynamicOps, U u)<U> com.mojang.serialization.DataResult<U>encode(T t, com.mojang.serialization.DynamicOps<U> dynamicOps, U u)abstract Tget(Identifier id)abstract Tget(RegistryKey<T> key)abstract IdentifiergetId(T entry)abstract Set<Identifier>getIds()abstract Optional<RegistryKey<T>>getKey(T value)abstract Optional<T>getOrEmpty(Identifier id)abstract intgetRawId(T entry)abstract booleanisLoaded(RegistryKey<T> registryKey)<U> Stream<U>keys(com.mojang.serialization.DynamicOps<U> dynamicOps)static <T> Tregister(Registry<? super T> registry, String id, T entry)static <V, T extends V>
Tregister(Registry<V> registry, int rawId, String id, T entry)static <V, T extends V>
Tregister(Registry<V> registry, Identifier id, T entry)Stream<T>stream()StringtoString()private static <T extends MutableRegistry<?>>
voidvalidate(MutableRegistry<T> registry)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchDeprecated, dispatchDeprecated, dispatchDeprecatedMap, dispatchDeprecatedMap, dispatchMap, dispatchMap, dispatchStable, dispatchStable, dispatchStableMap, dispatchStableMap, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, partialDispatch, partialDispatchMap, promotePartial, stable, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withLifecycle, xmap
-
Field Details
-
LOGGER
-
DEFAULT_ENTRIES
-
ROOT_KEY
-
ROOT
-
REGISTRIES
-
SOUND_EVENT_KEY
-
FLUID_KEY
-
MOB_EFFECT_KEY
-
BLOCK_KEY
-
ENCHANTMENT_KEY
-
ENTITY_TYPE_KEY
-
ITEM_KEY
-
POTION_KEY
-
CARVER_KEY
-
SURFACE_BUILD_KEY
-
FEATURE_KEY
-
DECORATOR_KEY
-
BIOME_KEY
-
BLOCK_STATE_PROVIDER_TYPE_KEY
-
BLOCK_PLACER_TYPE_KEY
-
FOLIAGE_PLACER_TYPE_KEY
-
TRUNK_PLACER_TYPE_KEY
-
TREE_DECORATOR_TYPE_KEY
-
FEATURE_SIZE_TYPE_KEY
-
PARTICLE_TYPE_KEY
-
BIOME_SOURCE_KEY
public static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends BiomeSource>>> BIOME_SOURCE_KEY -
CHUNK_GENERATOR_KEY
public static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>> CHUNK_GENERATOR_KEY -
BLOCK_ENTITY_TYPE_KEY
-
MOTIVE_KEY
-
CUSTOM_STAT_KEY
-
CHUNK_STATUS_KEY
-
STRUCTURE_FEATURE_KEY
-
STRUCTURE_PIECE_KEY
-
RULE_TEST_KEY
-
POS_RULE_TEST_KEY
-
STRUCTURE_PROCESSOR_KEY
-
STRUCTURE_POOL_ELEMENT_KEY
-
MENU_KEY
-
RECIPE_TYPE_KEY
-
RECIPE_SERIALIZER_KEY
-
ATTRIBUTE_KEY
-
STAT_TYPE_KEY
-
VILLAGER_TYPE_KEY
-
VILLAGER_PROFESSION_KEY
-
POINT_OF_INTEREST_TYPE_KEY
-
MEMORY_MODULE_TYPE_KEY
-
SENSOR_TYPE_KEY
-
SCHEDULE_KEY
-
ACTIVITY_KEY
-
LOOT_POOL_ENTRY_TYPE_KEY
-
LOOT_FUNCTION_TYPE_KEY
-
LOOT_CONDITION_TYPE_KEY
-
DIMENSION_TYPE_KEY
-
DIMENSION
-
DIMENSION_OPTIONS
-
SOUND_EVENT
-
FLUID
-
STATUS_EFFECT
-
BLOCK
-
ENCHANTMENT
-
ENTITY_TYPE
-
ITEM
-
POTION
-
CARVER
-
SURFACE_BUILDER
-
FEATURE
-
DECORATOR
-
BIOME
-
BLOCK_STATE_PROVIDER_TYPE
-
BLOCK_PLACER_TYPE
-
FOLIAGE_PLACER_TYPE
-
TRUNK_PLACER_TYPE
-
TREE_DECORATOR_TYPE
-
FEATURE_SIZE_TYPE
-
PARTICLE_TYPE
-
BIOME_SOURCE
-
CHUNK_GENERATOR
public static final Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>> CHUNK_GENERATOR -
BLOCK_ENTITY_TYPE
-
PAINTING_MOTIVE
-
CUSTOM_STAT
-
CHUNK_STATUS
-
STRUCTURE_FEATURE
-
STRUCTURE_PIECE
-
RULE_TEST
-
POS_RULE_TEST
-
STRUCTURE_PROCESSOR
-
STRUCTURE_POOL_ELEMENT
-
SCREEN_HANDLER
-
RECIPE_TYPE
-
RECIPE_SERIALIZER
-
ATTRIBUTE
-
STAT_TYPE
-
VILLAGER_TYPE
-
VILLAGER_PROFESSION
-
POINT_OF_INTEREST_TYPE
-
MEMORY_MODULE_TYPE
-
SENSOR_TYPE
-
SCHEDULE
-
ACTIVITY
-
LOOT_POOL_ENTRY_TYPE
-
LOOT_FUNCTION_TYPE
-
LOOT_CONDITION_TYPE
-
registryKey
The RegistryKey representing the ID of the actual registry. -
lifecycle
private final com.mojang.serialization.Lifecycle lifecycle
-
-
Constructor Details
-
Registry
protected Registry(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle)
-
-
Method Details
-
createRegistryKey
-
validate
-
create
private static <T> Registry<T> create(RegistryKey<Registry<T>> registryKey, Supplier<T> defaultEntry) -
create
private static <T> DefaultedRegistry<T> create(RegistryKey<Registry<T>> registryKey, String defaultId, Supplier<T> defaultEntry) -
create
private static <T> Registry<T> create(RegistryKey<Registry<T>> registryKey, com.mojang.serialization.Lifecycle lifecycle, Supplier<T> defaultEntry) -
create
private static <T> DefaultedRegistry<T> create(RegistryKey<Registry<T>> registryKey, String defaultId, com.mojang.serialization.Lifecycle lifecycle, Supplier<T> defaultEntry) -
create
private static <T, R extends MutableRegistry<T>> R create(RegistryKey<Registry<T>> registryKey, R registry, Supplier<T> defaultEntry) -
toString
-
decode
public <U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,U>> decode(com.mojang.serialization.DynamicOps<U> dynamicOps, U u)- Specified by:
decodein interfacecom.mojang.serialization.Decoder<T>
-
encode
public <U> com.mojang.serialization.DataResult<U> encode(T t, com.mojang.serialization.DynamicOps<U> dynamicOps, U u)- Specified by:
encodein interfacecom.mojang.serialization.Encoder<T>
-
keys
- Specified by:
keysin interfacecom.mojang.serialization.Keyable
-
getId
-
getKey
-
getRawId
-
get
-
get
-
getOrEmpty
-
getIds
-
stream
-
containsId
-
isLoaded
-
containsId
public abstract boolean containsId(int id) -
register
-
register
-
register
-