类 MappedRegistry<T>
java.lang.Object
net.minecraft.core.MappedRegistry<T>
- 所有已实现的接口:
com.mojang.serialization.Keyable
,Iterable<T>
,IdMap<T>
,Registry<T>
,WritableRegistry<T>
- 直接已知子类:
DefaultedMappedRegistry
,NamespacedWrapper
-
字段概要
字段修饰符和类型字段说明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 List<Holder.Reference<T>>
(专用程序包) final ResourceKey<? extends Registry<T>>
private static final Set<ResourceLocation>
private static final org.slf4j.Logger
private final HolderLookup.RegistryLookup<T>
private int
private com.mojang.serialization.Lifecycle
private Map<TagKey<T>,
HolderSet.Named<T>> private final it.unimi.dsi.fastutil.objects.Object2IntMap<T>
protected Map<T,
Holder.Reference<T>> -
构造器概要
构造器构造器说明MappedRegistry
(ResourceKey<? extends Registry<T>> pKey, com.mojang.serialization.Lifecycle pRegistryLifecycle) MappedRegistry
(ResourceKey<? extends Registry<T>> pKey, com.mojang.serialization.Lifecycle pRegistryLifecycle, boolean pHasIntrusiveHolders) -
方法概要
修饰符和类型方法说明asLookup()
void
byId
(int pId) boolean
containsKey
(ResourceKey<T> pKey) boolean
containsKey
(ResourceLocation pName) createIntrusiveHolder
(T pValue) private HolderSet.Named<T>
Set<Map.Entry<ResourceKey<T>,
T>> entrySet()
freeze()
get
(ResourceKey<T> pKey) get
(ResourceLocation pName) getHolder
(int pId) getHolder
(ResourceKey<T> pKey) int
static Set<ResourceLocation>
(专用程序包) Holder.Reference<T>
getOrCreateHolderOrThrow
(ResourceKey<T> pKey) getOrCreateTag
(TagKey<T> pKey) getRandom
(RandomSource pRandom) getResourceKey
(T pValue) Stream<com.mojang.datafixers.util.Pair<TagKey<T>,
HolderSet.Named<T>>> getTags()
private static <T> T
getValueFromNullable
(Holder.Reference<T> pHolder) holders()
private List<Holder.Reference<T>>
boolean
isEmpty()
iterator()
ResourceKey<? extends Registry<T>>
key()
keySet()
com.mojang.serialization.Lifecycle
protected final void
register
(ResourceKey<T> pKey, T pValue, com.mojang.serialization.Lifecycle pLifecycle) registerMapping
(int pId, ResourceKey<T> pKey, T pValue, com.mojang.serialization.Lifecycle pLifecycle) Set<ResourceKey<T>>
com.mojang.serialization.Lifecycle
void
int
size()
toString()
void
unfreeze()
已过时。Forge: For internal use only.private void
private void
validateWrite
(ResourceKey<T> pKey) wrapAsHolder
(T pValue) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraft.core.IdMap
byIdOrThrow
从接口继承的方法 java.lang.Iterable
forEach, spliterator
从接口继承的方法 net.minecraft.core.Registry
asHolderIdMap, asTagAddingLookup, byNameCodec, getHolderOrThrow, getOptional, getOptional, getOrThrow, getTagOrEmpty, holderByNameCodec, keys, stream
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER -
key
-
byId
-
toId
-
byLocation
-
byKey
-
byValue
-
lifecycles
-
registryLifecycle
private com.mojang.serialization.Lifecycle registryLifecycle -
tags
-
frozen
private boolean frozen -
unregisteredIntrusiveHolders
-
holdersInOrder
-
nextId
private int nextId -
lookup
-
KNOWN
-
-
构造器详细资料
-
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> pKey, com.mojang.serialization.Lifecycle pRegistryLifecycle) -
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> pKey, com.mojang.serialization.Lifecycle pRegistryLifecycle, boolean pHasIntrusiveHolders)
-
-
方法详细资料
-
key
-
toString
-
holdersInOrder
-
validateWrite
private void validateWrite() -
validateWrite
-
getKnownRegistries
-
markKnown
protected final void markKnown() -
registerMapping
public Holder.Reference<T> registerMapping(int pId, ResourceKey<T> pKey, T pValue, com.mojang.serialization.Lifecycle pLifecycle) - 指定者:
registerMapping
在接口中WritableRegistry<T>
-
register
public Holder.Reference<T> register(ResourceKey<T> pKey, T pValue, com.mojang.serialization.Lifecycle pLifecycle) - 指定者:
register
在接口中WritableRegistry<T>
-
getKey
-
getResourceKey
- 指定者:
getResourceKey
在接口中Registry<T>
-
getId
-
get
-
byId
-
getHolder
-
getHolder
-
wrapAsHolder
- 指定者:
wrapAsHolder
在接口中Registry<T>
-
getOrCreateHolderOrThrow
-
size
public int size() -
lifecycle
-
registryLifecycle
public com.mojang.serialization.Lifecycle registryLifecycle()- 指定者:
registryLifecycle
在接口中Registry<T>
-
iterator
-
get
-
getValueFromNullable
-
keySet
-
registryKeySet
- 指定者:
registryKeySet
在接口中Registry<T>
-
entrySet
-
holders
-
getTags
-
getOrCreateTag
- 指定者:
getOrCreateTag
在接口中Registry<T>
-
createTag
-
getTagNames
- 指定者:
getTagNames
在接口中Registry<T>
-
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. -
freeze
-
createIntrusiveHolder
- 指定者:
createIntrusiveHolder
在接口中Registry<T>
-
getTag
-
bindTags
-
resetTags
public void resetTags() -
createRegistrationLookup
- 指定者:
createRegistrationLookup
在接口中WritableRegistry<T>
-
holderOwner
- 指定者:
holderOwner
在接口中Registry<T>
-
asLookup
-