Class DataMapLoader
java.lang.Object
net.neoforged.neoforge.registries.DataMapLoader
- All Implemented Interfaces:
PreparableReloadListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ICondition.IContext
private static final org.slf4j.Logger
static final String
private final RegistryAccess
private Map
<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>> -
Constructor Summary
ConstructorsConstructorDescriptionDataMapLoader
(ICondition.IContext conditionContext, RegistryAccess registryAccess) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply()
private <T> void
apply
(BaseMappedRegistry<T> registry, DataMapLoader.LoadResult<T> result) private <T,
R> Map <ResourceKey<R>, T> buildDataMap
(Registry<R> registry, DataMapType<R, T> attachment, List<DataMapFile<T, R>> entries) static String
getFolderLocation
(ResourceLocation registryId) private CompletableFuture
<Map<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>>> load
(ResourceManager manager, Executor executor, ProfilerFiller profiler) private static Map
<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>> load
(ResourceManager manager, ProfilerFiller profiler, RegistryAccess access, ICondition.IContext context) private static <A,
T> List <DataMapFile<A, T>> readData
(RegistryOps<com.google.gson.JsonElement> ops, DataMapType<T, A> attachmentType, ResourceKey<Registry<T>> registryKey, List<Resource> resources) reload
(PreparableReloadListener.PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor) private <R> void
resolve
(Registry<R> registry, com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> value, boolean required, Consumer<Holder<R>> consumer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
PATH
- See Also:
-
results
-
conditionContext
-
registryAccess
-
-
Constructor Details
-
DataMapLoader
-
-
Method Details
-
reload
public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor) - Specified by:
reload
in interfacePreparableReloadListener
-
apply
public void apply() -
apply
-
buildDataMap
private <T,R> Map<ResourceKey<R>,T> buildDataMap(Registry<R> registry, DataMapType<R, T> attachment, List<DataMapFile<T, R>> entries) -
resolve
private <R> void resolve(Registry<R> registry, com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> value, boolean required, Consumer<Holder<R>> consumer) -
load
private CompletableFuture<Map<ResourceKey<? extends Registry<?>>,DataMapLoader.LoadResult<?>>> load(ResourceManager manager, Executor executor, ProfilerFiller profiler) -
load
private static Map<ResourceKey<? extends Registry<?>>,DataMapLoader.LoadResult<?>> load(ResourceManager manager, ProfilerFiller profiler, RegistryAccess access, ICondition.IContext context) -
getFolderLocation
-
readData
private static <A,T> List<DataMapFile<A,T>> readData(RegistryOps<com.google.gson.JsonElement> ops, DataMapType<T, A> attachmentType, ResourceKey<Registry<T>> registryKey, List<Resource> resources)
-