⚙️API

Dependency configuration

For typical usages, you should depend on the API jar. It contains no implementation.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.anhcraft.OreProcessor</groupId>
    <artifactId>oreprocessor-api</artifactId>
    <version>v1.2.0</version>
</dependency>

If you want to access the internal, depend on the plugin jar. Be noticed that internal code is subject to change at any time.

<dependency>
    <groupId>dev.anhcraft</groupId>
    <artifactId>oreprocessor</artifactId>
    <version>{version}</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/OreProcessor.jar</systemPath>
</dependency>

API instance

The API implementation is injected at runtime. To access it:

ApiProvider.getApi()

If you use the plugin jar, there is another way to access it internally. Remember, accessing the internal is not recommended.

OreProcessor.getApi()

API versions

Since v1.2.0, there are two separate versions:

  • Legacy: no breaking change in API, published to JitPack, also accessible via the normal plugin jar named OreProcessor

  • Custom Item API: various breaking changes across the API, not published yet, only accessible via the plugin jar named OreProcessor-CustomItem. View Custom Items for further information.

The Custom Item API will soon be merged and become the official API. If you are developing for an existing server, consider using the legacy API. If you are planning to make a new server, consider using the new API version.

Javadoc

Javadoc is not yet published. You can view the source of the API here as everything has been documented: https://github.com/anhcraft/OreProcessor/tree/main/api/src/main/java/dev/anhcraft/oreprocessor/api

Last updated