类 MappedRegistry<T>
java.lang.Object
net.neoforged.neoforge.registries.BaseMappedRegistry<T>
net.minecraft.core.MappedRegistry<T>
- 所有已实现的接口:
com.mojang.serialization.Keyable
,Iterable<T>
,HolderGetter<T>
,HolderLookup<T>
,HolderLookup.RegistryLookup<T>
,HolderOwner<T>
,IdMap<T>
,Registry<T>
,WritableRegistry<T>
,IRegistryExtension<T>
- 直接已知子类:
DefaultedMappedRegistry
-
嵌套类概要
嵌套类从接口继承的嵌套类/接口 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>
-
字段概要
字段修饰符和类型字段说明(专用程序包) MappedRegistry.TagSet
<T> private final it.unimi.dsi.fastutil.objects.ObjectList
<Holder.Reference<T>> private final Map
<ResourceKey<T>, Holder.Reference<T>> private final Map
<ResourceLocation, Holder.Reference<T>> private final Map
<T, Holder.Reference<T>> private boolean
private final Map
<TagKey<T>, HolderSet.Named<T>> private final ResourceKey
<? extends Registry<T>> private final Map
<ResourceKey<T>, RegistrationInfo> private com.mojang.serialization.Lifecycle
private final it.unimi.dsi.fastutil.objects.Reference2IntMap
<T> private Map
<T, Holder.Reference<T>> 从类继承的字段 net.neoforged.neoforge.registries.BaseMappedRegistry
addCallbacks, bakeCallbacks, clearCallbacks
-
构造器概要
构造器构造器说明MappedRegistry
(ResourceKey<? extends Registry<T>> p_249899_, com.mojang.serialization.Lifecycle p_252249_) MappedRegistry
(ResourceKey<? extends Registry<T>> p_252132_, com.mojang.serialization.Lifecycle p_249215_, boolean p_251014_) -
方法概要
修饰符和类型方法说明void
void
byId
(int p_122684_) protected void
clear
(boolean full) boolean
containsKey
(ResourceKey<T> p_175392_) boolean
containsKey
(ResourceLocation p_122761_) boolean
containsValue
(T value) 返回true
if this registry contains thevalue
。createIntrusiveHolder
(T p_205915_) private HolderSet.Named
<T> Set
<Map.Entry<ResourceKey<T>, T>> entrySet()
freeze()
get
(int p_205907_) get
(ResourceKey<T> p_205905_) get
(ResourceLocation p_316743_) getAny()
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
(专用程序包) Holder.Reference
<T> getOrCreateHolderOrThrow
(ResourceKey<T> p_248831_) (专用程序包) HolderSet.Named
<T> getOrCreateTagForRegistration
(TagKey<T> p_364545_) getRandom
(RandomSource p_235716_) getResourceKey
(T p_122755_) getTags()
getValue
(ResourceKey<T> p_122714_) getValue
(ResourceLocation p_122739_) private static <T> T
getValueFromNullable
(Holder.Reference<T> p_205866_) boolean
isEmpty()
iterator()
ResourceKey
<? extends Registry<T>> key()
keySet()
listTags()
prepareTagReload
(TagLoader.LoadResult<T> p_364128_) (专用程序包) void
register
(int id, ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_326235_) register
(ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_326235_) protected void
registerIdMapping
(ResourceKey<T> key, int id) Register a key 无效输入:'<'-> ID mapping.registrationInfo
(ResourceKey<T> p_326067_) Set
<ResourceKey<T>> com.mojang.serialization.Lifecycle
int
size()
toString()
void
unfreeze
(boolean clearTags) 已过时。Forge: For internal use only.private Holder.Reference
<T> validateAndUnwrapTagElement
(TagKey<T> p_361125_, Holder<T> p_363196_) private void
private void
validateWrite
(ResourceKey<T> p_205922_) wrapAsHolder
(T p_263356_) 从类继承的方法 net.neoforged.neoforge.registries.BaseMappedRegistry
addAlias, addCallback, doesSync, getData, getDataMap, getDataMaps, getMaxId, resolve, resolve
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraft.core.HolderGetter
getOrThrow, getOrThrow
从接口继承的方法 net.minecraft.core.HolderLookup
listElementIds, listTagIds
从接口继承的方法 net.minecraft.core.HolderLookup.RegistryLookup
filterElements, filterFeatures, getData
从接口继承的方法 net.minecraft.core.HolderOwner
canSerializeIn
从接口继承的方法 net.minecraft.core.IdMap
byIdOrThrow, getIdOrThrow
从接口继承的方法 net.neoforged.neoforge.registries.IRegistryExtension
addAlias, addCallback, addCallback, doesSync, getDataMap, getKeyOrNull, getMaxId, resolve, resolve
从接口继承的方法 java.lang.Iterable
forEach, spliterator
从接口继承的方法 net.minecraft.core.Registry
asHolderIdMap, byNameCodec, getOptional, getOptional, getRandomElementOf, getTagOrEmpty, getValueOrThrow, holderByNameCodec, keys, stream
-
字段详细资料
-
key
-
byId
-
toId
-
byLocation
-
byKey
-
byValue
-
registrationInfos
-
registryLifecycle
private com.mojang.serialization.Lifecycle registryLifecycle -
frozenTags
-
allTags
MappedRegistry.TagSet<T> allTags -
frozen
private boolean frozen -
unregisteredIntrusiveHolders
-
-
构造器详细资料
-
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_249899_, com.mojang.serialization.Lifecycle p_252249_) -
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_252132_, com.mojang.serialization.Lifecycle p_249215_, boolean p_251014_)
-
-
方法详细资料
-
listTags
- 指定者:
listTags
在接口中HolderLookup<T>
-
key
-
toString
-
validateWrite
private void validateWrite() -
validateWrite
-
register
public Holder.Reference<T> register(ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_326235_) - 指定者:
register
在接口中WritableRegistry<T>
-
register
public Holder.Reference<T> register(int id, ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_326235_) -
getKey
-
getResourceKey
- 指定者:
getResourceKey
在接口中Registry<T>
-
getId
-
getValue
-
byId
-
get
-
get
-
get
- 指定者:
get
在接口中HolderGetter<T>
-
getAny
-
wrapAsHolder
- 指定者:
wrapAsHolder
在接口中Registry<T>
-
getOrCreateHolderOrThrow
-
size
public int size() -
registrationInfo
- 指定者:
registrationInfo
在接口中Registry<T>
-
registryLifecycle
public com.mojang.serialization.Lifecycle registryLifecycle()- 指定者:
registryLifecycle
在接口中HolderLookup.RegistryLookup<T>
-
iterator
-
getValue
-
getValueFromNullable
-
keySet
-
registryKeySet
- 指定者:
registryKeySet
在接口中Registry<T>
-
entrySet
-
listElements
- 指定者:
listElements
在接口中HolderLookup<T>
-
getTags
-
getOrCreateTagForRegistration
-
createTag
-
isEmpty
public boolean isEmpty()- 指定者:
isEmpty
在接口中WritableRegistry<T>
-
getRandom
-
containsKey
- 指定者:
containsKey
在接口中Registry<T>
-
containsKey
- 指定者:
containsKey
在接口中Registry<T>
-
unfreeze
已过时。Forge: For internal use only. Use the Register events when registering values.- 指定者:
unfreeze
在类中BaseMappedRegistry<T>
-
freeze
-
createIntrusiveHolder
- 指定者:
createIntrusiveHolder
在接口中Registry<T>
-
get
- 指定者:
get
在接口中HolderGetter<T>
-
validateAndUnwrapTagElement
-
bindTag
- 指定者:
bindTag
在接口中WritableRegistry<T>
-
refreshTagsInHolders
void refreshTagsInHolders() -
bindAllTagsToEmpty
public void bindAllTagsToEmpty() -
createRegistrationLookup
- 指定者:
createRegistrationLookup
在接口中WritableRegistry<T>
-
prepareTagReload
- 指定者:
prepareTagReload
在接口中Registry<T>
-
clear
protected void clear(boolean full) - 覆盖:
clear
在类中BaseMappedRegistry<T>
-
registerIdMapping
从类复制的说明:BaseMappedRegistry
Register a key 无效输入:'<'-> ID mapping. The IDs must be registered in increasing order.- 指定者:
registerIdMapping
在类中BaseMappedRegistry<T>
-
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>
- 覆盖:
getId
在类中BaseMappedRegistry<T>
- 参数:
name
- the resource name to lookup- 返回:
- the integer id linked to the given name
-
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>
- 覆盖:
getId
在类中BaseMappedRegistry<T>
- 参数:
key
- the resource key to lookup- 返回:
- the integer id linked to the given key
-
containsValue
从接口复制的说明:IRegistryExtension
返回true
if this registry contains thevalue
。- 指定者:
containsValue
在接口中IRegistryExtension<T>
- 参数:
value
- the object whose existence to check for- 返回:
true
if this registry contains thevalue
-