Class AdvancementLoader
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.AdvancementLoader
Utility class to load Advancements from JSON files
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidload()Loads advancements from the libraries advancements folderstatic AdvancementLads an advancement from a JDON with the provided ID for the instancestatic AdvancementloadResource(org.bukkit.plugin.Plugin plugin, String resourcePath, net.kyori.adventure.key.Key id) Loads an advancement from a given file from within the resources/ folder of a plugin with the provided IDstatic booleansave(net.kyori.adventure.key.Key id, Advancement advancement) Saves an advancement into the libraries advancement folder
-
Constructor Details
-
AdvancementLoader
public AdvancementLoader()
-
-
Method Details
-
load
@Internal public static void load()Loads advancements from the libraries advancements folder -
load
Lads an advancement from a JDON with the provided ID for the instance- Parameters:
path- The target file location.id- The ID to set for the advancement.- Returns:
- The parsed advancement instance.
-
loadResource
public static Advancement loadResource(org.bukkit.plugin.Plugin plugin, String resourcePath, net.kyori.adventure.key.Key id) Loads an advancement from a given file from within the resources/ folder of a plugin with the provided ID- Parameters:
plugin- The target Plugin.resourcePath- The target file.id- The ID to set for the advancement.- Returns:
- The parsed advancement instance.
-
save
Saves an advancement into the libraries advancement folder- Parameters:
id- The Location to store the advancement at (namespace:/path/to/file).advancement- The advancement to save.- Returns:
- Whether the save succeeded or not.
-