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.
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.
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.