Skip to content

Conversation

@thomasmny
Copy link
Owner

@thomasmny thomasmny commented Jun 16, 2023

Add developer API

Adding BuildSystem to your project

Maven:

<dependency>
  <groupId>de.eintosti</groupId>
  <artifactId>buildsystem-api</artifactId>
  <version>version</version>
</dependency>

Or alternatively, with Gradle:

repositories {
  mavenCentral()
}
dependencies {
  compileOnly("de.eintosti:buildsystem-api:version")
}

Obtaining an instance of the API

Using the singleton

Note: this method will throw an IllegalStateException if the API is not loaded.

BuildSystem api = BuildSystemProvider.get();
...

Using the Bukkit ServicesManager

RegisteredServiceProvider<BuildSystem> provider = Bukkit.getServicesManager().getRegistration(BuildSystem.class);
if (provider != null) {
    BuildSystem api = provider.getProvider();
    ...
}

@thomasmny thomasmny added wip The PR is a WIP. type: feature labels Jun 16, 2023
@thomasmny thomasmny marked this pull request as ready for review June 16, 2023 14:49
@thomasmny thomasmny removed the wip The PR is a WIP. label Jun 16, 2023
@thomasmny thomasmny merged commit bb8fbaa into dev/v3 Jun 16, 2023
@thomasmny thomasmny deleted the feature/api branch June 16, 2023 15:12
@thomasmny thomasmny changed the title Add API Add developer API Jun 16, 2023
@thomasmny thomasmny mentioned this pull request Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants