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>
,IObjectIntIterable<T>
- Direct Known Subclasses:
MutableRegistry
public abstract class Registry<T>
extends Object
implements com.mojang.serialization.Codec<T>, com.mojang.serialization.Keyable, IObjectIntIterable<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated.static final RegistryKey<Registry<Activity>>
Deprecated.static final RegistryKey<Registry<Attribute>>
static final RegistryKey<Registry<Biome>>
static final Registry<com.mojang.serialization.Codec<? extends BiomeProvider>>
static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends BiomeProvider>>>
static final DefaultedRegistry<Block>
Deprecated.static final Registry<TileEntityType<?>>
Deprecated.static final RegistryKey<Registry<TileEntityType<?>>>
static final RegistryKey<Registry<BlockPlacerType<?>>>
static final Registry<BlockPlacerType<?>>
Deprecated.static final RegistryKey<Registry<Block>>
static final RegistryKey<Registry<BlockStateProviderType<?>>>
static final Registry<BlockStateProviderType<?>>
Deprecated.static final Registry<WorldCarver<?>>
Deprecated.static final RegistryKey<Registry<WorldCarver<?>>>
static final Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>
static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>>
static final DefaultedRegistry<ChunkStatus>
Deprecated.static final RegistryKey<Registry<ChunkStatus>>
static final RegistryKey<Registry<ConfiguredCarver<?>>>
static final RegistryKey<Registry<ConfiguredFeature<?,
?>>> static final RegistryKey<Registry<StructureFeature<?,
?>>> static final RegistryKey<Registry<ConfiguredSurfaceBuilder<?>>>
static final Registry<ResourceLocation>
static final RegistryKey<Registry<ResourceLocation>>
Deprecated.static final RegistryKey<Registry<Placement<?>>>
static final RegistryKey<Registry<World>>
static final RegistryKey<Registry<DimensionType>>
static final Registry<Enchantment>
Deprecated.static final RegistryKey<Registry<Enchantment>>
static final DefaultedRegistry<EntityType<?>>
Deprecated.static final RegistryKey<Registry<EntityType<?>>>
Deprecated.static final RegistryKey<Registry<Feature<?>>>
static final RegistryKey<Registry<FeatureSizeType<?>>>
static final Registry<FeatureSizeType<?>>
static final DefaultedRegistry<Fluid>
Deprecated.static final RegistryKey<Registry<Fluid>>
static final RegistryKey<Registry<FoliagePlacerType<?>>>
static final Registry<FoliagePlacerType<?>>
Deprecated.static final DefaultedRegistry<Item>
Deprecated.static final RegistryKey<Registry<Item>>
private final RegistryKey<? extends Registry<T>>
static final RegistryKey<Registry<Dimension>>
private final com.mojang.serialization.Lifecycle
private static final Map<ResourceLocation,
Supplier<?>> protected static final org.apache.logging.log4j.Logger
static final Registry<LootConditionType>
static final RegistryKey<Registry<LootPoolEntryType>>
static final RegistryKey<Registry<LootFunctionType>>
static final Registry<LootFunctionType>
static final RegistryKey<Registry<LootConditionType>>
static final Registry<LootPoolEntryType>
static final DefaultedRegistry<MemoryModuleType<?>>
Deprecated.static final RegistryKey<Registry<MemoryModuleType<?>>>
static final Registry<ContainerType<?>>
Deprecated.static final RegistryKey<Registry<ContainerType<?>>>
Deprecated.static final RegistryKey<Registry<Effect>>
static final DefaultedRegistry<PaintingType>
Deprecated.static final RegistryKey<Registry<PaintingType>>
static final RegistryKey<Registry<DimensionSettings>>
static final Registry<ParticleType<?>>
Deprecated.static final RegistryKey<Registry<ParticleType<?>>>
static final DefaultedRegistry<PointOfInterestType>
Deprecated.static final RegistryKey<Registry<PointOfInterestType>>
static final Registry<IPosRuleTests<?>>
static final RegistryKey<Registry<IPosRuleTests<?>>>
static final DefaultedRegistry<Potion>
Deprecated.static final RegistryKey<Registry<Potion>>
static final RegistryKey<Registry<StructureProcessorList>>
static final Registry<IRecipeSerializer<?>>
Deprecated.static final RegistryKey<Registry<IRecipeSerializer<?>>>
static final Registry<IRecipeType<?>>
static final RegistryKey<Registry<IRecipeType<?>>>
static final ResourceLocation
static final Registry<IRuleTestType<?>>
static final RegistryKey<Registry<IRuleTestType<?>>>
Deprecated.static final RegistryKey<Registry<Schedule>>
static final DefaultedRegistry<SensorType<?>>
Deprecated.static final RegistryKey<Registry<SensorType<?>>>
static final Registry<SoundEvent>
Deprecated.static final RegistryKey<Registry<SoundEvent>>
Deprecated.static final RegistryKey<Registry<StatType<?>>>
Deprecated.static final RegistryKey<Registry<Structure<?>>>
static final Registry<IStructurePieceType>
static final RegistryKey<Registry<IStructurePieceType>>
static final Registry<IJigsawDeserializer<?>>
static final RegistryKey<Registry<IJigsawDeserializer<?>>>
static final Registry<IStructureProcessorType<?>>
static final RegistryKey<Registry<IStructureProcessorType<?>>>
static final Registry<SurfaceBuilder<?>>
Deprecated.static final RegistryKey<Registry<SurfaceBuilder<?>>>
static final RegistryKey<Registry<JigsawPattern>>
static final RegistryKey<Registry<TreeDecoratorType<?>>>
static final Registry<TreeDecoratorType<?>>
Deprecated.static final RegistryKey<Registry<TrunkPlacerType<?>>>
static final Registry<TrunkPlacerType<?>>
static final DefaultedRegistry<VillagerProfession>
Deprecated.static final RegistryKey<Registry<VillagerProfession>>
static final DefaultedRegistry<VillagerType>
static final RegistryKey<Registry<VillagerType>>
protected static final MutableRegistry<MutableRegistry<?>>
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
ModifierConstructorDescriptionprotected
Registry
(RegistryKey<? extends Registry<T>> p_i232510_1_, com.mojang.serialization.Lifecycle p_i232510_2_) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends MutableRegistry<?>>
voidcheckRegistry
(MutableRegistry<T> p_239738_0_) abstract boolean
containsKey
(ResourceLocation p_212607_1_) private static <T> RegistryKey<Registry<T>>
createRegistryKey
(String p_239741_0_) <U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,
U>> decode
(com.mojang.serialization.DynamicOps<U> p_decode_1_, U p_decode_2_) abstract com.mojang.serialization.Lifecycle
<U> com.mojang.serialization.DataResult<U>
abstract Set<Map.Entry<RegistryKey<T>,
T>> entrySet()
private static <T extends IForgeRegistryEntry<T>>
Registry<T>forge
(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) private static <T extends IForgeRegistryEntry<T>>
DefaultedRegistry<T>forge
(RegistryKey<? extends Registry<T>> key, String defKey, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) private static <T extends IForgeRegistryEntry<T>>
DefaultedRegistry<T>forge
(RegistryKey<? extends Registry<T>> key, String defKey, Supplier<T> def) private static <T extends IForgeRegistryEntry<T>>
Registry<T>forge
(RegistryKey<? extends Registry<T>> key, Supplier<T> def) abstract T
get
(RegistryKey<T> p_230516_1_) abstract T
get
(ResourceLocation p_82594_1_) abstract int
abstract ResourceLocation
getOptional
(RegistryKey<T> p_243575_1_) getOptional
(ResourceLocation p_241873_1_) getOrThrow
(RegistryKey<T> p_243576_1_) abstract Optional<RegistryKey<T>>
getResourceKey
(T p_230519_1_) private static <T,
R extends MutableRegistry<T>>
RinternalRegister
(RegistryKey<? extends Registry<T>> p_239743_0_, R p_239743_1_, Supplier<T> p_239743_2_, com.mojang.serialization.Lifecycle p_239743_3_) RegistryKey<? extends Registry<T>>
key()
<U> Stream<U>
keys
(com.mojang.serialization.DynamicOps<U> p_keys_1_) abstract Set<ResourceLocation>
keySet()
protected abstract com.mojang.serialization.Lifecycle
static <T> T
static <V,
T extends V>
Tregister
(Registry<V> p_218322_0_, ResourceLocation p_218322_1_, T p_218322_2_) private static <T> DefaultedRegistry<T>
registerDefaulted
(RegistryKey<? extends Registry<T>> p_239744_0_, String p_239744_1_, com.mojang.serialization.Lifecycle p_239744_2_, Supplier<T> p_239744_3_) private static <T> DefaultedRegistry<T>
registerDefaulted
(RegistryKey<? extends Registry<T>> p_239745_0_, String p_239745_1_, Supplier<T> p_239745_2_) static <V,
T extends V>
TregisterMapping
(Registry<V> p_218343_0_, int p_218343_1_, String p_218343_2_, T p_218343_3_) private static <T> Registry<T>
registerSimple
(RegistryKey<? extends Registry<T>> p_239742_0_, com.mojang.serialization.Lifecycle p_239742_1_, Supplier<T> p_239742_2_) private static <T> Registry<T>
registerSimple
(RegistryKey<? extends Registry<T>> p_239746_0_, Supplier<T> p_239746_1_) stream()
toString()
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 net.minecraft.util.IObjectIntIterable
byId
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
LOADERS
-
ROOT_REGISTRY_NAME
-
WRITABLE_REGISTRY
-
REGISTRY
-
SOUND_EVENT_REGISTRY
-
FLUID_REGISTRY
-
MOB_EFFECT_REGISTRY
-
BLOCK_REGISTRY
-
ENCHANTMENT_REGISTRY
-
ENTITY_TYPE_REGISTRY
-
ITEM_REGISTRY
-
POTION_REGISTRY
-
PARTICLE_TYPE_REGISTRY
-
BLOCK_ENTITY_TYPE_REGISTRY
-
MOTIVE_REGISTRY
-
CUSTOM_STAT_REGISTRY
-
CHUNK_STATUS_REGISTRY
-
RULE_TEST_REGISTRY
-
POS_RULE_TEST_REGISTRY
-
MENU_REGISTRY
-
RECIPE_TYPE_REGISTRY
-
RECIPE_SERIALIZER_REGISTRY
-
ATTRIBUTE_REGISTRY
-
STAT_TYPE_REGISTRY
-
VILLAGER_TYPE_REGISTRY
-
VILLAGER_PROFESSION_REGISTRY
-
POINT_OF_INTEREST_TYPE_REGISTRY
-
MEMORY_MODULE_TYPE_REGISTRY
-
SENSOR_TYPE_REGISTRY
-
SCHEDULE_REGISTRY
-
ACTIVITY_REGISTRY
-
LOOT_ENTRY_REGISTRY
-
LOOT_FUNCTION_REGISTRY
-
LOOT_ITEM_REGISTRY
-
DIMENSION_TYPE_REGISTRY
-
DIMENSION_REGISTRY
-
LEVEL_STEM_REGISTRY
-
SOUND_EVENT
Deprecated. -
FLUID
Deprecated. -
MOB_EFFECT
Deprecated. -
BLOCK
Deprecated. -
ENCHANTMENT
Deprecated. -
ENTITY_TYPE
Deprecated. -
ITEM
Deprecated. -
POTION
Deprecated. -
PARTICLE_TYPE
Deprecated. -
BLOCK_ENTITY_TYPE
Deprecated. -
MOTIVE
Deprecated. -
CUSTOM_STAT
-
CHUNK_STATUS
Deprecated. -
RULE_TEST
-
POS_RULE_TEST
-
MENU
Deprecated. -
RECIPE_TYPE
-
RECIPE_SERIALIZER
Deprecated. -
ATTRIBUTE
Deprecated. -
STAT_TYPE
Deprecated. -
VILLAGER_TYPE
-
VILLAGER_PROFESSION
Deprecated. -
POINT_OF_INTEREST_TYPE
Deprecated. -
MEMORY_MODULE_TYPE
Deprecated. -
SENSOR_TYPE
Deprecated. -
SCHEDULE
Deprecated. -
ACTIVITY
Deprecated. -
LOOT_POOL_ENTRY_TYPE
-
LOOT_FUNCTION_TYPE
-
LOOT_CONDITION_TYPE
-
NOISE_GENERATOR_SETTINGS_REGISTRY
-
CONFIGURED_SURFACE_BUILDER_REGISTRY
public static final RegistryKey<Registry<ConfiguredSurfaceBuilder<?>>> CONFIGURED_SURFACE_BUILDER_REGISTRY -
CONFIGURED_CARVER_REGISTRY
-
CONFIGURED_FEATURE_REGISTRY
-
CONFIGURED_STRUCTURE_FEATURE_REGISTRY
public static final RegistryKey<Registry<StructureFeature<?,?>>> CONFIGURED_STRUCTURE_FEATURE_REGISTRY -
PROCESSOR_LIST_REGISTRY
-
TEMPLATE_POOL_REGISTRY
-
BIOME_REGISTRY
-
SURFACE_BUILDER_REGISTRY
-
SURFACE_BUILDER
Deprecated. -
CARVER_REGISTRY
-
CARVER
Deprecated. -
FEATURE_REGISTRY
-
FEATURE
Deprecated. -
STRUCTURE_FEATURE_REGISTRY
-
STRUCTURE_FEATURE
Deprecated. -
STRUCTURE_PIECE_REGISTRY
-
STRUCTURE_PIECE
-
DECORATOR_REGISTRY
-
DECORATOR
Deprecated. -
BLOCK_STATE_PROVIDER_TYPE_REGISTRY
public static final RegistryKey<Registry<BlockStateProviderType<?>>> BLOCK_STATE_PROVIDER_TYPE_REGISTRY -
BLOCK_PLACER_TYPE_REGISTRY
-
FOLIAGE_PLACER_TYPE_REGISTRY
-
TRUNK_PLACER_TYPE_REGISTRY
-
TREE_DECORATOR_TYPE_REGISTRY
-
FEATURE_SIZE_TYPE_REGISTRY
-
BIOME_SOURCE_REGISTRY
public static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends BiomeProvider>>> BIOME_SOURCE_REGISTRY -
CHUNK_GENERATOR_REGISTRY
public static final RegistryKey<Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>> CHUNK_GENERATOR_REGISTRY -
STRUCTURE_PROCESSOR_REGISTRY
-
STRUCTURE_POOL_ELEMENT_REGISTRY
-
BLOCKSTATE_PROVIDER_TYPES
Deprecated. -
BLOCK_PLACER_TYPES
Deprecated. -
FOLIAGE_PLACER_TYPES
Deprecated. -
TRUNK_PLACER_TYPES
-
TREE_DECORATOR_TYPES
Deprecated. -
FEATURE_SIZE_TYPES
-
BIOME_SOURCE
-
CHUNK_GENERATOR
public static final Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>> CHUNK_GENERATOR -
STRUCTURE_PROCESSOR
-
STRUCTURE_POOL_ELEMENT
-
key
-
lifecycle
private final com.mojang.serialization.Lifecycle lifecycle
-
-
Constructor Details
-
Registry
protected Registry(RegistryKey<? extends Registry<T>> p_i232510_1_, com.mojang.serialization.Lifecycle p_i232510_2_)
-
-
Method Details
-
createRegistryKey
-
checkRegistry
-
registerSimple
private static <T> Registry<T> registerSimple(RegistryKey<? extends Registry<T>> p_239746_0_, Supplier<T> p_239746_1_) -
forge
private static <T extends IForgeRegistryEntry<T>> Registry<T> forge(RegistryKey<? extends Registry<T>> key, Supplier<T> def) -
registerDefaulted
private static <T> DefaultedRegistry<T> registerDefaulted(RegistryKey<? extends Registry<T>> p_239745_0_, String p_239745_1_, Supplier<T> p_239745_2_) -
forge
private static <T extends IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(RegistryKey<? extends Registry<T>> key, String defKey, Supplier<T> def) -
registerSimple
private static <T> Registry<T> registerSimple(RegistryKey<? extends Registry<T>> p_239742_0_, com.mojang.serialization.Lifecycle p_239742_1_, Supplier<T> p_239742_2_) -
forge
private static <T extends IForgeRegistryEntry<T>> Registry<T> forge(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) -
registerDefaulted
private static <T> DefaultedRegistry<T> registerDefaulted(RegistryKey<? extends Registry<T>> p_239744_0_, String p_239744_1_, com.mojang.serialization.Lifecycle p_239744_2_, Supplier<T> p_239744_3_) -
forge
private static <T extends IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(RegistryKey<? extends Registry<T>> key, String defKey, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) -
internalRegister
private static <T,R extends MutableRegistry<T>> R internalRegister(RegistryKey<? extends Registry<T>> p_239743_0_, R p_239743_1_, Supplier<T> p_239743_2_, com.mojang.serialization.Lifecycle p_239743_3_) -
key
-
toString
-
decode
public <U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,U>> decode(com.mojang.serialization.DynamicOps<U> p_decode_1_, U p_decode_2_) - Specified by:
decode
in interfacecom.mojang.serialization.Decoder<T>
-
encode
public <U> com.mojang.serialization.DataResult<U> encode(T p_encode_1_, com.mojang.serialization.DynamicOps<U> p_encode_2_, U p_encode_3_) - Specified by:
encode
in interfacecom.mojang.serialization.Encoder<T>
-
keys
- Specified by:
keys
in interfacecom.mojang.serialization.Keyable
-
getKey
-
getResourceKey
-
getId
- Specified by:
getId
in interfaceIObjectIntIterable<T>
-
get
-
get
-
lifecycle
-
elementsLifecycle
public abstract com.mojang.serialization.Lifecycle elementsLifecycle() -
getOptional
-
getOptional
-
getOrThrow
-
keySet
-
entrySet
-
stream
-
containsKey
-
register
-
register
public static <V,T extends V> T register(Registry<V> p_218322_0_, ResourceLocation p_218322_1_, T p_218322_2_) -
registerMapping
-