Class JSONLoader

java.lang.Object
software.bluelib.json.JSONLoader

public class JSONLoader extends Object
A public class responsible for loading and parsing JSON data from resources defined by ResourceLocation within a Minecraft mod environment.
It uses the Gson library to convert JSON strings into JsonObject instances.

Key Methods:

Since:
1.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gson.JsonObject
    loadJson(net.minecraft.resources.ResourceLocation pResourceLocation, net.minecraft.server.packs.resources.ResourceManager pResourceManager)
    A public JsonObject that loads JSON data from a ResourceLocation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JSONLoader

      public JSONLoader()
  • Method Details

    • loadJson

      public com.google.gson.JsonObject loadJson(net.minecraft.resources.ResourceLocation pResourceLocation, net.minecraft.server.packs.resources.ResourceManager pResourceManager)
      A public JsonObject that loads JSON data from a ResourceLocation.
      This method is typically used to load configuration files or other JSON-based resources in a Minecraft mod environment.
      Parameters:
      pResourceLocation - ResourceLocation - The ResourceLocation of the JSON resource.
      pResourceManager - ResourceManager - The ResourceManager used to load the resource.
      Returns:
      The loaded JsonObject. Returns an empty JsonObject if the resource is not found.
      Throws:
      RuntimeException - if there is an error reading the resource.
      Since:
      1.0.0