Package software.bluelib.json
Class JSONLoader
java.lang.Object
software.bluelib.json.JSONLoader
A
It uses the
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:
loadJson(ResourceLocation, ResourceManager)- Loads a JSON resource from the specified location.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectloadJson(net.minecraft.resources.ResourceLocation pResourceLocation, net.minecraft.server.packs.resources.ResourceManager pResourceManager) ApublicJsonObjectthat loads JSON data from aResourceLocation.
-
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) ApublicJsonObjectthat loads JSON data from aResourceLocation.
This method is typically used to load configuration files or other JSON-based resources in a Minecraft mod environment.- Parameters:
pResourceLocation-ResourceLocation- TheResourceLocationof the JSON resource.pResourceManager-ResourceManager- TheResourceManagerused to load the resource.- Returns:
- The loaded
JsonObject. Returns an emptyJsonObjectif the resource is not found. - Throws:
RuntimeException- if there is an error reading the resource.- Since:
- 1.0.0
-