Plugin Protector
Integration guide

License Check

This page shows how to integrate MC License into your plugin.

Adding the library

We offer two ways to add MC License to your plugin:

Option 1 — Dependency (recommended)

Add the following repository and dependency to your build file:

<repositories>
  <repository>
    <id>flyte-repository-releases</id>
    <name>Flyte Repository</name>
    <url>https://repo.flyte.gg/releases</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>org.mclicense</groupId>
    <artifactId>library</artifactId>
    <version>1.5.1</version>
    <scope>compile</scope>
  </dependency>
</dependencies>
repositories {
    maven {
        name = "flyteRepositoryReleases"
        url = uri("https://repo.flyte.gg/releases")
    }
}

dependencies {
    implementation "org.mclicense:library:1.5.1"
}
repositories {
    maven {
        name = "flyteRepositoryReleases"
        url = uri("https://repo.flyte.gg/releases")
    }
}

dependencies {
    implementation("org.mclicense:library:1.5.1")
}

Option 2 — Single class (copy/paste)

Copy MCLicense.java or MCLicense.kt from the mcl-library-one-class repository.

Checking a license

Each check requires the plugin's 8-character pluginId. The user places their key in the empty mclicense.txt file created in the plugin folder.

if (!MCLicense.validateKey(this, "yourPluginId")) {
    Bukkit.getPluginManager().disablePlugin(this);
    return;
}

The combined website always injects exactly this behavior. It never creates licensing configuration files besides mclicense.txt.