# API

## Add GSigns to your plugin <a href="#add-oraxen-to-your-plugin" id="add-oraxen-to-your-plugin"></a>

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: [git.io/gsigns-api](https://git.io/gsigns-api)

{% hint style="info" %}
Don't forget to include GSigns in your `plugin.yml`:

```yaml
depend: [GSigns]
```

{% endhint %}

## Examples of use

Implementing GSigns is quite simple. It requires getting the GSigns-API service from the Bukkit ServiceManager.

```java
// 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

```java
signUid = gSignsAPI.createSign(code, location1, location2); // where code is a String
```

### Create a sign from an Order object

```java
signUid = gSignsAPI.createSign(order, location1, location2); // where order is an Object from type Order
```

### Remove a sign

```java
gSignsAPI.removeSign(signUid); // where signUid is a previously received UUID object
```
