Class LootLoader
java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootLoader
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidload()Orchestrates the discovery and loading of loot tables from the local file system.static LootTableDecodes aLootTablefrom a file on the disk.static LootTableloadResource(org.bukkit.plugin.Plugin plugin, String resourcePath) Decodes aLootTablefrom a plugin's embedded resource.
-
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.jsonfiles. -
load
Decodes aLootTablefrom a file on the disk. -
loadResource
Decodes aLootTablefrom a plugin's embedded resource.- Parameters:
plugin- ThePlugininstance containing the resource.resourcePath- The internal path to the resource file (e.g., "loot/default.json").- Returns:
- The decoded
LootTable, ornullif the resource is missing or invalid.
-