Class DataMapLoader
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
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 static final org.slf4j.Loggerstatic final Stringprivate final RegistryAccessprivate Map<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>> -
Constructor Summary
ConstructorsConstructorDescriptionDataMapLoader(RegistryAccess registryAccess) DataMapLoader(ICondition.IContext conditionContext, RegistryAccess registryAccess) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()private <T> voidapply(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 StringgetFolderLocation(ResourceLocation registryId) private CompletableFuture<Map<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>>> load(ResourceManager manager, Executor executor, ProfilerFiller profiler) private Map<ResourceKey<? extends Registry<?>>, DataMapLoader.LoadResult<?>> load(ResourceManager manager, ProfilerFiller profiler) private static <A,T> List <DataMapFile<A, T>> readData(RegistryOps<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> voidresolve(Registry<R> registry, com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> value, boolean required, Consumer<Holder<R>> consumer) Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOpsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
PATH
- See Also:
-
results
-
registryAccess
-
-
Constructor Details
-
DataMapLoader
@Deprecated(forRemoval=true, since="1.21.1") public DataMapLoader(ICondition.IContext conditionContext, RegistryAccess registryAccess) Deprecated, for removal: This API element is subject to removal in a future version.UseDataMapLoader(RegistryAccess)instead -
DataMapLoader
-
-
Method Details
-
reload
public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor) -
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 Map<ResourceKey<? extends Registry<?>>,DataMapLoader.LoadResult<?>> load(ResourceManager manager, ProfilerFiller profiler) -
getFolderLocation
-
readData
private static <A,T> List<DataMapFile<A,T>> readData(RegistryOps<JsonElement> ops, DataMapType<T, A> attachmentType, ResourceKey<Registry<T>> registryKey, List<Resource> resources)
-
DataMapLoader(RegistryAccess)instead