Sytm / waypoints

A plugin to create waypoints like the mod, but just using Paper
https://modrinth.com/plugin/waypoints/
MIT License
29 stars 8 forks source link

Java API #105

Closed Izocel closed 1 year ago

Izocel commented 1 year ago

Is your feature request related to a problem? Please describe. Nope

Describe the solution you'd like Hi :) i'm a plugin developper myself, and I'm into "questing" programation right now. You plugin would be usefull for quest traking etc.... Is there an API that I could implement to work with your plugin ?

Thnaks in advance ~Izo

Sytm commented 1 year ago

If you just want the pointers, they are available as a separate library: https://github.com/Sytm/waypoints/blob/v4/master/pointers/README.md

Izocel commented 1 year ago

Oks thanks for that can you send a list of available API from your repos such as the pointer one ?

Sytm commented 1 year ago

If you want to see an example on how to only use the pointers library take a look at this project: https://github.com/Sytm/quest-pointers

It might be written in Kotlin, but the usage would be the same. You just need to make sure you are additionally shading the kotlin stdlib

Izocel commented 1 year ago

I would be ok for how to use it i'mjust wondering if there's any other part i could use a API than pointers ?

Sytm commented 1 year ago

There is also an API for Waypoints itself which resides inside the waypoints-api folder/submodule, but that requires the usage of Kotlin. (I once included a hacky way to access the Kotlin api from Java, but it was really bad)

Izocel commented 1 year ago

Ok i feel you :P thanks for the responses -> 200 Ok : out

Izocel commented 1 year ago

would you have a pom.xml 'maven' example how i could import those: Since they are in kotlin

        <repository>
            <id>md5lukas-repo-releases</id>
            <name>Md5Lukas' Reposilite Repository</name>
            <url>https://repo.md5lukas.de/releases</url>
        </repository>

        <dependency>
            <groupId>de.md5lukas.waypoints</groupId>
            <artifactId>pointers</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>de.md5lukas.waypoints</groupId>
            <artifactId>waypoints-api</artifactId>
            <version>4.2.0</version>
        </dependency>
Sytm commented 1 year ago

You a re basically on the right track with that pom. Although 4.3.0 added functions to the waypoints-api that converts the Kotlin only suspend function into Java CompletableFutures. Kotlin code can be called from Java just fine.

Also perhaps take a look at this to get started