Skip to content
Lorenzo Rutayisire edited this page Jun 14, 2020 · 19 revisions

Usage

Using Uppercore requires several steps: installation, depending, and hooking.

Installation

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

Why do I need to install Uppercore?

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.

Depending

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!

Hooking

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.