Package net.minecraftforge.registries
Class NamespacedHolderHelper<T>
java.lang.Object
net.minecraftforge.registries.NamespacedHolderHelper<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate Holder.Reference<T>
private final @Nullable ResourceLocation
private boolean
private final @Nullable Function<T,
Holder.Reference<T>> private Map<T,
Holder.Reference<T>> private it.unimi.dsi.fastutil.objects.ObjectList<Holder.Reference<T>>
private Map<ResourceLocation,
Holder.Reference<T>> private List<Holder.Reference<T>>
private static final org.apache.logging.log4j.Logger
private final ForgeRegistry<T>
private Map<TagKey<T>,
HolderSet.Named<T>> -
Constructor Summary
ConstructorDescriptionNamespacedHolderHelper
(ForgeRegistry<T> owner, Registry<T> self, @Nullable ResourceLocation defaultKey, @Nullable Function<T, Holder.Reference<T>> holderLookup) -
Method Summary
Modifier and TypeMethodDescription(package private) void
private void
addTagToHolder
(Map<Holder.Reference<T>, List<TagKey<T>>> holderToTag, TagKey<T> name, Holder<T> holder) (package private) void
(package private) Holder.Reference<T>
createIntrusiveHolder
(T value) private HolderSet.Named<T>
freeze()
getHolder
(int id) getHolder
(ResourceKey<T> key) private Holder.Reference<T>
getHolder
(ResourceKey<T> key, T value) getHolder
(ResourceLocation location) getOrCreateHolder
(ResourceKey<T> key) (package private) HolderSet.Named<T>
getOrCreateTag
(TagKey<T> name) getRandom
(RandomSource rand) private List<Holder.Reference<T>>
(package private) Optional<HolderSet.Named<T>>
(package private) Stream<com.mojang.datafixers.util.Pair<TagKey<T>,
HolderSet.Named<T>>> getTags()
(package private) Stream<Holder.Reference<T>>
holders()
(package private) boolean
isFrozen()
(package private) boolean
(package private) boolean
isKnownTagName
(TagKey<T> name) onAdded
(RegistryManager stage, int id, ResourceKey<T> key, T newValue, T oldValue) (package private) void
(package private) void
unfreeze()
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
owner
-
self
-
defaultKey
-
holderLookup
-
optionalTags
-
frozen
private boolean frozen -
holdersSorted
-
holdersById
-
holdersByName
-
holders
-
tags
-
defaultHolder
-
-
Constructor Details
-
NamespacedHolderHelper
NamespacedHolderHelper(ForgeRegistry<T> owner, Registry<T> self, @Nullable @Nullable ResourceLocation defaultKey, @Nullable @Nullable Function<T, Holder.Reference<T>> holderLookup)
-
-
Method Details
-
getHolder
-
getHolder
-
getHolder
-
getHolder
-
getOrCreateHolder
-
getOrCreateHolderOrThrow
-
getRandom
-
holders
Stream<Holder.Reference<T>> holders() -
isKnownTagName
-
getTags
Stream<com.mojang.datafixers.util.Pair<TagKey<T>,HolderSet.Named<T>>> getTags() -
getOrCreateTag
-
addOptionalTag
-
getTagNames
-
freeze
-
createIntrusiveHolder
-
getTag
-
bindTags
-
addTagToHolder
-
resetTags
void resetTags() -
unfreeze
void unfreeze() -
isFrozen
boolean isFrozen() -
isIntrusive
boolean isIntrusive() -
onAdded
@Nullable @Nullable Holder<T> onAdded(RegistryManager stage, int id, ResourceKey<T> key, T newValue, T oldValue) -
createTag
-
getHolder
-
getSortedHolders
-