Package net.minecraftforge.registries
Class NamespacedWrapper<T extends IForgeRegistryEntry<T>>
java.lang.Object
net.minecraft.core.Registry<T>
net.minecraft.core.WritableRegistry<T>
net.minecraft.core.MappedRegistry<T>
net.minecraftforge.registries.NamespacedWrapper<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable
,Iterable<T>
,IdMap<T>
,IHolderHelperHolder<T>
,ILockableRegistry
class NamespacedWrapper<T extends IForgeRegistryEntry<T>>
extends MappedRegistry<T>
implements ILockableRegistry, IHolderHelperHolder<T>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
NamespacedWrapper.Factory<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ForgeRegistry<T>
private com.mojang.serialization.Lifecycle
private final NamespacedHolderHelper<T>
private boolean
private static final org.apache.logging.log4j.Logger
Fields inherited from class net.minecraft.core.Registry
ACTIVITY, ACTIVITY_REGISTRY, ATTRIBUTE, ATTRIBUTE_REGISTRY, BIOME_REGISTRY, BIOME_SOURCE, BIOME_SOURCE_REGISTRY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_REGISTRY, BLOCK_PREDICATE_TYPE_REGISTRY, BLOCK_PREDICATE_TYPES, BLOCK_REGISTRY, BLOCK_STATE_PROVIDER_TYPE_REGISTRY, BLOCKSTATE_PROVIDER_TYPES, CARVER, CARVER_REGISTRY, CHUNK_GENERATOR, CHUNK_GENERATOR_REGISTRY, CHUNK_STATUS, CHUNK_STATUS_REGISTRY, CONDITION, CONDITION_REGISTRY, CONFIGURED_CARVER_REGISTRY, CONFIGURED_FEATURE_REGISTRY, CONFIGURED_STRUCTURE_FEATURE_REGISTRY, CUSTOM_STAT, CUSTOM_STAT_REGISTRY, DENSITY_FUNCTION_REGISTRY, DENSITY_FUNCTION_TYPE_REGISTRY, DENSITY_FUNCTION_TYPES, DIMENSION_REGISTRY, DIMENSION_TYPE_REGISTRY, ENCHANTMENT, ENCHANTMENT_REGISTRY, ENTITY_TYPE, ENTITY_TYPE_REGISTRY, FEATURE, FEATURE_REGISTRY, FEATURE_SIZE_TYPE_REGISTRY, FEATURE_SIZE_TYPES, FLOAT_PROVIDER_TYPE_REGISTRY, FLOAT_PROVIDER_TYPES, FLUID, FLUID_REGISTRY, FOLIAGE_PLACER_TYPE_REGISTRY, FOLIAGE_PLACER_TYPES, GAME_EVENT, GAME_EVENT_REGISTRY, HEIGHT_PROVIDER_TYPE_REGISTRY, HEIGHT_PROVIDER_TYPES, INT_PROVIDER_TYPE_REGISTRY, INT_PROVIDER_TYPES, ITEM, ITEM_REGISTRY, LEVEL_STEM_REGISTRY, LOOT_CONDITION_TYPE, LOOT_ENTRY_REGISTRY, LOOT_FUNCTION_REGISTRY, LOOT_FUNCTION_TYPE, LOOT_ITEM_REGISTRY, LOOT_NBT_PROVIDER_REGISTRY, LOOT_NBT_PROVIDER_TYPE, LOOT_NUMBER_PROVIDER_REGISTRY, LOOT_NUMBER_PROVIDER_TYPE, LOOT_POOL_ENTRY_TYPE, LOOT_SCORE_PROVIDER_REGISTRY, LOOT_SCORE_PROVIDER_TYPE, MEMORY_MODULE_TYPE, MEMORY_MODULE_TYPE_REGISTRY, MENU, MENU_REGISTRY, MOB_EFFECT, MOB_EFFECT_REGISTRY, MOTIVE, MOTIVE_REGISTRY, NOISE_GENERATOR_SETTINGS_REGISTRY, NOISE_REGISTRY, PARTICLE_TYPE, PARTICLE_TYPE_REGISTRY, PLACED_FEATURE_REGISTRY, PLACEMENT_MODIFIER_REGISTRY, PLACEMENT_MODIFIERS, POINT_OF_INTEREST_TYPE, POINT_OF_INTEREST_TYPE_REGISTRY, POS_RULE_TEST, POS_RULE_TEST_REGISTRY, POSITION_SOURCE_TYPE, POSITION_SOURCE_TYPE_REGISTRY, POTION, POTION_REGISTRY, PROCESSOR_LIST_REGISTRY, RECIPE_SERIALIZER, RECIPE_SERIALIZER_REGISTRY, RECIPE_TYPE, RECIPE_TYPE_REGISTRY, REGISTRY, ROOT_REGISTRY_NAME, RULE, RULE_REGISTRY, RULE_TEST, RULE_TEST_REGISTRY, SCHEDULE, SCHEDULE_REGISTRY, SENSOR_TYPE, SENSOR_TYPE_REGISTRY, SOUND_EVENT, SOUND_EVENT_REGISTRY, STAT_TYPE, STAT_TYPE_REGISTRY, STRUCTURE_FEATURE, STRUCTURE_FEATURE_REGISTRY, STRUCTURE_PIECE, STRUCTURE_PIECE_REGISTRY, STRUCTURE_PLACEMENT_TYPE, STRUCTURE_PLACEMENT_TYPE_REGISTRY, STRUCTURE_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_REGISTRY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_REGISTRY, STRUCTURE_SET_REGISTRY, TEMPLATE_POOL_REGISTRY, TREE_DECORATOR_TYPE_REGISTRY, TREE_DECORATOR_TYPES, TRUNK_PLACER_TYPE_REGISTRY, TRUNK_PLACER_TYPES, VILLAGER_PROFESSION, VILLAGER_PROFESSION_REGISTRY, VILLAGER_TYPE, VILLAGER_TYPE_REGISTRY, WRITABLE_REGISTRY
-
Constructor Summary
ConstructorDescriptionNamespacedWrapper
(ForgeRegistry<T> owner, Function<T, Holder.Reference<T>> holderLookup) -
Method Summary
Modifier and TypeMethodDescriptionvoid
byId
(int id) boolean
containsKey
(ResourceKey<T> key) boolean
createIntrusiveHolder
(T value) com.mojang.serialization.Lifecycle
Set<Map.Entry<ResourceKey<T>,
T>> entrySet()
freeze()
get
(ResourceKey<T> name) get
(ResourceLocation name) getHolder
(int id) getHolder
(ResourceKey<T> key) int
getOptional
(ResourceLocation name) getOrCreateHolder
(ResourceKey<T> key) getOrCreateTag
(TagKey<T> name) getResourceKey
(T p_122755_) Stream<com.mojang.datafixers.util.Pair<TagKey<T>,
HolderSet.Named<T>>> getTags()
holders()
boolean
isEmpty()
boolean
isKnownTagName
(TagKey<T> name) iterator()
keySet()
com.mojang.serialization.Lifecycle
void
lock()
Deprecated.Forge: For internal use only.register
(ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) registerMapping
(int id, ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) registerOrOverride
(OptionalInt id, ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) void
int
size()
void
unfreeze()
Deprecated.Methods inherited from class net.minecraft.core.Registry
asHolderIdMap, byNameCodec, checkRegistry, freezeBuiltins, getHolderOrThrow, getOptional, getOrThrow, getTagOrEmpty, holderByNameCodec, key, keys, lifecycle, register, register, register, registerMapping, stream, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.IdMap
byIdOrThrow
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
delegate
-
holders
-
locked
private boolean locked -
elementsLifecycle
private com.mojang.serialization.Lifecycle elementsLifecycle
-
-
Constructor Details
-
NamespacedWrapper
-
-
Method Details
-
registerMapping
public Holder<T> registerMapping(int id, ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) - Overrides:
registerMapping
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
register
public Holder<T> register(ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) - Overrides:
register
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
registerOrOverride
public Holder<T> registerOrOverride(OptionalInt id, ResourceKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle) - Overrides:
registerOrOverride
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
get
- Overrides:
get
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getOptional
- Overrides:
getOptional
in classRegistry<T extends IForgeRegistryEntry<T>>
-
get
- Overrides:
get
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getKey
- Overrides:
getKey
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getResourceKey
- Overrides:
getResourceKey
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
containsKey
- Overrides:
containsKey
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
containsKey
- Overrides:
containsKey
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getId
- Specified by:
getId
in interfaceIdMap<T extends IForgeRegistryEntry<T>>
- Overrides:
getId
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
byId
- Specified by:
byId
in interfaceIdMap<T extends IForgeRegistryEntry<T>>
- Overrides:
byId
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
lifecycle
- Overrides:
lifecycle
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
elementsLifecycle
public com.mojang.serialization.Lifecycle elementsLifecycle()- Overrides:
elementsLifecycle
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
iterator
- Specified by:
iterator
in interfaceIterable<T extends IForgeRegistryEntry<T>>
- Overrides:
iterator
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
keySet
- Overrides:
keySet
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
entrySet
- Overrides:
entrySet
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
isEmpty
public boolean isEmpty()- Overrides:
isEmpty
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
size
public int size()- Specified by:
size
in interfaceIdMap<T extends IForgeRegistryEntry<T>>
- Overrides:
size
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getHolderHelper
- Specified by:
getHolderHelper
in interfaceIHolderHelperHolder<T extends IForgeRegistryEntry<T>>
-
getHolder
- Overrides:
getHolder
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getHolder
- Overrides:
getHolder
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getOrCreateHolder
- Overrides:
getOrCreateHolder
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getRandom
- Overrides:
getRandom
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
holders
- Overrides:
holders
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
isKnownTagName
- Overrides:
isKnownTagName
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getTags
- Overrides:
getTags
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getOrCreateTag
- Overrides:
getOrCreateTag
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getTagNames
- Overrides:
getTagNames
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
freeze
- Overrides:
freeze
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
createIntrusiveHolder
- Overrides:
createIntrusiveHolder
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
getTag
- Overrides:
getTag
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
bindTags
- Overrides:
bindTags
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
resetTags
public void resetTags()- Overrides:
resetTags
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
unfreeze
Deprecated.- Overrides:
unfreeze
in classMappedRegistry<T extends IForgeRegistryEntry<T>>
-
lock
Deprecated.Forge: For internal use only. Use the Register events when registering values.- Specified by:
lock
in interfaceILockableRegistry
-