Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More API Documentation for interacting with addons #17

Open
Joshinn-io opened this issue Jun 1, 2021 · 1 comment
Open

More API Documentation for interacting with addons #17

Joshinn-io opened this issue Jun 1, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@Joshinn-io
Copy link

Joshinn-io commented Jun 1, 2021

The documentation for working with addons exists, but isn't perfect. The Addon Request API is a bit lacking, and threw me for a loop until I got it figured out. This is just a basic request to add this to the wiki to maybe give people another, more specific example for working with OneBlock. This function will return the phase a player is currently in, if you give the function the player UUID.

    public String getPhase(UUID uuid){
        AddonRequestBuilder builder = new AddonRequestBuilder();
        Map<String, String> map = (Map<String, String>) builder
                .addon("AOneBlock")
                .label("island-stats")
                .addMetaData("player", uuid)
                .request();
        return map.get("phase");
    }

The example on the wiki only has an example where the method is static, and that doesn't work for Oneblock, the example also provides a one value map, not a map with multiple options.

@tastybento
Copy link
Member

Actually, we are moving to a new system called "Pladdons" that are Plugin-compatible Addons (Plugin + Addon). The code is active in 1.17.0-SNAPSHOT BentoBox and we are working on updating the addons. For users there will be no change - the addons will go to the addon folder and it's all backward compatible. For developers and API users the difference will be that you can access the API of addons directly because they are now loaded via the server class loader. So, you should be able to avoid having to use the Addon Request API in the future.

@tastybento tastybento added the documentation Improvements or additions to documentation label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants