GSigns
  • 🚀Getting started
  • ❔Frequently Asked Questions
  • Usage
    • 📚Commands
    • ⚙️ Sign coding
  • Developers
    • ☕API
Powered by GitBook
On this page
  • Add GSigns to your plugin
  • Examples of use
  • Create a sign from a code
  • Create a sign from an Order object
  • Remove a sign

Was this helpful?

  1. Developers

API

How to integrate your plugin with GSigns

Previous⚙️ Sign coding

Last updated 4 years ago

Was this helpful?

Add GSigns to your plugin

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
☕
git.io/gsigns-api