GC-spigot / battle-pass

The best battle pass plugin on Spigot
56 stars 15 forks source link

Outdated API documentation #465

Open HielkeMaps opened 10 months ago

HielkeMaps commented 10 months ago

Describe the bug

The Developer API documentation (https://battlepass.advancedplugins.net/developer-api/developer-api-creating-your-own-quest-types) seems to be outdated. When working with the API, the docs say to extend ActionQuestExecuter, but this class seems to be deprecated.

My code: image

Firstly the method shown on the website with just a single BattlePlugin parameter doesn't even exist, you need a second string parameter. What does this parameter mean? I have no idea.

Secondly the whole method is deprecated. Which do I use instead? I have no idea.

There is a ActionContainer class that looks promising, then you can call super.executionBuilder() No idea what this all does though. What do the arguments mean? Is this how I create my own Quest?

My code: image

All in all, I just want the API documentation to be updated, as well as maybe releasing the JavaDocs so people know how to work with the API.

How to reproduce

.

Screenshots / Videos

No response

Server Log

No response

KPGTB commented 9 months ago

Hey! Currently, you should use ActionQuestExecutor. The 2nd parameter in constructor is a plugin name.

public class MyCustomQuest extends ActionQuestExecutor {
    public MyCustomQuest(JavaPlugin plugin) {
        super(plugin, "my_plugin_name");
    }

    // Event Handlers...
}

@GC-spigot can you update dev docs and add that plugin name parameter into example code?

Timongcraft commented 8 months ago

Also in the dev docs under General API Methods, it says you should use a reward method, which requires a user. It also mentions that you can obtain that user with CompletableFuture<Optional<User>> getUser(UUID), but there is no class provided where you should execute these methods. Even after decompiling, I can't find a getUser method. I discovered that you can access the user cache with BattlePlugin.getPlugin().getUserCache() and get or load users from there. However, since this is not documented I wanted to mention that here.