Package net.minecraftforge.registries
Class ForgeRegistry<V>
java.lang.Object
net.minecraftforge.registries.ForgeRegistry<V>
- All Implemented Interfaces:
- Iterable<V>,- IForgeRegistry<V>,- IForgeRegistryInternal<V>,- IForgeRegistryModifiable<V>
@Internal
public class ForgeRegistry<V>
extends Object
implements IForgeRegistryInternal<V>, IForgeRegistryModifiable<V>
Internal - use the public 
IForgeRegistry and ForgeRegistries APIs to get the data- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static final recordprivate classstatic classNested classes/interfaces inherited from interface net.minecraftforge.registries.IForgeRegistryIForgeRegistry.AddCallback<V>, IForgeRegistry.BakeCallback<V>, IForgeRegistry.ClearCallback<V>, IForgeRegistry.CreateCallback<V>, IForgeRegistry.MissingFactory<V>, IForgeRegistry.ValidateCallback<V>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final IForgeRegistry.AddCallback<V>private final Map<ResourceLocation,ResourceLocation> private final booleanprivate final BitSetprivate final IForgeRegistry.BakeCallback<V>private final it.unimi.dsi.fastutil.ints.IntSetprivate final RegistryBuilder<V>private final IForgeRegistry.ClearCallback<V>private final com.mojang.serialization.Codec<V>private final IForgeRegistry.CreateCallback<V>private final ResourceLocationprivate Vprivate final Map<ResourceLocation,Holder.Reference<V>> private final Map<V,Holder.Reference<V>> private final boolean(package private) booleanprivate final booleanprivate final ResourceKey<Registry<V>>private final com.google.common.collect.BiMap<ResourceKey<V>,V> private static final org.apache.logging.log4j.Loggerprivate final intprivate final intprivate final IForgeRegistry.MissingFactory<V>private final ResourceLocationprivate final com.google.common.collect.BiMap<ResourceLocation,V> private final com.google.common.collect.Multimap<ResourceLocation,V> private final com.google.common.collect.BiMap<ForgeRegistry.OverrideOwner<V>,V> static final org.apache.logging.log4j.Markerprivate static final org.apache.logging.log4j.Marker(package private) final Map<ResourceLocation,?> private final RegistryManagerprivate final ForgeRegistryTagManager<V>private final IForgeRegistry.ValidateCallback<V>
- 
Constructor SummaryConstructorsConstructorDescriptionForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder) 
- 
Method SummaryModifier and TypeMethodDescription(package private) intadd(int id, ResourceLocation key, V value) (package private) intadd(int id, ResourceLocation key, V value, String owner) voidaddAlias(ResourceLocation src, ResourceLocation dst) Adds an alias that maps from the name specified bysrcto the name specified bydst.voidbake()private Holder.Reference<V>bindDelegate(ResourceKey<V> rkey, V value) (package private) voidblock(int id) voidclear()booleanbooleancontainsValue(V value) (package private) ForgeRegistry<V>copy(RegistryManager stage) (package private) voiddump(ResourceLocation name) voidfreeze()Used to control the times where people can modify this registry.(package private) RegistryBuilder<V>@NotNull com.mojang.serialization.Codec<V>getCodec()(package private) V@Nullable ResourceLocation@NotNull Optional<Holder.Reference<V>>getDelegate(ResourceKey<V> rkey) @NotNull Optional<Holder.Reference<V>>@NotNull Optional<Holder.Reference<V>>getDelegate(V value) getDelegateOrThrow(ResourceKey<V> rkey) getDelegateOrThrow(V value) @NotNull Set<Map.Entry<ResourceKey<V>,V>> getHolder(ResourceKey<V> key) This method exists purely as a stopgap for vanilla compatibility.getHolder(ResourceLocation location) This method exists purely as a stopgap for vanilla compatibility.This method exists purely as a stopgap for vanilla compatibility.intgetID(ResourceLocation name) intprivate intgetIDRaw(ResourceLocation name) private int@Nullable ResourceKey<V>getKey(int id) @NotNull Set<ResourceLocation>getKeys()getMissingEvent(ResourceLocation name, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> map) (package private) Map<ResourceLocation,String> getRaw(ResourceLocation key) @NotNull Optional<ResourceKey<V>>getResourceKey(V value) (package private) @NotNull Set<ResourceKey<V>><T> TgetSlaveMap(ResourceLocation name, Class<T> type) Retrieve the slave map of type T from the registry.getValue(int id) getValue(ResourceLocation key) @NotNull Collection<V>(package private) @Nullable NamespacedWrapper<V>(package private) @NotNull NamespacedWrapper<V>booleanisEmpty()booleanisLocked()iterator()voidloadIds(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> ids, Map<ResourceLocation, String> overrides, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remapped, ForgeRegistry<V> old, ResourceLocation name) (package private) voidonBindTags(Map<TagKey<V>, HolderSet.Named<V>> tags, Set<TagKey<V>> defaultedTags) (package private) voidprocessMissingEvent(ResourceLocation name, ForgeRegistry<V> pool, List<MissingMappingsEvent.Mapping<V>> mappings, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) voidregister(int id, ResourceLocation key, V value) voidThe supplied string key will be prefixed with the currently active mod's mod id.voidregister(ResourceLocation key, V value) remove(ResourceLocation key) (package private) voidvoidsetSlaveMap(ResourceLocation name, Object obj) (package private) intsize()(package private) voidsync(ResourceLocation name, ForgeRegistry<V> from) @Nullable ITagManager<V>tags()voidunfreeze()(package private) voidvalidateContent(ResourceLocation registryName) (package private) voidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
REGISTRIESpublic static final org.apache.logging.log4j.Marker REGISTRIES
- 
REGISTRYDUMPprivate static final org.apache.logging.log4j.Marker REGISTRYDUMP
- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
stage
- 
ids
- 
names
- 
keys
- 
aliases
- 
slaves
- 
defaultKey
- 
create
- 
add
- 
clear
- 
validate
- 
bake
- 
missing
- 
availabilityMap
- 
blockedprivate final it.unimi.dsi.fastutil.ints.IntSet blocked
- 
overrides
- 
delegatesByName
- 
delegatesByValue
- 
owners
- 
tagManager
- 
minprivate final int min
- 
maxprivate final int max
- 
allowOverridesprivate final boolean allowOverrides
- 
isModifiableprivate final boolean isModifiable
- 
hasWrapperprivate final boolean hasWrapper
- 
defaultValue
- 
isFrozenboolean isFrozen
- 
name
- 
key
- 
builder
- 
codec
 
- 
- 
Constructor Details- 
ForgeRegistryForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder) 
 
- 
- 
Method Details- 
registerDescription copied from interface:IForgeRegistryThe supplied string key will be prefixed with the currently active mod's mod id. If the supplied name already has a prefix that is different, it will be used and a warning will be logged.- Specified by:
- registerin interface- IForgeRegistry<V>
 
- 
register- Specified by:
- registerin interface- IForgeRegistry<V>
 
- 
iterator
- 
getRegistryName- Specified by:
- getRegistryNamein interface- IForgeRegistry<V>
 
- 
getRegistryKey- Specified by:
- getRegistryKeyin interface- IForgeRegistry<V>
 
- 
getCodec- Specified by:
- getCodecin interface- IForgeRegistry<V>
- See Also:
 
- 
containsKey- Specified by:
- containsKeyin interface- IForgeRegistry<V>
 
- 
containsValue- Specified by:
- containsValuein interface- IForgeRegistry<V>
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- IForgeRegistry<V>
 
- 
sizeint size()
- 
getValue- Specified by:
- getValuein interface- IForgeRegistry<V>
 
- 
getKey- Specified by:
- getKeyin interface- IForgeRegistry<V>
 
- 
getResourceKey- Specified by:
- getResourceKeyin interface- IForgeRegistry<V>
 
- 
getWrapper
- 
getWrapperOrThrow
- 
onBindTags
- 
getHolderDescription copied from interface:IForgeRegistryThis method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags().- Specified by:
- getHolderin interface- IForgeRegistry<V>
- See Also:
 
- 
getHolderDescription copied from interface:IForgeRegistryThis method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags().- Specified by:
- getHolderin interface- IForgeRegistry<V>
 
- 
getHolderDescription copied from interface:IForgeRegistryThis method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags().- Specified by:
- getHolderin interface- IForgeRegistry<V>
 
- 
tags- Specified by:
- tagsin interface- IForgeRegistry<V>
- Returns:
- an instance of ITagManagerif this registry supports tags and/or has a wrapper registry, null otherwise
 
- 
getKeys- Specified by:
- getKeysin interface- IForgeRegistry<V>
 
- 
getResourceKeys
- 
getValues- Specified by:
- getValuesin interface- IForgeRegistry<V>
 
- 
getEntries- Specified by:
- getEntriesin interface- IForgeRegistry<V>
 
- 
getSlaveMapDescription copied from interface:IForgeRegistryRetrieve the slave map of type T from the registry. Slave maps are maps which are dependent on registry content in some way.- Specified by:
- getSlaveMapin interface- IForgeRegistry<V>
- Type Parameters:
- T- Type to return
- Parameters:
- name- The name of the slavemap
- type- The type
- Returns:
- The slavemap if present
 
- 
setSlaveMap- Specified by:
- setSlaveMapin interface- IForgeRegistryInternal<V>
 
- 
getID
- 
getID
- 
getIDRaw
- 
getIDRaw
- 
getValue- Specified by:
- getValuein interface- IForgeRegistryInternal<V>
 
- 
getKey
- 
validateKeyvoid validateKey()
- 
getDefaultKey- Specified by:
- getDefaultKeyin interface- IForgeRegistry<V>
 
- 
copy
- 
register- Specified by:
- registerin interface- IForgeRegistryInternal<V>
 
- 
add
- 
add
- 
getRaw
- 
addAliasAdds an alias that maps from the name specified bysrcto the name specified bydst.Any registry lookups that target the first name will resolve as the second name, if the first name is not present. - Parameters:
- src- The source registry name to alias from.
- dst- The target registry name to alias to. TODO: Add as public API in IForgeRegistry and DeferredRegister.
 
- 
getDelegate- Specified by:
- getDelegatein interface- IForgeRegistry<V>
 
- 
getDelegateOrThrow- Specified by:
- getDelegateOrThrowin interface- IForgeRegistry<V>
 
- 
getDelegate- Specified by:
- getDelegatein interface- IForgeRegistry<V>
 
- 
getDelegateOrThrow- Specified by:
- getDelegateOrThrowin interface- IForgeRegistry<V>
 
- 
getDelegate- Specified by:
- getDelegatein interface- IForgeRegistry<V>
 
- 
getDelegateOrThrow- Specified by:
- getDelegateOrThrowin interface- IForgeRegistry<V>
 
- 
bindDelegate
- 
resetDelegatesvoid resetDelegates()
- 
getDefaultV getDefault()
- 
validateContent
- 
bakepublic void bake()
- 
sync
- 
clearpublic void clear()- Specified by:
- clearin interface- IForgeRegistryModifiable<V>
 
- 
remove- Specified by:
- removein interface- IForgeRegistryModifiable<V>
 
- 
blockvoid block(int id) 
- 
isLockedpublic boolean isLocked()- Specified by:
- isLockedin interface- IForgeRegistryModifiable<V>
 
- 
freezepublic void freeze()Used to control the times where people can modify this registry. Users should only ever register things in the Register<?> events!
- 
unfreezepublic void unfreeze()
- 
dump
- 
loadIdspublic void loadIds(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> ids, Map<ResourceLocation, String> overrides, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remapped, ForgeRegistry<V> old, ResourceLocation name) 
- 
makeSnapshot
- 
getOverrideOwnersMap<ResourceLocation,String> getOverrideOwners()
- 
getMissingEventpublic MissingMappingsEvent getMissingEvent(ResourceLocation name, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> map) 
- 
processMissingEventvoid processMissingEvent(ResourceLocation name, ForgeRegistry<V> pool, List<MissingMappingsEvent.Mapping<V>> mappings, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) 
- 
getBuilderRegistryBuilder<V> getBuilder()
 
-