In order to use the GSigns API, you need to add the jar-file to your classpath. The latest release can be downloaded from the official github repo:
Don't forget to include GSigns in your plugin.yml:
depend: [GSigns]
Examples of use
Implementing GSigns is quite simple. It requires getting the GSigns-API service from the Bukkit ServiceManager.
// Returns whether the GSigns-API could be found
private boolean setupGSignsAPI() {
if(getServer().getPluginManager().getPlugin("GSigns") == null) {
return false;
}
RegisteredServiceProvider<GSignsAPI> rsp = getServer().getServicesManager().getRegistration(GSignsAPI.class);
if(rsp == null) {
return false;
}
gSignsAPI = rsp.getProvider(); // Save the instance of the public API
return gSignsAPI != null;
}
Create a sign from a code
signUid = gSignsAPI.createSign(code, location1, location2); // where code is a String
Create a sign from an Order object
signUid = gSignsAPI.createSign(order, location1, location2); // where order is an Object from type Order
Remove a sign
gSignsAPI.removeSign(signUid); // where signUid is a previously received UUID object