Package net.minecraft.resources
Class RegistryDataLoader
java.lang.Object
net.minecraft.resources.RegistryDataLoader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record(package private) static interfacestatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<RegistryDataLoader.RegistryData<?>> private static final Comparator<ResourceKey<?>> private static final org.slf4j.Loggerprivate static final RegistrationInfoprivate static final Function<Optional<KnownPack>, RegistrationInfo> static final List<RegistryDataLoader.RegistryData<?>> static final List<RegistryDataLoader.RegistryData<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static RegistryOps.RegistryInfoLookupcreateContext(List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.Loader<?>> loaders) private static <T> RegistryOps.RegistryInfo<T> createInfoForContextRegistry(HolderLookup.RegistryLookup<T> registryLookup) private static <T> RegistryOps.RegistryInfo<T> createInfoForNewRegistry(WritableRegistry<T> registry) private static ReportedExceptioncreateReportWithBriefInfo(Map<ResourceKey<?>, Exception> errors) static RegistryAccess.Frozenload(Map<ResourceKey<? extends Registry<?>>, RegistryDataLoader.NetworkedRegistryData> elements, ResourceProvider resourceProvider, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) private static RegistryAccess.Frozenload(RegistryDataLoader.LoadingFunction loadingFunction, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) Deprecated.private static RegistryAccess.Frozenload(RegistryDataLoader.LoadingFunction loadingFunction, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData, boolean fromResources) static RegistryAccess.Frozenload(ResourceManager resourceManager, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) (package private) static <E> voidloadContentsFromManager(ResourceManager resourceManager, RegistryOps.RegistryInfoLookup registryInfoLookup, WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, Map<ResourceKey<?>, Exception> loadingErrors) (package private) static <E> voidloadContentsFromNetwork(Map<ResourceKey<? extends Registry<?>>, RegistryDataLoader.NetworkedRegistryData> elements, ResourceProvider resourceProvider, RegistryOps.RegistryInfoLookup registryInfoLookup, WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, Map<ResourceKey<?>, Exception> loadingErrors) private static <E> voidloadElementFromResource(WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, RegistryOps<JsonElement> ops, ResourceKey<E> resourceKey, Resource resource, RegistrationInfo registrationInfo) private static ReportedExceptionlogErrors(Map<ResourceKey<?>, Exception> errors) private static voidprintFullDetailsToLog(Map<ResourceKey<?>, Exception> errors)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ERROR_KEY_COMPARATOR
-
NETWORK_REGISTRATION_INFO
-
REGISTRATION_INFO_CACHE
-
WORLDGEN_REGISTRIES
-
DIMENSION_REGISTRIES
-
SYNCHRONIZED_REGISTRIES
-
-
Constructor Details
-
RegistryDataLoader
public RegistryDataLoader()
-
-
Method Details
-
load
public static RegistryAccess.Frozen load(ResourceManager resourceManager, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) -
load
public static RegistryAccess.Frozen load(Map<ResourceKey<? extends Registry<?>>, RegistryDataLoader.NetworkedRegistryData> elements, ResourceProvider resourceProvider, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) -
load
@Deprecated private static RegistryAccess.Frozen load(RegistryDataLoader.LoadingFunction loadingFunction, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData) Deprecated.Neo: usethe source-aware variant -
load
private static RegistryAccess.Frozen load(RegistryDataLoader.LoadingFunction loadingFunction, List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.RegistryData<?>> registryData, boolean fromResources) -
createContext
private static RegistryOps.RegistryInfoLookup createContext(List<HolderLookup.RegistryLookup<?>> registryLookups, List<RegistryDataLoader.Loader<?>> loaders) -
createInfoForNewRegistry
private static <T> RegistryOps.RegistryInfo<T> createInfoForNewRegistry(WritableRegistry<T> registry) -
createInfoForContextRegistry
private static <T> RegistryOps.RegistryInfo<T> createInfoForContextRegistry(HolderLookup.RegistryLookup<T> registryLookup) -
logErrors
-
printFullDetailsToLog
-
createReportWithBriefInfo
-
loadElementFromResource
private static <E> void loadElementFromResource(WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, RegistryOps<JsonElement> ops, ResourceKey<E> resourceKey, Resource resource, RegistrationInfo registrationInfo) throws IOException - Throws:
IOException
-
loadContentsFromManager
static <E> void loadContentsFromManager(ResourceManager resourceManager, RegistryOps.RegistryInfoLookup registryInfoLookup, WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, Map<ResourceKey<?>, Exception> loadingErrors) -
loadContentsFromNetwork
static <E> void loadContentsFromNetwork(Map<ResourceKey<? extends Registry<?>>, RegistryDataLoader.NetworkedRegistryData> elements, ResourceProvider resourceProvider, RegistryOps.RegistryInfoLookup registryInfoLookup, WritableRegistry<E> registry, com.mojang.serialization.Decoder<E> codec, Map<ResourceKey<?>, Exception> loadingErrors)
-
the source-aware variant