Class AddonLoader

java.lang.Object
de.craftsblock.craftsnet.addon.loaders.AddonLoader

public final class AddonLoader extends Object
The AddonLoader class is responsible for loading and managing addons in the application. It loads addon jar files, extracts necessary information, and initializes addon instances.
Since:
1.0.0-SNAPSHOT
See Also:
  • Constructor Details

    • AddonLoader

      public AddonLoader(CraftsNet craftsNet)
      Constructs a new instance of an addon loader
      Parameters:
      craftsNet - The CraftsNet instance which instantiates this
  • Method Details

    • update

      public void update(String file)
      Adds a new addon file to the loader using the file name.
      Parameters:
      file - The name of the addon file.
    • update

      public void update(Path path)
      Adds a new addon to the loader using the path to the file.
      Parameters:
      path - The addon path to add.
    • reset

      public void reset()
      Clears all addon paths from the stack.
      Since:
      3.4.3
    • load

      public List<AddonConfiguration> load() throws IOException
      Loads all the addons from the provided addon files.
      Returns:
      A list of AddonConfiguration which where loaded from the addon files.
      Throws:
      IOException - if there is an I/O error while loading the addons.
    • load

      public void load(List<AddonConfiguration> rawConfigurations)
      Loads all the addons from the provided list of AddonConfiguration.
      Parameters:
      rawConfigurations - The list of AddonConfiguration.
    • retrieveServices

      public List<RegisteredService> retrieveServices(JarFile file) throws IOException
      Utility method for loading RegistrableService instances from a jar file.
      Parameters:
      file - The jar file from which to load RegistrableService instances.
      Returns:
      A list of RegistrableService instances loaded from the specified jar file.
      Throws:
      IOException - If an I/O error occurs while processing the jar file or reading its contents.
      See Also: