Package net.minecraft.tags
Class TagLoader<T>
java.lang.Object
net.minecraft.tags.TagLoader<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordstatic final record(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String(package private) final TagLoader.ElementLookup<T> private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(Map<ResourceLocation, List<TagLoader.EntryWithSource>> builders) static List<HolderLookup.RegistryLookup<?>> buildUpdatedLookups(RegistryAccess.Frozen registry, List<Registry.PendingTags<?>> tags) private static Registry.PendingTags<?> findTagsForRegistry(List<Registry.PendingTags<?>> tags, ResourceKey<? extends Registry<?>> registryKey) load(ResourceManager resourceManager) private static <T> Optional<Registry.PendingTags<T>> loadPendingTags(ResourceManager resourceManager, Registry<T> registry) static List<Registry.PendingTags<?>> loadTagsForExistingRegistries(ResourceManager resourceManager, RegistryAccess registryAccess) static <T> voidloadTagsForRegistry(ResourceManager resourceManager, WritableRegistry<T> registry) static <T> voidloadTagsFromNetwork(TagNetworkSerialization.NetworkPayload payload, WritableRegistry<T> registry) private com.mojang.datafixers.util.Either<List<TagLoader.EntryWithSource>, List<T>> tryBuildTag(TagEntry.Lookup<T> lookup, List<TagLoader.EntryWithSource> entries) wrapTags(ResourceKey<? extends Registry<T>> registryKey, Map<ResourceLocation, List<Holder<T>>> tags)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
elementLookup
-
directory
-
-
Constructor Details
-
TagLoader
-
-
Method Details
-
load
-
tryBuildTag
private com.mojang.datafixers.util.Either<List<TagLoader.EntryWithSource>,List<T>> tryBuildTag(TagEntry.Lookup<T> lookup, List<TagLoader.EntryWithSource> entries) -
build
public Map<ResourceLocation,List<T>> build(Map<ResourceLocation, List<TagLoader.EntryWithSource>> builders) -
loadTagsFromNetwork
public static <T> void loadTagsFromNetwork(TagNetworkSerialization.NetworkPayload payload, WritableRegistry<T> registry) -
loadTagsForExistingRegistries
public static List<Registry.PendingTags<?>> loadTagsForExistingRegistries(ResourceManager resourceManager, RegistryAccess registryAccess) -
loadTagsForRegistry
public static <T> void loadTagsForRegistry(ResourceManager resourceManager, WritableRegistry<T> registry) -
wrapTags
private static <T> Map<TagKey<T>,List<Holder<T>>> wrapTags(ResourceKey<? extends Registry<T>> registryKey, Map<ResourceLocation, List<Holder<T>>> tags) -
loadPendingTags
private static <T> Optional<Registry.PendingTags<T>> loadPendingTags(ResourceManager resourceManager, Registry<T> registry) -
buildUpdatedLookups
public static List<HolderLookup.RegistryLookup<?>> buildUpdatedLookups(RegistryAccess.Frozen registry, List<Registry.PendingTags<?>> tags) -
findTagsForRegistry
@Nullable private static Registry.PendingTags<?> findTagsForRegistry(List<Registry.PendingTags<?>> tags, ResourceKey<? extends Registry<?>> registryKey)
-