-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Using Uppercore requires several steps: installation, depending, and hooking.
Requirements:
- git
- gradle
Clone the repository (or just download and extract the ZIP) wherever you like using:
git clone https://github.com/upperlevel/uppercore.git
With a terminal, step inside the Uppercore folder:
cd uppercore
Publish Uppercore to Maven local using:
gradle publishToMavenLocal
Uppercore hasn't yet been deployed to Maven central, thus you need to download its code, build it by yourself and publish the artifacts to your local Maven repository so that your plugins will see it.
Edit your plugin's build.gradle and insert these lines:
repositories {
mavenLocal()
}
dependencies {
implementation group: 'xyz.upperlevel.uppercore', name: 'uppercore', version: '2.0'
}
shadowJar {
relocate 'xyz.upperlevel.uppercore', '<your-project-package-name>.uppercore'
}
Basically Uppercore is fetched in your Maven local repository and then it's relocated within your plugin's code. This means you don't need to put Uppercore artifacts inside the plugins folder! All lies inside your plugin!
Within your plugin's entry class, insert the following line inside the onEnable()
method.
@Override
public void onEnable() {
Uppercore.hook(this, BSTATS_ID);
}
Where BSTATS_ID
is the ID of the plugin in bstats.org, a metrics platform.
If not supported, just set it to 0.