public class ForgeRegistry<V extends IForgeRegistryEntry<V>> extends java.lang.Object implements IForgeRegistryInternal<V>, IForgeRegistryModifiable<V>
Modifier and Type | Class and Description |
---|---|
private static class |
ForgeRegistry.OverrideOwner |
static class |
ForgeRegistry.Snapshot |
IForgeRegistry.AddCallback<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>>
Modifier and Type | Field and Description |
---|---|
private IForgeRegistry.AddCallback<V> |
add |
private java.util.Map<ResourceLocation,ResourceLocation> |
aliases |
private boolean |
allowOverrides |
private java.util.BitSet |
availabilityMap |
private java.util.Set<java.lang.Integer> |
blocked |
private IForgeRegistry.ClearCallback<V> |
clear |
private IForgeRegistry.CreateCallback<V> |
create |
static boolean |
DEBUG |
private ResourceLocation |
defaultKey |
private V |
defaultValue |
private java.util.Set<ResourceLocation> |
dummies |
private IForgeRegistry.DummyFactory<V> |
dummyFactory |
private com.google.common.collect.BiMap<java.lang.Integer,V> |
ids |
private boolean |
isDelegated |
(package private) boolean |
isFrozen |
private boolean |
isModifiable |
private int |
max |
private int |
min |
private IForgeRegistry.MissingFactory<V> |
missing |
private com.google.common.collect.BiMap<ResourceLocation,V> |
names |
private com.google.common.collect.Multimap<ResourceLocation,V> |
overrides |
private com.google.common.collect.BiMap<ForgeRegistry.OverrideOwner,V> |
owners |
(package private) java.util.Map<ResourceLocation,?> |
slaves |
private RegistryManager |
stage |
private java.lang.Class<V> |
superType |
private IForgeRegistry.ValidateCallback<V> |
validate |
Constructor and Description |
---|
ForgeRegistry(java.lang.Class<V> superType,
ResourceLocation defaultKey,
int min,
int max,
IForgeRegistry.CreateCallback<V> create,
IForgeRegistry.AddCallback<V> add,
IForgeRegistry.ClearCallback<V> clear,
IForgeRegistry.ValidateCallback<V> validate,
RegistryManager stage,
boolean allowOverrides,
boolean isModifiable,
IForgeRegistry.DummyFactory<V> dummyFactory,
IForgeRegistry.MissingFactory<V> missing) |
Modifier and Type | Method and Description |
---|---|
(package private) int |
add(int id,
V value) |
(package private) int |
add(int id,
V value,
java.lang.String owner) |
(package private) void |
addAlias(ResourceLocation from,
ResourceLocation to) |
(package private) void |
addDummy(ResourceLocation key) |
(package private) void |
block(int id) |
void |
clear() |
boolean |
containsKey(ResourceLocation key) |
boolean |
containsValue(V value) |
(package private) ForgeRegistry<V> |
copy(RegistryManager stage) |
(package private) void |
dump(ResourceLocation name) |
void |
freeze()
Used to control the times where people can modify this registry.
|
(package private) V |
getDefault() |
private RegistryDelegate<V> |
getDelegate(V thing) |
java.util.Set<java.util.Map.Entry<ResourceLocation,V>> |
getEntries() |
int |
getID(ResourceLocation name) |
int |
getID(V value) |
private int |
getIDRaw(ResourceLocation name) |
private int |
getIDRaw(V value) |
ResourceLocation |
getKey(V value) |
java.util.Set<ResourceLocation> |
getKeys() |
RegistryEvent.MissingMappings<?> |
getMissingEvent(ResourceLocation name,
java.util.Map<ResourceLocation,java.lang.Integer> map) |
(package private) java.util.Map<ResourceLocation,java.lang.String> |
getOverrideOwners() |
V |
getRaw(int id)
Deprecated.
|
private V |
getRaw(ResourceLocation key) |
(package private) RegistryEvent.Register<V> |
getRegisterEvent(ResourceLocation name) |
java.lang.Class<V> |
getRegistrySuperType() |
<T> T |
getSlaveMap(ResourceLocation name,
java.lang.Class<T> type)
Retrieve the slave map of type T from the registry.
|
V |
getValue(int id) |
V |
getValue(ResourceLocation key) |
java.util.List<V> |
getValues()
Deprecated.
use
getValuesCollection() to avoid copying |
java.util.Collection<V> |
getValuesCollection() |
(package private) boolean |
isDummied(ResourceLocation key) |
boolean |
isLocked() |
java.util.Iterator<V> |
iterator() |
void |
loadIds(java.util.Map<ResourceLocation,java.lang.Integer> ids,
java.util.Map<ResourceLocation,java.lang.String> overrides,
java.util.Map<ResourceLocation,java.lang.Integer> missing,
java.util.Map<ResourceLocation,java.lang.Integer[]> remapped,
ForgeRegistry<V> old,
ResourceLocation name) |
ForgeRegistry.Snapshot |
makeSnapshot() |
(package private) boolean |
markDummy(ResourceLocation key,
int id) |
(package private) void |
processMissingEvent(ResourceLocation name,
ForgeRegistry<V> pool,
java.util.List<RegistryEvent.MissingMappings.Mapping<V>> mappings,
java.util.Map<ResourceLocation,java.lang.Integer> missing,
java.util.Map<ResourceLocation,java.lang.Integer[]> remaps,
java.util.Collection<ResourceLocation> defaulted,
java.util.Collection<ResourceLocation> failed,
boolean injectNetworkDummies) |
void |
register(V value) |
void |
registerAll(V... values) |
V |
remove(ResourceLocation key) |
(package private) void |
resetDelegates() |
void |
setSlaveMap(ResourceLocation name,
java.lang.Object obj) |
(package private) void |
sync(ResourceLocation name,
ForgeRegistry<V> from) |
void |
unfreeze() |
(package private) void |
validateContent(ResourceLocation registryName) |
(package private) void |
validateKey() |
public static final boolean DEBUG
private final RegistryManager stage
private final com.google.common.collect.BiMap<java.lang.Integer,V extends IForgeRegistryEntry<V>> ids
private final com.google.common.collect.BiMap<ResourceLocation,V extends IForgeRegistryEntry<V>> names
private final java.lang.Class<V extends IForgeRegistryEntry<V>> superType
private final java.util.Map<ResourceLocation,ResourceLocation> aliases
final java.util.Map<ResourceLocation,?> slaves
private final ResourceLocation defaultKey
private final IForgeRegistry.CreateCallback<V extends IForgeRegistryEntry<V>> create
private final IForgeRegistry.AddCallback<V extends IForgeRegistryEntry<V>> add
private final IForgeRegistry.ClearCallback<V extends IForgeRegistryEntry<V>> clear
private final IForgeRegistry.ValidateCallback<V extends IForgeRegistryEntry<V>> validate
private final IForgeRegistry.MissingFactory<V extends IForgeRegistryEntry<V>> missing
private final java.util.BitSet availabilityMap
private final java.util.Set<ResourceLocation> dummies
private final java.util.Set<java.lang.Integer> blocked
private final com.google.common.collect.Multimap<ResourceLocation,V extends IForgeRegistryEntry<V>> overrides
private final com.google.common.collect.BiMap<ForgeRegistry.OverrideOwner,V extends IForgeRegistryEntry<V>> owners
private final IForgeRegistry.DummyFactory<V extends IForgeRegistryEntry<V>> dummyFactory
private final boolean isDelegated
private final int min
private final int max
private final boolean allowOverrides
private final boolean isModifiable
private V extends IForgeRegistryEntry<V> defaultValue
boolean isFrozen
ForgeRegistry(java.lang.Class<V> superType, ResourceLocation defaultKey, int min, int max, @Nullable IForgeRegistry.CreateCallback<V> create, @Nullable IForgeRegistry.AddCallback<V> add, @Nullable IForgeRegistry.ClearCallback<V> clear, @Nullable IForgeRegistry.ValidateCallback<V> validate, RegistryManager stage, boolean allowOverrides, boolean isModifiable, @Nullable IForgeRegistry.DummyFactory<V> dummyFactory, @Nullable IForgeRegistry.MissingFactory<V> missing)
public void register(V value)
register
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public java.util.Iterator<V> iterator()
iterator
in interface java.lang.Iterable<V extends IForgeRegistryEntry<V>>
public java.lang.Class<V> getRegistrySuperType()
getRegistrySuperType
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public void registerAll(V... values)
registerAll
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public boolean containsKey(ResourceLocation key)
containsKey
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public boolean containsValue(V value)
containsValue
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public V getValue(ResourceLocation key)
getValue
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public ResourceLocation getKey(V value)
getKey
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public java.util.Set<ResourceLocation> getKeys()
getKeys
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
@Deprecated public java.util.List<V> getValues()
getValuesCollection()
to avoid copyinggetValues
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
@Nonnull public java.util.Collection<V> getValuesCollection()
getValuesCollection
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public java.util.Set<java.util.Map.Entry<ResourceLocation,V>> getEntries()
getEntries
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
public <T> T getSlaveMap(ResourceLocation name, java.lang.Class<T> type)
IForgeRegistry
getSlaveMap
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
T
- Type to returnname
- The name of the slavemaptype
- The typepublic void setSlaveMap(ResourceLocation name, java.lang.Object obj)
setSlaveMap
in interface IForgeRegistryInternal<V extends IForgeRegistryEntry<V>>
public int getID(V value)
public int getID(ResourceLocation name)
private int getIDRaw(V value)
private int getIDRaw(ResourceLocation name)
public V getValue(int id)
void validateKey()
ForgeRegistry<V> copy(RegistryManager stage)
int add(int id, V value)
int add(int id, V value, java.lang.String owner)
private V getRaw(ResourceLocation key)
@Deprecated public V getRaw(int id)
void addAlias(ResourceLocation from, ResourceLocation to)
void addDummy(ResourceLocation key)
private RegistryDelegate<V> getDelegate(V thing)
void resetDelegates()
V getDefault()
boolean isDummied(ResourceLocation key)
void validateContent(ResourceLocation registryName)
void sync(ResourceLocation name, ForgeRegistry<V> from)
public void clear()
clear
in interface IForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
public V remove(ResourceLocation key)
remove
in interface IForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
void block(int id)
public boolean isLocked()
isLocked
in interface IForgeRegistryModifiable<V extends IForgeRegistryEntry<V>>
public void freeze()
public void unfreeze()
RegistryEvent.Register<V> getRegisterEvent(ResourceLocation name)
void dump(ResourceLocation name)
public void loadIds(java.util.Map<ResourceLocation,java.lang.Integer> ids, java.util.Map<ResourceLocation,java.lang.String> overrides, java.util.Map<ResourceLocation,java.lang.Integer> missing, java.util.Map<ResourceLocation,java.lang.Integer[]> remapped, ForgeRegistry<V> old, ResourceLocation name)
boolean markDummy(ResourceLocation key, int id)
public ForgeRegistry.Snapshot makeSnapshot()
java.util.Map<ResourceLocation,java.lang.String> getOverrideOwners()
public RegistryEvent.MissingMappings<?> getMissingEvent(ResourceLocation name, java.util.Map<ResourceLocation,java.lang.Integer> map)
void processMissingEvent(ResourceLocation name, ForgeRegistry<V> pool, java.util.List<RegistryEvent.MissingMappings.Mapping<V>> mappings, java.util.Map<ResourceLocation,java.lang.Integer> missing, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.util.Collection<ResourceLocation> defaulted, java.util.Collection<ResourceLocation> failed, boolean injectNetworkDummies)