SkinsRestorer API
SkinsRestorer has a public API that can be used by other plugins to interact with SkinsRestorer.
Please note that this API is still work-in-progress. Expect breaking changes!
Resources
You can find useful resources to the SkinsRestorer API below:
Add to your build file
Here is an example of how to add the API to your build file. Select your build tool below.
Latest Version (Without the v):
Add the following repository and dependency to your pom.xml
file:
<repositories>
<repository>
<id>codemc</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<!-- SkinsRestorer API -->
<dependency>
<groupId>net.skinsrestorer</groupId>
<artifactId>skinsrestorer-api</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
</dependencies>
Add SkinsRestorer as a dependency
If you want to use the API in your plugin, you will need to add SkinsRestorer as a dependency of your plugin.
This is used, so SkinsRestorer is loaded BEFORE your plugin, so you can use the API in your onEnable()
method.
In the example below, we will use a soft dependency, so your plugin will still work if SkinsRestorer is not installed,
but to use the API, SkinsRestorer will need to be installed.
Errors will be thrown if SkinsRestorer is not installed, but you use the API.
The process below may vary depending on your build configuration.
(E.g., you have a build plugin that generates plugin configs)
Add the following dependency to your plugin.yml
file:
softdepend: [ "SkinsRestorer" ]
When using BungeeCord/Velocity?
If you are using BungeeCord/Velocity, you must have a plugin that calls the API on BungeeCord/Velocity. You would need to use in/out put channels to send this information across both of your custom plugins.
Getting issues?
- Make sure to import all your classes if you see the message “Cannot find symbol” or “Cannot resolve symbol”
- Make sure to get the API using
this.skinsRestorer = SkinsRestorerProvider.get();
and you have the fieldprivate SkinsRestorer skinsRestorer;
at the start of your class. - Make sure to add the dependency to your build file as described above.
- Make sure to add the dependency to your plugin.yml as described above.
- Make sure SkinsRestorer is not in “Proxy Mode” if you are using BungeeCord/Velocity.