Class ArtifactLoader
java.lang.Object
de.craftsblock.craftsnet.addon.artifacts.ArtifactLoader
The
ArtifactLoader class provides functionality for resolving and loading libraries (artifacts)
for addons in a modular system.- Since:
- 3.0.0-SNAPSHOT
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRepository(String repo) Adds a remote repository to the list of repositories used for dependency resolution.voidcleanup()Cleanup internal repository cacheURL[]loadLibraries(CraftsNet craftsNet, AddonLoader addonLoader, Collection<RegisteredService> services, String addon, String... libraries) Loads libraries for a specific addon based on the provided library coordinates.voidstop()Cleanup and shutdown of the internal repository resolver
-
Constructor Details
-
ArtifactLoader
public ArtifactLoader()Creates a new instance of the artifact loader
-
-
Method Details
-
cleanup
public void cleanup()Cleanup internal repository cache -
stop
public void stop()Cleanup and shutdown of the internal repository resolver -
addRepository
Adds a remote repository to the list of repositories used for dependency resolution.- Parameters:
repo- The URL of the remote repository to be added.
-
loadLibraries
public URL[] loadLibraries(CraftsNet craftsNet, AddonLoader addonLoader, Collection<RegisteredService> services, String addon, String... libraries) Loads libraries for a specific addon based on the provided library coordinates.- Parameters:
craftsNet- TheCraftsNetinstance that loads the libraries.addonLoader- The addon loader responsible for loading services.services- The list with the currently registered services.addon- The name of the addon for which libraries are being loaded.libraries- The coordinates of the libraries to be loaded.- Returns:
- An array of URLs representing the loaded libraries.
-