Class JsonDataLoader

java.lang.Object
net.minecraft.resource.SinglePreparationResourceReloader<Map<Identifier,com.google.gson.JsonElement>>
net.minecraft.resource.JsonDataLoader
All Implemented Interfaces:
ResourceReloader
Direct Known Subclasses:
RecipeManager, ServerAdvancementLoader

public abstract class JsonDataLoader extends SinglePreparationResourceReloader<Map<Identifier,com.google.gson.JsonElement>>
An abstract implementation of resource reloader that reads JSON files into Gson representations in the prepare stage.
Mappings:
Namespace Name
official anx
intermediary net/minecraft/class_4309
named net/minecraft/resource/JsonDataLoader
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official a Lanx;a:Lorg/slf4j/Logger;
      intermediary field_19377 Lnet/minecraft/class_4309;field_19377:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/resource/JsonDataLoader;LOGGER:Lorg/slf4j/Logger;
    • gson

      private final com.google.gson.Gson gson
      Mappings:
      Namespace Name Mixin selector
      official b Lanx;b:Lcom/google/gson/Gson;
      intermediary field_19379 Lnet/minecraft/class_4309;field_19379:Lcom/google/gson/Gson;
      named gson Lnet/minecraft/resource/JsonDataLoader;gson:Lcom/google/gson/Gson;
    • dataType

      private final String dataType
      Mappings:
      Namespace Name Mixin selector
      official c Lanx;c:Ljava/lang/String;
      intermediary field_19380 Lnet/minecraft/class_4309;field_19380:Ljava/lang/String;
      named dataType Lnet/minecraft/resource/JsonDataLoader;dataType:Ljava/lang/String;
  • Constructor Details

    • JsonDataLoader

      public JsonDataLoader(com.google.gson.Gson gson, String dataType)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lanx;<init>(Lcom/google/gson/Gson;Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_4309;<init>(Lcom/google/gson/Gson;Ljava/lang/String;)V
      named <init> Lnet/minecraft/resource/JsonDataLoader;<init>(Lcom/google/gson/Gson;Ljava/lang/String;)V
  • Method Details

    • prepare

      protected Map<Identifier,com.google.gson.JsonElement> prepare(ResourceManager resourceManager, Profiler profiler)
      Description copied from class: SinglePreparationResourceReloader
      Prepares the intermediate object.

      This method is called in the prepare executor in a reload.

      Specified by:
      prepare in class SinglePreparationResourceReloader<Map<Identifier,com.google.gson.JsonElement>>
      Parameters:
      resourceManager - the resource manager
      profiler - the prepare profiler
      Returns:
      the prepared object
      Mappings:
      Namespace Name Mixin selector
      official a Lanx;a(Lant;Lbdp;)Ljava/util/Map;
      intermediary method_20731 Lnet/minecraft/class_4309;method_20731(Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)Ljava/util/Map;
      named prepare Lnet/minecraft/resource/JsonDataLoader;prepare(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)Ljava/util/Map;
    • load

      public static void load(ResourceManager manager, String dataType, com.google.gson.Gson gson, Map<Identifier,com.google.gson.JsonElement> results)
      Mappings:
      Namespace Name Mixin selector
      official a Lanx;a(Lant;Ljava/lang/String;Lcom/google/gson/Gson;Ljava/util/Map;)V
      intermediary method_51148 Lnet/minecraft/class_4309;method_51148(Lnet/minecraft/class_3300;Ljava/lang/String;Lcom/google/gson/Gson;Ljava/util/Map;)V
      named load Lnet/minecraft/resource/JsonDataLoader;load(Lnet/minecraft/resource/ResourceManager;Ljava/lang/String;Lcom/google/gson/Gson;Ljava/util/Map;)V