Package net.minecraftforge.registries
Class NamespacedHolderHelper<T extends IForgeRegistryEntry<T>>
java.lang.Object
net.minecraftforge.registries.NamespacedHolderHelper<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate Holder.Reference<T>
private final ResourceLocation
private boolean
private final 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, ResourceLocation defaultKey, 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) 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, 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
@Nullable private final Function<T extends IForgeRegistryEntry<T>,Holder.Reference<T extends IForgeRegistryEntry<T>>> holderLookup -
optionalTags
private final com.google.common.collect.Multimap<TagKey<T extends IForgeRegistryEntry<T>>,Supplier<T extends IForgeRegistryEntry<T>>> optionalTags -
frozen
private boolean frozen -
holdersSorted
-
holdersById
private it.unimi.dsi.fastutil.objects.ObjectList<Holder.Reference<T extends IForgeRegistryEntry<T>>> holdersById -
holdersByName
-
holders
private Map<T extends IForgeRegistryEntry<T>,Holder.Reference<T extends IForgeRegistryEntry<T>>> holders -
tags
private volatile Map<TagKey<T extends IForgeRegistryEntry<T>>,HolderSet.Named<T extends IForgeRegistryEntry<T>>> tags -
defaultHolder
-
-
Constructor Details
-
NamespacedHolderHelper
NamespacedHolderHelper(ForgeRegistry<T> owner, Registry<T> self, @Nullable ResourceLocation defaultKey, @Nullable Function<T, Holder.Reference<T>> holderLookup)
-
-
Method Details
-
getHolder
-
getHolder
-
getHolder
-
getHolder
-
getOrCreateHolder
-
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
-
createTag
-
getHolder
-
getSortedHolders
-