类 ForgeRegistry<V>
java.lang.Object
net.minecraftforge.registries.ForgeRegistry<V>
- 所有已实现的接口:
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-
嵌套类概要
嵌套类修饰符和类型类说明private static final record
private static final record
private class
static class
从接口继承的嵌套类/接口 net.minecraftforge.registries.IForgeRegistry
IForgeRegistry.AddCallback<V>, IForgeRegistry.BakeCallback<V>, IForgeRegistry.ClearCallback<V>, IForgeRegistry.CreateCallback<V>, IForgeRegistry.MissingFactory<V>, IForgeRegistry.SlaveKey<T>, IForgeRegistry.ValidateCallback<V>
-
字段概要
字段修饰符和类型字段说明private final IForgeRegistry.AddCallback
<V> private final Map
<ResourceLocation, ResourceLocation> private final boolean
private final BitSet
private final IForgeRegistry.BakeCallback
<V> private final it.unimi.dsi.fastutil.ints.IntSet
private final RegistryBuilder
<V> private final IForgeRegistry.ClearCallback
<V> private final com.mojang.serialization.Codec
<V> private final IForgeRegistry.CreateCallback
<V> private final ResourceLocation
private V
private final Map
<ResourceLocation, Holder.Reference<V>> private final Map
<V, Holder.Reference<V>> private final boolean
(专用程序包) boolean
private final boolean
private final ResourceKey
<Registry<V>> private final com.google.common.collect.BiMap
<ResourceKey<V>, V> private static final org.apache.logging.log4j.Logger
private final int
private final int
private final IForgeRegistry.MissingFactory
<V> private final ResourceLocation
private 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.Marker
private static final org.apache.logging.log4j.Marker
(专用程序包) final Map
<IForgeRegistry.SlaveKey<?>, ?> private final RegistryManager
private final ForgeRegistryTagManager
<V> private final IForgeRegistry.ValidateCallback
<V> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明(专用程序包) int
add
(int id, ResourceLocation key, V value) (专用程序包) int
add
(int id, ResourceLocation key, V value, String owner) void
addAlias
(ResourceLocation src, ResourceLocation dst) Adds an alias that maps from the name specified bysrc
to the name specified bydst
.void
bake()
private Holder.Reference
<V> bindDelegate
(ResourceKey<V> rkey, V value) (专用程序包) void
block
(int id) void
clear()
boolean
boolean
containsValue
(V value) (专用程序包) ForgeRegistry
<V> copy
(RegistryManager stage) (专用程序包) void
dump
(ResourceLocation name) void
freeze()
Used to control the times where people can modify this registry.(专用程序包) RegistryBuilder
<V> @NotNull com.mojang.serialization.Codec
<V> getCodec()
(专用程序包) 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.int
getID
(ResourceLocation name) int
private int
getIDRaw
(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) (专用程序包) Map
<ResourceLocation, String> getRaw
(ResourceLocation key) @NotNull Optional
<ResourceKey<V>> getResourceKey
(V value) (专用程序包) @NotNull Set
<ResourceKey<V>> <T> T
getSlaveMap
(IForgeRegistry.SlaveKey<T> key) Retrieve the slave map of type T from the registry.getValue
(int id) getValue
(ResourceLocation key) @NotNull Collection
<V> (专用程序包) @Nullable NamespacedWrapper
<V> (专用程序包) @NotNull NamespacedWrapper
<V> boolean
isEmpty()
boolean
isLocked()
iterator()
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) (专用程序包) void
onBindTags
(Map<TagKey<V>, HolderSet.Named<V>> tags) (专用程序包) void
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) void
register
(int id, ResourceLocation key, V value) void
The supplied string key will be prefixed with the currently active mod's mod id.void
register
(ResourceLocation key, V value) remove
(ResourceLocation key) (专用程序包) void
<T> void
setSlaveMap
(IForgeRegistry.SlaveKey<T> name, T obj) (专用程序包) int
size()
(专用程序包) void
sync
(ResourceLocation name, ForgeRegistry<V> from) @Nullable ITagManager
<V> tags()
void
unfreeze()
(专用程序包) void
validateContent
(ResourceLocation registryName) (专用程序包) void
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
字段详细资料
-
REGISTRIES
public static final org.apache.logging.log4j.Marker REGISTRIES -
REGISTRYDUMP
private static final org.apache.logging.log4j.Marker REGISTRYDUMP -
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
stage
-
ids
-
names
-
keys
-
aliases
-
slaves
-
defaultKey
-
create
-
add
-
clear
-
validate
-
bake
-
missing
-
availabilityMap
-
blocked
private final it.unimi.dsi.fastutil.ints.IntSet blocked -
overrides
-
delegatesByName
-
delegatesByValue
-
owners
-
tagManager
-
min
private final int min -
max
private final int max -
allowOverrides
private final boolean allowOverrides -
isModifiable
private final boolean isModifiable -
hasWrapper
private final boolean hasWrapper -
defaultValue
-
isFrozen
boolean isFrozen -
name
-
key
-
builder
-
codec
-
-
构造器详细资料
-
ForgeRegistry
ForgeRegistry(RegistryManager stage, ResourceLocation name, RegistryBuilder<V> builder)
-
-
方法详细资料
-
register
从接口复制的说明:IForgeRegistry
The 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.- 指定者:
register
在接口中IForgeRegistry<V>
-
register
- 指定者:
register
在接口中IForgeRegistry<V>
-
iterator
-
getRegistryName
- 指定者:
getRegistryName
在接口中IForgeRegistry<V>
-
getRegistryKey
- 指定者:
getRegistryKey
在接口中IForgeRegistry<V>
-
getCodec
- 指定者:
getCodec
在接口中IForgeRegistry<V>
- 另请参阅:
-
containsKey
- 指定者:
containsKey
在接口中IForgeRegistry<V>
-
containsValue
- 指定者:
containsValue
在接口中IForgeRegistry<V>
-
isEmpty
public boolean isEmpty()- 指定者:
isEmpty
在接口中IForgeRegistry<V>
-
size
int size() -
getValue
- 指定者:
getValue
在接口中IForgeRegistry<V>
-
getKey
- 指定者:
getKey
在接口中IForgeRegistry<V>
-
getResourceKey
- 指定者:
getResourceKey
在接口中IForgeRegistry<V>
-
getWrapper
-
getWrapperOrThrow
-
onBindTags
-
getHolder
从接口复制的说明:IForgeRegistry
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags()
.- 指定者:
getHolder
在接口中IForgeRegistry<V>
- 另请参阅:
-
getHolder
从接口复制的说明:IForgeRegistry
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags()
.- 指定者:
getHolder
在接口中IForgeRegistry<V>
-
getHolder
从接口复制的说明:IForgeRegistry
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, useIForgeRegistry.tags()
.- 指定者:
getHolder
在接口中IForgeRegistry<V>
-
tags
- 指定者:
tags
在接口中IForgeRegistry<V>
- 返回:
- an instance of
ITagManager
if this registry supports tags and/or has a wrapper registry, null otherwise
-
getKeys
- 指定者:
getKeys
在接口中IForgeRegistry<V>
-
getResourceKeys
-
getValues
- 指定者:
getValues
在接口中IForgeRegistry<V>
-
getEntries
- 指定者:
getEntries
在接口中IForgeRegistry<V>
-
getSlaveMap
从接口复制的说明:IForgeRegistry
Retrieve the slave map of type T from the registry. Slave maps are maps which are dependent on registry content in some way.- 指定者:
getSlaveMap
在接口中IForgeRegistry<V>
- 类型参数:
T
- Type to return- 返回:
- The slavemap if present
-
setSlaveMap
- 指定者:
setSlaveMap
在接口中IForgeRegistryInternal<V>
-
getID
-
getID
-
getIDRaw
-
getIDRaw
-
getValue
- 指定者:
getValue
在接口中IForgeRegistryInternal<V>
-
getKey
-
validateKey
void validateKey() -
getDefaultKey
- 指定者:
getDefaultKey
在接口中IForgeRegistry<V>
-
copy
-
register
- 指定者:
register
在接口中IForgeRegistryInternal<V>
-
add
-
add
-
getRaw
-
addAlias
Adds an alias that maps from the name specified bysrc
to 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.
- 参数:
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
- 指定者:
getDelegate
在接口中IForgeRegistry<V>
-
getDelegateOrThrow
- 指定者:
getDelegateOrThrow
在接口中IForgeRegistry<V>
-
getDelegate
- 指定者:
getDelegate
在接口中IForgeRegistry<V>
-
getDelegateOrThrow
- 指定者:
getDelegateOrThrow
在接口中IForgeRegistry<V>
-
getDelegate
- 指定者:
getDelegate
在接口中IForgeRegistry<V>
-
getDelegateOrThrow
- 指定者:
getDelegateOrThrow
在接口中IForgeRegistry<V>
-
bindDelegate
-
resetDelegates
void resetDelegates() -
getDefault
V getDefault() -
validateContent
-
bake
public void bake() -
sync
-
clear
public void clear()- 指定者:
clear
在接口中IForgeRegistryModifiable<V>
-
remove
- 指定者:
remove
在接口中IForgeRegistryModifiable<V>
-
block
void block(int id) -
isLocked
public boolean isLocked()- 指定者:
isLocked
在接口中IForgeRegistryModifiable<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() -
dump
-
loadIds
public 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
-
getOverrideOwners
Map<ResourceLocation,String> getOverrideOwners() -
getMissingEvent
public MissingMappingsEvent getMissingEvent(ResourceLocation name, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> map) -
processMissingEvent
void 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) -
getBuilder
RegistryBuilder<V> getBuilder()
-