public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry<I>> extends RegistryNamespacedDefaultedByKey<ResourceLocation,I> implements IForgeRegistry<I>
IForgeRegistry.AddCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.ClearCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.CreateCallback<V extends IForgeRegistryEntry<V>>, IForgeRegistry.SubstitutionCallback<V extends IForgeRegistryEntry<V>>
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
inverseObjectRegistry, underlyingIntegerMap
registryObjects
Modifier and Type | Method and Description |
---|---|
<T extends IForgeRegistryEntry<T>> |
asType(java.lang.Class<? extends T> type) |
void |
blockId(int id) |
boolean |
containsKey(ResourceLocation name)
Determine if the registry has an entry for the specified name.
|
boolean |
containsValue(I value) |
java.util.Set<? extends ResourceLocation> |
getActiveSubstitutions() |
I |
getDefaultValue() |
RegistryDelegate<I> |
getDelegate(I thing,
java.lang.Class<I> clazz) |
java.util.Set<java.util.Map.Entry<ResourceLocation,I>> |
getEntries() |
int |
getId(I thing)
Get the id for the specified object.
|
int |
getId(ResourceLocation itemName)
Get the id for the specified object.
|
ResourceLocation |
getKey(I value) |
java.util.Set<ResourceLocation> |
getKeys() |
ResourceLocation |
getNameForObject(I p_177774_1_) |
I |
getObject(ResourceLocation name)
Fetch the object identified by the specified name or the default object.
|
I |
getObjectById(int id)
Fetch the object identified by the specified id or the default object.
|
I |
getRaw(int id)
Get the object identified by the specified id.
|
java.lang.Class<I> |
getRegistrySuperType() |
<T> T |
getSlaveMap(ResourceLocation slaveMapName,
java.lang.Class<T> type)
Retrieve the slave map of type T from the registry.
|
I |
getValue(ResourceLocation key) |
java.util.List<I> |
getValues() |
boolean |
isDummied(ResourceLocation key) |
java.util.Iterator<I> |
iterator() |
void |
loadAliases(java.util.Map<ResourceLocation,ResourceLocation> aliases) |
void |
loadBlocked(java.util.Set<java.lang.Integer> blocked) |
void |
loadDummied(java.util.Set<ResourceLocation> dummied) |
void |
loadIds(java.util.Map<ResourceLocation,java.lang.Integer> ids,
java.util.Map<ResourceLocation,java.lang.Integer> missingIds,
java.util.Map<ResourceLocation,java.lang.Integer[]> remappedIds,
FMLControlledNamespacedRegistry<I> currentRegistry,
ResourceLocation registryName) |
void |
loadSubstitutions(java.util.Set<ResourceLocation> substitutions) |
void |
notifyCallbacks() |
void |
putObject(ResourceLocation name,
I thing)
Deprecated.
register through
GameRegistry instead. |
void |
register(I value) |
void |
register(int id,
ResourceLocation name,
I thing)
Deprecated.
register through
GameRegistry instead. |
void |
registerAll(I... values) |
void |
serializeAliases(java.util.Map<ResourceLocation,ResourceLocation> map) |
void |
serializeBlockList(java.util.Set<java.lang.Integer> blocked) |
void |
serializeDummied(java.util.Set<ResourceLocation> set) |
void |
serializeIds(java.util.Map<ResourceLocation,java.lang.Integer> idMapping) |
void |
serializeSubstitutions(java.util.Set<ResourceLocation> set) |
java.lang.Iterable<I> |
typeSafeIterable() |
void |
validateKey() |
getIDForObject, getIDForObjectBypass, getNameForObjectBypass, getObjectByIdBypass, getObjectBypass, getRandomObject
createUnderlyingMap
@Deprecated public void register(int id, @Nonnull ResourceLocation name, @Nonnull I thing)
GameRegistry
instead.add(int, net.minecraft.util.ResourceLocation, I)
method.register
in class RegistryNamespacedDefaultedByKey<ResourceLocation,I extends IForgeRegistryEntry<I>>
@Deprecated public void putObject(@Nonnull ResourceLocation name, @Nonnull I thing)
GameRegistry
instead.putObject
in interface IRegistry<ResourceLocation,I extends IForgeRegistryEntry<I>>
putObject
in class RegistrySimple<ResourceLocation,I extends IForgeRegistryEntry<I>>
@Nullable public I getObject(ResourceLocation name)
getObject
in interface IRegistry<ResourceLocation,I extends IForgeRegistryEntry<I>>
getObject
in class RegistryNamespacedDefaultedByKey<ResourceLocation,I extends IForgeRegistryEntry<I>>
name
- Unique name identifying the object.@Nullable public I getObjectById(int id)
getObjectById
in class RegistryNamespacedDefaultedByKey<ResourceLocation,I extends IForgeRegistryEntry<I>>
id
- ID identifying the object.public int getId(@Nullable I thing)
thing
- Block/Item object.@Nullable public I getRaw(int id)
id
- Block/Item id.public boolean containsKey(@Nonnull ResourceLocation name)
containsKey
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
containsKey
in class RegistryNamespaced<ResourceLocation,I extends IForgeRegistryEntry<I>>
name
- Object name to check.public int getId(ResourceLocation itemName)
itemName
- Block/Item registry name.public java.lang.Iterable<I> typeSafeIterable()
public void serializeIds(java.util.Map<ResourceLocation,java.lang.Integer> idMapping)
public void serializeAliases(java.util.Map<ResourceLocation,ResourceLocation> map)
public void serializeSubstitutions(java.util.Set<ResourceLocation> set)
public void serializeDummied(java.util.Set<ResourceLocation> set)
public boolean isDummied(ResourceLocation key)
@Nullable public I getDefaultValue()
public RegistryDelegate<I> getDelegate(I thing, java.lang.Class<I> clazz)
public void validateKey()
validateKey
in class RegistryNamespacedDefaultedByKey<ResourceLocation,I extends IForgeRegistryEntry<I>>
@Nonnull public java.util.Iterator<I> iterator()
iterator
in interface java.lang.Iterable<I extends IForgeRegistryEntry<I>>
iterator
in class RegistryNamespaced<ResourceLocation,I extends IForgeRegistryEntry<I>>
public <T extends IForgeRegistryEntry<T>> FMLControlledNamespacedRegistry<T> asType(java.lang.Class<? extends T> type)
public void serializeBlockList(java.util.Set<java.lang.Integer> blocked)
public java.util.Set<? extends ResourceLocation> getActiveSubstitutions()
public void loadAliases(java.util.Map<ResourceLocation,ResourceLocation> aliases)
public void loadSubstitutions(java.util.Set<ResourceLocation> substitutions)
public void loadBlocked(java.util.Set<java.lang.Integer> blocked)
public void loadDummied(java.util.Set<ResourceLocation> dummied)
public void loadIds(java.util.Map<ResourceLocation,java.lang.Integer> ids, java.util.Map<ResourceLocation,java.lang.Integer> missingIds, java.util.Map<ResourceLocation,java.lang.Integer[]> remappedIds, FMLControlledNamespacedRegistry<I> currentRegistry, ResourceLocation registryName)
public void blockId(int id)
public void notifyCallbacks()
@Nullable public ResourceLocation getNameForObject(@Nonnull I p_177774_1_)
getNameForObject
in class RegistryNamespacedDefaultedByKey<ResourceLocation,I extends IForgeRegistryEntry<I>>
public java.lang.Class<I> getRegistrySuperType()
getRegistrySuperType
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
public void register(@Nonnull I value)
register
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
public void registerAll(I... values)
registerAll
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
public boolean containsValue(@Nonnull I value)
containsValue
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
public I getValue(ResourceLocation key)
getValue
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
@Nullable public ResourceLocation getKey(I value)
getKey
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
@Nonnull public java.util.Set<ResourceLocation> getKeys()
getKeys
in interface IRegistry<ResourceLocation,I extends IForgeRegistryEntry<I>>
getKeys
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
getKeys
in class RegistrySimple<ResourceLocation,I extends IForgeRegistryEntry<I>>
@Nonnull public java.util.List<I> getValues()
getValues
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
@Nonnull public java.util.Set<java.util.Map.Entry<ResourceLocation,I>> getEntries()
getEntries
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
public <T> T getSlaveMap(ResourceLocation slaveMapName, java.lang.Class<T> type)
IForgeRegistry
getSlaveMap
in interface IForgeRegistry<I extends IForgeRegistryEntry<I>>
T
- Type to returnslaveMapName
- The name of the slavemaptype
- The type