Class AddonLoader
java.lang.Object
de.craftsblock.craftsnet.addon.loaders.AddonLoader
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 Summary
ConstructorsConstructorDescriptionAddonLoader(CraftsNet craftsNet) Constructs a new instance of an addon loader -
Method Summary
Modifier and TypeMethodDescriptionload()Loads all the addons from the provided addon files.voidload(List<AddonConfiguration> rawConfigurations) Loads all the addons from the provided list ofAddonConfiguration.voidreset()Clears all addon paths from the stack.retrieveServices(JarFile file) Utility method for loading RegistrableService instances from a jar file.voidAdds a new addon file to the loader using the file name.voidAdds a new addon to the loader using the path to the file.
-
Constructor Details
-
AddonLoader
Constructs a new instance of an addon loader- Parameters:
craftsNet- The CraftsNet instance which instantiates this
-
-
Method Details
-
update
Adds a new addon file to the loader using the file name.- Parameters:
file- The name of the addon file.
-
update
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
Loads all the addons from the provided addon files.- Returns:
- A list of
AddonConfigurationwhich where loaded from the addon files. - Throws:
IOException- if there is an I/O error while loading the addons.
-
load
Loads all the addons from the provided list ofAddonConfiguration.- Parameters:
rawConfigurations- The list ofAddonConfiguration.
-
retrieveServices
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:
-