> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.refineryteam.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Adding RefineryCore as a dependency and setting up your plugin's build.

## Server requirements

* **PaperMC 1.20 or newer** (up to the latest 1.21.x). RefineryCore compiles against the plain `paper-api`, not `paperweight.userdev`, since it only uses public Bukkit/Paper API — this means one build of RefineryCore loads on any Paper build in that range without needing a version-pinned jar.
* **Java 21** toolchain.

## Adding the dependency

RefineryCore is published to Refinery's Reposilite instance. Add the repository and dependency to your plugin's `build.gradle.kts`:

```kotlin theme={"system"}
repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    maven("https://repository.reaudacity.online/releases")
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
    compileOnly("xyz.refineryteam:refinerycore:VERSION")
}
```

Replace `VERSION` with the latest published version.

## Declaring the dependency in plugin.yml / paper-plugin.yml

Your plugin needs to load **after** RefineryCore, so declare it as a hard dependency:

```yaml theme={"system"}
depend:
  - RefineryCore
```

Or, if you're using `bukkitPluginYaml` in Gradle:

```kotlin theme={"system"}
bukkitPluginYaml {
    depend.addAll("RefineryCore")
}
```

## Implementing `RefineryPluginImplementation`

Your plugin's main class should implement `RefineryPluginImplementation` to get access to the command registry, console logging, and server-version helpers:

```java MyPlugin.java icon="java" theme={"system"}
public final class MyPlugin extends JavaPlugin implements RefineryPluginImplementation {

    @Override
    public void onEnable() {
        getCommandRegistry().register(new MyCommand(this));
        logMessage("<green>MyPlugin has started!");
    }
}
```

See the [Overview](/refinerycore/overview) page for what this interface provides.

## Toolchain

RefineryCore itself builds with:

```kotlin theme={"system"}
java {
    toolchain.languageVersion = JavaLanguageVersion.of(21)
}
```

Downstream plugins should match this to avoid class-file version mismatches.
