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.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>>
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 IForgeRegistry.BakeCallback<V> |
bake |
private java.util.Set<java.lang.Integer> |
blocked |
private RegistryBuilder<V> |
builder |
private IForgeRegistry.ClearCallback<V> |
clear |
private IForgeRegistry.CreateCallback<V> |
create |
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 static org.apache.logging.log4j.Logger |
LOGGER |
private int |
max |
private int |
min |
private IForgeRegistry.MissingFactory<V> |
missing |
private ResourceLocation |
name |
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 |
static org.apache.logging.log4j.Marker |
REGISTRIES |
private static org.apache.logging.log4j.Marker |
REGISTRYDUMP |
(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(RegistryManager stage,
ResourceLocation name,
RegistryBuilder<V> builder) |
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) |
void |
bake() |
(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() |
ResourceLocation |
getDefaultKey() |
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(ResourceLocation key) |
(package private) RegistryEvent.Register<V> |
getRegisterEvent(ResourceLocation name) |
ResourceLocation |
getRegistryName() |
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.Collection<V> |
getValues() |
(package private) boolean |
isDummied(ResourceLocation key) |
boolean |
isEmpty() |
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 org.apache.logging.log4j.Marker REGISTRIES
private static org.apache.logging.log4j.Marker REGISTRYDUMP
private static org.apache.logging.log4j.Logger LOGGER
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.BakeCallback<V extends IForgeRegistryEntry<V>> bake
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
private final ResourceLocation name
private final RegistryBuilder<V extends IForgeRegistryEntry<V>> builder
ForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder)
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 ResourceLocation getRegistryName()
getRegistryName
in interface IForgeRegistry<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 boolean isEmpty()
isEmpty
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>>
@Nonnull public java.util.Collection<V> getValues()
getValues
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()
@Nullable public ResourceLocation getDefaultKey()
getDefaultKey
in interface IForgeRegistry<V extends IForgeRegistryEntry<V>>
ForgeRegistry<V> copy(RegistryManager stage)
int add(int id, V value)
int add(int id, V value, java.lang.String owner)
public V getRaw(ResourceLocation key)
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)
public void bake()
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)