类 BaseMappedRegistry<T>
java.lang.Object
net.neoforged.neoforge.registries.BaseMappedRegistry<T>
- 所有已实现的接口:
com.mojang.serialization.Keyable
,Iterable<T>
,HolderGetter<T>
,HolderLookup<T>
,HolderLookup.RegistryLookup<T>
,HolderOwner<T>
,IdMap<T>
,Registry<T>
,IRegistryExtension<T>
- 直接已知子类:
MappedRegistry
-
嵌套类概要
从接口继承的嵌套类/接口 net.minecraft.core.HolderLookup
HolderLookup.Provider, HolderLookup.RegistryLookup<T>
从接口继承的嵌套类/接口 net.minecraft.core.HolderLookup.RegistryLookup
HolderLookup.RegistryLookup.Delegate<T>
从接口继承的嵌套类/接口 net.minecraft.core.Registry
Registry.PendingTags<T>
-
字段概要
字段修饰符和类型字段说明protected final List
<AddCallback<T>> (专用程序包) final Map
<ResourceLocation, ResourceLocation> protected final List
<BakeCallback<T>> protected final List
<ClearCallback<T>> (专用程序包) final Map
<DataMapType<T, ?>, Map<ResourceKey<T>, ?>> private int
private boolean
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
addAlias
(ResourceLocation from, ResourceLocation to) Adds an alias that maps from the name specified byfrom
to the name specified byto
.void
addCallback
(RegistryCallback<T> callback) Adds a callback to this registry.protected void
clear
(boolean full) boolean
doesSync()
返回 whether this registry should be synced to clients。<A> A
getData
(DataMapType<T, A> type, ResourceKey<T> key) 返回 the data map value attached with the object with the key, ornull
if there's no attached value。<A> Map
<ResourceKey<T>, A> getDataMap
(DataMapType<T, A> type) 返回 the data map of the giventype
。Map
<DataMapType<T, ?>, Map<ResourceKey<T>, ?>> int
getId
(ResourceKey<T> key) Gets the integer id linked to the given key.int
getId
(ResourceLocation name) Gets the integer id linked to the given name.int
getMaxId()
返回 the highest id that an entry in this registry is allowed to use。protected abstract void
registerIdMapping
(ResourceKey<T> key, int id) Register a key 无效输入:'<'-> ID mapping.resolve
(ResourceKey<T> key) Resolves a registry key of a potential object in this registry.resolve
(ResourceLocation name) Resolves a registry name of a potential object in this registry.(专用程序包) void
setMaxId
(int maxId) (专用程序包) void
setSync
(boolean sync) protected abstract void
unfreeze
(boolean clearTags) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraft.core.HolderGetter
get, get, getOrThrow, getOrThrow
从接口继承的方法 net.minecraft.core.HolderLookup
listElementIds, listElements, listTagIds, listTags
从接口继承的方法 net.minecraft.core.HolderLookup.RegistryLookup
filterElements, filterFeatures, registryLifecycle
从接口继承的方法 net.minecraft.core.HolderOwner
canSerializeIn
从接口继承的方法 net.minecraft.core.IdMap
byId, byIdOrThrow, getIdOrThrow, size
从接口继承的方法 net.neoforged.neoforge.registries.IRegistryExtension
addCallback, containsValue, getKeyOrNull
从接口继承的方法 java.lang.Iterable
forEach, iterator, spliterator
从接口继承的方法 net.minecraft.core.Registry
asHolderIdMap, byNameCodec, containsKey, containsKey, createIntrusiveHolder, entrySet, freeze, get, get, getAny, getId, getKey, getOptional, getOptional, getRandom, getRandomElementOf, getResourceKey, getTagOrEmpty, getTags, getValue, getValue, getValueOrThrow, holderByNameCodec, key, keys, keySet, prepareTagReload, registrationInfo, registryKeySet, stream, wrapAsHolder
-
字段详细资料
-
addCallbacks
-
bakeCallbacks
-
clearCallbacks
-
aliases
-
dataMaps
-
maxId
private int maxId -
sync
private boolean sync
-
-
构造器详细资料
-
BaseMappedRegistry
public BaseMappedRegistry()
-
-
方法详细资料
-
setSync
void setSync(boolean sync) -
doesSync
public boolean doesSync()从接口复制的说明:IRegistryExtension
返回 whether this registry should be synced to clients。- 指定者:
doesSync
在接口中IRegistryExtension<T>
- 返回:
- whether this registry should be synced to clients
-
setMaxId
void setMaxId(int maxId) -
getMaxId
public int getMaxId()从接口复制的说明:IRegistryExtension
返回 the highest id that an entry in this registry is allowed to use。 For the size of this registry, seeIdMap.size()
.- 指定者:
getMaxId
在接口中IRegistryExtension<T>
- 返回:
- the highest id that an entry in this registry is allowed to use
-
addCallback
从接口复制的说明:IRegistryExtension
Adds a callback to this registry.Depending on the interfaces implemented by the object, the callback will be called when the registry is added to, baked, and/or cleared.
- 指定者:
addCallback
在接口中IRegistryExtension<T>
- 参数:
callback
- the callback to add
-
addAlias
从接口复制的说明:IRegistryExtension
Adds an alias that maps from the name specified byfrom
to the name specified byto
.Any registry lookups that target the first name will resolve as the second name, if the first name is not present.
- 指定者:
addAlias
在接口中IRegistryExtension<T>
- 参数:
from
- the source registry name to alias fromto
- the target registry name to alias to
-
resolve
从接口复制的说明:IRegistryExtension
Resolves a registry name of a potential object in this registry. The original name will be returned if it is contained in this registry. If not, the alias map will be checked for entries. Resolving supports alias chains (A -> B -> C) and will terminate when an alias has an entry or the last alias in the chain is reached.- 指定者:
resolve
在接口中IRegistryExtension<T>
- 参数:
name
- the input registry name of a potential object in this registry- 返回:
- the resolved registry name
-
resolve
从接口复制的说明:IRegistryExtension
Resolves a registry key of a potential object in this registry. The original key will be returned if it is contained in this registry. If not, the alias map will be checked for entries. Resolving supports alias chains (A -> B -> C) and will terminate when an alias has an entry or the last alias in the chain is reached.- 指定者:
resolve
在接口中IRegistryExtension<T>
- 参数:
key
- the input registry key of a potential object in this registry- 返回:
- the resolved registry key
-
getId
从接口复制的说明:IRegistryExtension
Gets the integer id linked to the given key. If the key is not present in the registry, the default entry's integer id is returned if the registry is defaulted or-1
if the registry is not defaulted- 指定者:
getId
在接口中IRegistryExtension<T>
- 参数:
key
- the resource key to lookup- 返回:
- the integer id linked to the given key
-
getId
从接口复制的说明:IRegistryExtension
Gets the integer id linked to the given name. If the name is not present in the registry, the default entry's integer id is returned if the registry is defaulted or-1
if the registry is not defaulted- 指定者:
getId
在接口中IRegistryExtension<T>
- 参数:
name
- the resource name to lookup- 返回:
- the integer id linked to the given name
-
clear
protected void clear(boolean full) -
registerIdMapping
Register a key 无效输入:'<'-> ID mapping. The IDs must be registered in increasing order. -
unfreeze
protected abstract void unfreeze(boolean clearTags) -
getData
从接口复制的说明:HolderLookup.RegistryLookup
返回 the data map value attached with the object with the key, ornull
if there's no attached value。- 指定者:
getData
在接口中HolderLookup.RegistryLookup<T>
- 类型参数:
A
- the data type- 参数:
type
- the type of the data mapkey
- the object to get the value for- 返回:
- the data map value attached with the object with the key, or
null
if there's no attached value
-
getDataMap
从接口复制的说明:IRegistryExtension
返回 the data map of the giventype
。- 指定者:
getDataMap
在接口中IRegistryExtension<T>
- 类型参数:
A
- the data type- 返回:
- the data map of the given
type
-
getDataMaps
-