Package net.minecraftforge.registries
Class NamespacedWrapper<T extends IForgeRegistryEntry<T>>
- java.lang.Object
-
- net.minecraft.util.registry.Registry<T>
-
- net.minecraft.util.registry.MutableRegistry<T>
-
- net.minecraft.util.registry.SimpleRegistry<T>
-
- net.minecraftforge.registries.NamespacedWrapper<T>
-
- All Implemented Interfaces:
com.mojang.serialization.Codec<T>
,com.mojang.serialization.Decoder<T>
,com.mojang.serialization.Encoder<T>
,com.mojang.serialization.Keyable
,java.lang.Iterable<T>
,IObjectIntIterable<T>
,ILockableRegistry
class NamespacedWrapper<T extends IForgeRegistryEntry<T>> extends SimpleRegistry<T> implements ILockableRegistry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NamespacedWrapper.Factory<V extends IForgeRegistryEntry<V>>
-
Nested classes/interfaces inherited from class net.minecraft.util.registry.SimpleRegistry
SimpleRegistry.Entry<T>
-
-
Field Summary
Fields Modifier and Type Field Description private ForgeRegistry<T>
delegate
private boolean
locked
private static org.apache.logging.log4j.Logger
LOGGER
-
Fields inherited from class net.minecraft.util.registry.SimpleRegistry
randomCache
-
Fields inherited from class net.minecraft.util.registry.Registry
ACTIVITY, ACTIVITY_REGISTRY, ATTRIBUTE, ATTRIBUTE_REGISTRY, BIOME_REGISTRY, BIOME_SOURCE, BIOME_SOURCE_REGISTRY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_REGISTRY, BLOCK_PLACER_TYPE_REGISTRY, BLOCK_PLACER_TYPES, BLOCK_REGISTRY, BLOCK_STATE_PROVIDER_TYPE_REGISTRY, BLOCKSTATE_PROVIDER_TYPES, CARVER, CARVER_REGISTRY, CHUNK_GENERATOR, CHUNK_GENERATOR_REGISTRY, CHUNK_STATUS, CHUNK_STATUS_REGISTRY, CONFIGURED_CARVER_REGISTRY, CONFIGURED_FEATURE_REGISTRY, CONFIGURED_STRUCTURE_FEATURE_REGISTRY, CONFIGURED_SURFACE_BUILDER_REGISTRY, CUSTOM_STAT, CUSTOM_STAT_REGISTRY, DECORATOR, DECORATOR_REGISTRY, DIMENSION_REGISTRY, DIMENSION_TYPE_REGISTRY, ENCHANTMENT, ENCHANTMENT_REGISTRY, ENTITY_TYPE, ENTITY_TYPE_REGISTRY, FEATURE, FEATURE_REGISTRY, FEATURE_SIZE_TYPE_REGISTRY, FEATURE_SIZE_TYPES, FLUID, FLUID_REGISTRY, FOLIAGE_PLACER_TYPE_REGISTRY, FOLIAGE_PLACER_TYPES, ITEM, ITEM_REGISTRY, LEVEL_STEM_REGISTRY, LOOT_CONDITION_TYPE, LOOT_ENTRY_REGISTRY, LOOT_FUNCTION_REGISTRY, LOOT_FUNCTION_TYPE, LOOT_ITEM_REGISTRY, LOOT_POOL_ENTRY_TYPE, MEMORY_MODULE_TYPE, MEMORY_MODULE_TYPE_REGISTRY, MENU, MENU_REGISTRY, MOB_EFFECT, MOB_EFFECT_REGISTRY, MOTIVE, MOTIVE_REGISTRY, NOISE_GENERATOR_SETTINGS_REGISTRY, PARTICLE_TYPE, PARTICLE_TYPE_REGISTRY, POINT_OF_INTEREST_TYPE, POINT_OF_INTEREST_TYPE_REGISTRY, POS_RULE_TEST, POS_RULE_TEST_REGISTRY, POTION, POTION_REGISTRY, PROCESSOR_LIST_REGISTRY, RECIPE_SERIALIZER, RECIPE_SERIALIZER_REGISTRY, RECIPE_TYPE, RECIPE_TYPE_REGISTRY, REGISTRY, ROOT_REGISTRY_NAME, 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_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_REGISTRY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_REGISTRY, SURFACE_BUILDER, SURFACE_BUILDER_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
Constructors Constructor Description NamespacedWrapper(ForgeRegistry<T> owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
byId(int id)
boolean
containsKey(ResourceLocation key)
java.util.Set<java.util.Map.Entry<RegistryKey<T>,T>>
entrySet()
T
get(RegistryKey<T> name)
T
get(ResourceLocation name)
int
getId(T value)
ResourceLocation
getKey(T value)
java.util.Optional<T>
getOptional(ResourceLocation name)
T
getRandom(java.util.Random random)
java.util.Iterator<T>
iterator()
java.util.Set<ResourceLocation>
keySet()
void
lock()
<R extends T>
Rregister(RegistryKey<T> key, R value, com.mojang.serialization.Lifecycle lifecycle)
<V extends T>
VregisterMapping(int id, RegistryKey<T> key, V value, com.mojang.serialization.Lifecycle lifecycle)
<V extends T>
VregisterOrOverride(java.util.OptionalInt id, RegistryKey<T> key, V value, com.mojang.serialization.Lifecycle lifecycle)
-
Methods inherited from class net.minecraft.util.registry.SimpleRegistry
dataPackCodec, directCodec, elementsLifecycle, getResourceKey, lifecycle, networkCodec, withNameAndId
-
Methods inherited from class net.minecraft.util.registry.Registry
checkRegistry, decode, encode, getOptional, getOrThrow, key, keys, 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 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
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
locked
private boolean locked
-
delegate
private ForgeRegistry<T extends IForgeRegistryEntry<T>> delegate
-
-
Constructor Detail
-
NamespacedWrapper
public NamespacedWrapper(ForgeRegistry<T> owner)
-
-
Method Detail
-
registerMapping
public <V extends T> V registerMapping(int id, RegistryKey<T> key, V value, com.mojang.serialization.Lifecycle lifecycle)
- Overrides:
registerMapping
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
register
public <R extends T> R register(RegistryKey<T> key, R value, com.mojang.serialization.Lifecycle lifecycle)
- Overrides:
register
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
registerOrOverride
public <V extends T> V registerOrOverride(java.util.OptionalInt id, RegistryKey<T> key, V value, com.mojang.serialization.Lifecycle lifecycle)
- Overrides:
registerOrOverride
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
get
@Nullable public T get(@Nullable ResourceLocation name)
- Overrides:
get
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
getOptional
public java.util.Optional<T> getOptional(@Nullable ResourceLocation name)
- Overrides:
getOptional
in classRegistry<T extends IForgeRegistryEntry<T>>
-
get
@Nullable public T get(@Nullable RegistryKey<T> name)
- Overrides:
get
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
getKey
@Nullable public ResourceLocation getKey(T value)
- Overrides:
getKey
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
containsKey
public boolean containsKey(ResourceLocation key)
- Overrides:
containsKey
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
getId
public int getId(@Nullable T value)
- Specified by:
getId
in interfaceIObjectIntIterable<T extends IForgeRegistryEntry<T>>
- Overrides:
getId
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
byId
@Nullable public T byId(int id)
- Specified by:
byId
in interfaceIObjectIntIterable<T extends IForgeRegistryEntry<T>>
- Overrides:
byId
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends IForgeRegistryEntry<T>>
- Overrides:
iterator
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
keySet
public java.util.Set<ResourceLocation> keySet()
- Overrides:
keySet
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
entrySet
public java.util.Set<java.util.Map.Entry<RegistryKey<T>,T>> entrySet()
- Overrides:
entrySet
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
getRandom
@Nullable public T getRandom(java.util.Random random)
- Overrides:
getRandom
in classSimpleRegistry<T extends IForgeRegistryEntry<T>>
-
lock
public void lock()
- Specified by:
lock
in interfaceILockableRegistry
-
-