Class LootLoader

java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootLoader

public class LootLoader extends Object
Internal utility class responsible for loading and registering LootTables.

This loader scans the loot_tables/ directory in the plugin data folder, parsing .json files into loot table objects and registering them with their namespaced identifiers.

  • Constructor Details

    • LootLoader

      public LootLoader()
  • Method Details

    • load

      public static void load()
      Orchestrates the discovery and loading of loot tables from the local file system.

      If the loot_tables/ directory does not exist, it will be created. Otherwise, it performs a recursive walk through the folder to find and process all valid .json files.

    • load

      public static LootTable load(Path path)
      Decodes a LootTable from a file on the disk.
      Parameters:
      path - The Path of the file to read.
      Returns:
      The decoded LootTable, or null if parsing fails.
    • loadResource

      public static LootTable loadResource(org.bukkit.plugin.Plugin plugin, String resourcePath)
      Decodes a LootTable from a plugin's embedded resource.
      Parameters:
      plugin - The Plugin instance containing the resource.
      resourcePath - The internal path to the resource file (e.g., "loot/default.json").
      Returns:
      The decoded LootTable, or null if the resource is missing or invalid.