Class AstralJsonDataLoader

java.lang.Object
net.minecraft.resource.SinglePreparationResourceReloader<Map<net.minecraft.util.Identifier,com.google.gson.JsonElement>>
net.minecraft.resource.JsonDataLoader
dev.jaxydog.astral.content.data.AstralJsonDataLoader
All Implemented Interfaces:
Registered, Registered.Common, net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener, net.minecraft.resource.ResourceReloader
Direct Known Subclasses:
CurrencyLoader

public abstract class AstralJsonDataLoader extends net.minecraft.resource.JsonDataLoader implements net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener, Registered.Common
An extension of a JsonDataLoader that provides additional functionality.

This type is automatically registered.

Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered

    Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server

    Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloader

    net.minecraft.resource.ResourceReloader.Synchronizer
  • Constructor Summary

    Constructors
    Constructor
    Description
    AstralJsonDataLoader(com.google.gson.Gson gson, String folder)
    Creates a new JSON data loader.
    Creates a new JSON data loader.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.util.Identifier
     
    Returns this value's associated registry identifier path.
    void
    Registers this value on both the client and server environments.

    Methods inherited from class net.minecraft.resource.JsonDataLoader

    load, prepare

    Methods inherited from class net.minecraft.resource.SinglePreparationResourceReloader

    apply, reload

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener

    getFabricDependencies

    Methods inherited from interface dev.jaxydog.astral.register.Registered

    getRegistryId

    Methods inherited from interface net.minecraft.resource.ResourceReloader

    getName, reload
  • Constructor Details

    • AstralJsonDataLoader

      public AstralJsonDataLoader(com.google.gson.Gson gson, String folder)
      Creates a new JSON data loader.
      Parameters:
      gson - The GSON instance.
      folder - The folder name.
      Since:
      2.0.0
    • AstralJsonDataLoader

      public AstralJsonDataLoader(String folder)
      Creates a new JSON data loader.
      Parameters:
      folder - The folder name.
      Since:
      2.0.0
  • Method Details

    • getRegistryPath

      public String getRegistryPath()
      Description copied from interface: Registered
      Returns this value's associated registry identifier path.

      This is by default used to determine the Identifier provided by Registered.getRegistryId(). For example, returning "my_item" will cause the associated identifier to be astral:my_item.

      Specified by:
      getRegistryPath in interface Registered
      Returns:
      An identifier path.
    • getFabricId

      public net.minecraft.util.Identifier getFabricId()
      Specified by:
      getFabricId in interface net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener
    • registerCommon

      public void registerCommon()
      Description copied from interface: Registered.Common
      Registers this value on both the client and server environments.

      The contained code will run for both environments. If you only want one or the other, see its sister interfaces.

      Specified by:
      registerCommon in interface Registered.Common
      See Also: