Class AdvancementLoader

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.AdvancementLoader

public class AdvancementLoader extends Object
Utility class to load Advancements from JSON files
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Loads advancements from the libraries advancements folder
    load(Path path, net.kyori.adventure.key.Key id)
    Lads an advancement from a JDON with the provided ID for the instance
    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
    static boolean
    save(net.kyori.adventure.key.Key id, Advancement advancement)
    Saves an advancement into the libraries advancement folder

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdvancementLoader

      public AdvancementLoader()
  • Method Details

    • load

      @Internal public static void load()
      Loads advancements from the libraries advancements folder
    • load

      public static Advancement load(Path path, net.kyori.adventure.key.Key id)
      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

      public static boolean save(net.kyori.adventure.key.Key id, Advancement advancement)
      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.