Package net.minecraftforge.registries
Class ForgeRegistry<V extends IForgeRegistryEntry<V>>
java.lang.Object
net.minecraftforge.registries.ForgeRegistry<V>
- All Implemented Interfaces:
Iterable<V>,IForgeRegistry<V>,IForgeRegistryInternal<V>,IForgeRegistryModifiable<V>
public class ForgeRegistry<V extends IForgeRegistryEntry<V>>
extends Object
implements IForgeRegistryInternal<V>, IForgeRegistryModifiable<V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classstatic classNested classes/interfaces inherited from interface net.minecraftforge.registries.IForgeRegistry
IForgeRegistry.AddCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.BakeCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.ClearCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.CreateCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.DummyFactory<V extends IForgeRegistryEntry<V>>, IForgeRegistry.MissingFactory<V extends IForgeRegistryEntry<V>>, IForgeRegistry.ValidateCallback<V extends IForgeRegistryEntry<V>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IForgeRegistry.AddCallback<V>private final Map<ResourceLocation,ResourceLocation> private final booleanprivate final BitSetprivate final IForgeRegistry.BakeCallback<V>private final RegistryBuilder<V>private final IForgeRegistry.ClearCallback<V>private final IForgeRegistry.CreateCallback<V>private final ResourceLocationprivate Vprivate final Set<ResourceLocation>private final IForgeRegistry.DummyFactory<V>private final boolean(package private) booleanprivate final booleanprivate final RegistryKey<Registry<V>>private final com.google.common.collect.BiMap<RegistryKey<V>,V> private static 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> static org.apache.logging.log4j.Markerprivate static org.apache.logging.log4j.Marker(package private) final Map<ResourceLocation,?> private final RegistryManagerprivate final Stringprivate final IForgeRegistry.ValidateCallback<V> -
Constructor Summary
ConstructorsConstructorDescriptionForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder) -
Method Summary
Modifier and TypeMethodDescription(package private) int(package private) int(package private) voidaddAlias(ResourceLocation from, ResourceLocation to) (package private) voidaddDummy(ResourceLocation key) voidbake()(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) Vprivate RegistryDelegate<V>getDelegate(V thing) Set<Map.Entry<RegistryKey<V>,V>> intgetID(ResourceLocation name) intprivate intgetIDRaw(ResourceLocation name) private intgetKey(int id) getKeys()getMissingEvent(ResourceLocation name, Map<ResourceLocation, Integer> map) (package private) Map<ResourceLocation,String> getRaw(ResourceLocation key) (package private) RegistryEvent.Register<V><T> TgetSlaveMap(ResourceLocation name, Class<T> type) Retrieve the slave map of type T from the registry.getValue(int id) getValue(ResourceLocation key) (package private) booleanbooleanisEmpty()booleanisLocked()iterator()voidloadIds(Map<ResourceLocation, Integer> ids, Map<ResourceLocation, String> overrides, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remapped, ForgeRegistry<V> old, ResourceLocation name) (package private) booleanmarkDummy(ResourceLocation key, int id) (package private) voidprocessMissingEvent(ResourceLocation name, ForgeRegistry<V> pool, List<RegistryEvent.MissingMappings.Mapping<V>> mappings, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) voidvoidregisterAll(V... values) remove(ResourceLocation key) (package private) voidvoidsetSlaveMap(ResourceLocation name, Object obj) (package private) voidsync(ResourceLocation name, ForgeRegistry<V> from) voidunfreeze()(package private) voidvalidateContent(ResourceLocation registryName) (package private) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
REGISTRIES
public static org.apache.logging.log4j.Marker REGISTRIES -
REGISTRYDUMP
private static org.apache.logging.log4j.Marker REGISTRYDUMP -
LOGGER
private static org.apache.logging.log4j.Logger LOGGER -
stage
-
ids
-
names
private final com.google.common.collect.BiMap<ResourceLocation,V extends IForgeRegistryEntry<V>> names -
keys
private final com.google.common.collect.BiMap<RegistryKey<V extends IForgeRegistryEntry<V>>,V extends IForgeRegistryEntry<V>> keys -
superType
-
aliases
-
slaves
-
defaultKey
-
create
-
add
-
clear
-
validate
-
bake
-
missing
-
availabilityMap
-
dummies
-
blocked
-
overrides
private final com.google.common.collect.Multimap<ResourceLocation,V extends IForgeRegistryEntry<V>> overrides -
owners
private final com.google.common.collect.BiMap<ForgeRegistry.OverrideOwner,V extends IForgeRegistryEntry<V>> owners -
dummyFactory
-
isDelegated
private final boolean isDelegated -
min
private final int min -
max
private final int max -
allowOverrides
private final boolean allowOverrides -
isModifiable
private final boolean isModifiable -
tagFolder
-
defaultValue
-
isFrozen
boolean isFrozen -
name
-
key
-
builder
-
-
Constructor Details
-
ForgeRegistry
ForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder)
-
-
Method Details
-
register
- Specified by:
registerin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
iterator
- Specified by:
iteratorin interfaceIterable<V extends IForgeRegistryEntry<V>>
-
getRegistryName
- Specified by:
getRegistryNamein interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getRegistryKey
-
getRegistrySuperType
- Specified by:
getRegistrySuperTypein interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getTagFolder
-
registerAll
- Specified by:
registerAllin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
containsKey
- Specified by:
containsKeyin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
containsValue
- Specified by:
containsValuein interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getValue
- Specified by:
getValuein interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getKey
- Specified by:
getKeyin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getKeys
- Specified by:
getKeysin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getValues
- Specified by:
getValuesin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getEntries
- Specified by:
getEntriesin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
getSlaveMap
Description 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 interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>- Type Parameters:
T- Type to return- Parameters:
name- The name of the slavemaptype- The type- Returns:
- The slavemap if present
-
setSlaveMap
- Specified by:
setSlaveMapin interfaceIForgeRegistryInternal<V extends IForgeRegistryEntry<V>>
-
getID
-
getID
-
getIDRaw
-
getIDRaw
-
getValue
-
getKey
-
validateKey
void validateKey() -
getDefaultKey
- Specified by:
getDefaultKeyin interfaceIForgeRegistry<V extends IForgeRegistryEntry<V>>
-
copy
-
add
-
add
-
getRaw
-
addAlias
-
addDummy
-
getDelegate
-
resetDelegates
void resetDelegates() -
getDefault
V getDefault() -
isDummied
-
validateContent
-
bake
public void bake() -
sync
-
clear
public void clear()- Specified by:
clearin interfaceIForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
-
remove
- Specified by:
removein interfaceIForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
-
block
void block(int id) -
isLocked
public boolean isLocked()- Specified by:
isLockedin interfaceIForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
-
freeze
public void freeze()Used to control the times where people can modify this registry. Users should only ever register things in the Register<?> events! -
unfreeze
public void unfreeze() -
getRegisterEvent
-
dump
-
loadIds
public void loadIds(Map<ResourceLocation, Integer> ids, Map<ResourceLocation, String> overrides, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remapped, ForgeRegistry<V> old, ResourceLocation name) -
markDummy
-
makeSnapshot
-
getOverrideOwners
Map<ResourceLocation,String> getOverrideOwners() -
getMissingEvent
public RegistryEvent.MissingMappings<?> getMissingEvent(ResourceLocation name, Map<ResourceLocation, Integer> map) -
processMissingEvent
void processMissingEvent(ResourceLocation name, ForgeRegistry<V> pool, List<RegistryEvent.MissingMappings.Mapping<V>> mappings, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies)
-