Package net.minecraft.resource
Class JsonDataLoader
java.lang.Object
net.minecraft.resource.SinglePreparationResourceReloader<Map<Identifier,JsonElement>>
net.minecraft.resource.JsonDataLoader
- All Implemented Interfaces:
ResourceReloader
- Direct Known Subclasses:
LootConditionManager,LootManager,RecipeManager,ServerAdvancementLoader
public abstract class JsonDataLoader extends SinglePreparationResourceReloader<Map<Identifier,JsonElement>>
An abstract implementation of resource reloader that reads JSON files
into Gson representations in the prepare stage.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer -
Field Summary
-
Constructor Summary
Constructors Constructor Description JsonDataLoader(Gson gson, String dataType) -
Method Summary
Modifier and Type Method Description protected Map<Identifier,JsonElement>prepare(ResourceManager resourceManager, Profiler profiler)Prepares the intermediate object.Methods inherited from class net.minecraft.resource.SinglePreparationResourceReloader
apply, reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReloader
getName
-
Field Details
-
LOGGER
-
FILE_SUFFIX_LENGTH
private static final int FILE_SUFFIX_LENGTH -
gson
-
dataType
-
-
Constructor Details
-
JsonDataLoader
-
-
Method Details
-
prepare
Description copied from class:SinglePreparationResourceReloaderPrepares the intermediate object.This method is called in the prepare executor in a reload.
- Specified by:
preparein classSinglePreparationResourceReloader<Map<Identifier,JsonElement>>- Parameters:
resourceManager- the resource managerprofiler- the prepare profiler- Returns:
- the prepared object
-