Class RecipeLoader
java.lang.Object
com.github.darksoulq.abyssallib.world.recipe.RecipeLoader
A utility class for loading, parsing, and registering Minecraft recipes from external files.
This class supports standard Minecraft recipe types (Shaped, Shapeless, Furnace, etc.) as well as custom types. It uses a RecipeType system to decode JSON and YAML data into recipe objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLoads a single recipe file from the file system.static intloadFolder(File folder) Recursively scans a folder and loads all JSON and YAML files found as recipes.static intloadFolder(org.bukkit.plugin.Plugin plugin, String resourcePath) Loads recipes from a specific resource path within a plugin's JAR.static voidloadResource(org.bukkit.plugin.Plugin plugin, String resourcePath) Loads a single recipe from a plugin resource.static voidregisterToBukkit(CustomRecipe recipe) static voidreload()Finalizes the recipe loading process by injecting all registered recipes into the Bukkit server.
-
Constructor Details
-
RecipeLoader
public RecipeLoader()
-
-
Method Details
-
loadFolder
-
loadFolder
Loads recipes from a specific resource path within a plugin's JAR.- Parameters:
plugin- ThePlugininstance.resourcePath- The internal path (e.g., "recipes/").
-
loadFile
-
loadResource
Loads a single recipe from a plugin resource.- Parameters:
plugin- ThePluginowning the resource.resourcePath- The path to the file.
-
reload
@Internal public static void reload()Finalizes the recipe loading process by injecting all registered recipes into the Bukkit server.This method iterates through all internal registries and calls
Bukkit.addRecipe(org.bukkit.inventory.Recipe)or adds potion mixes to the brewing system. -
registerToBukkit
-