Skip to content
NonSwag edited this page Jun 16, 2024 · 1 revision

Repository

To seamlessly integrate our API into your project, please visit our repository. Select your preferred build tool and incorporate the version you intend to use.

Gradle Example

For Gradle users, add the repository and dependency to your build.gradle.kts:

repositories {
    maven("https://repo.thenextlvl.net/releases")
}

dependencies {
    compileOnly("net.thenextlvl.gopaint:api:version")
}

Note

Be sure to replace version with the actual version number.
The correct version of FastAsyncWorldEdit will be provided automatically
Also you shouldn't shade the API into your Jar as it is already provided by the plugin.

API Documentation

The BrushController

With the brush controller you can manage and retrieve brush settings from players and items

BrushController controller = Bukkit.getServicesManager().load(BrushController.class);

The BrushRegistry

The brush registry allows you to register, unregister and retrieve brushes

BrushRegistry registry = Bukkit.getServicesManager().load(BrushRegistry.class);

To register a new brush you have to invoke BrushRegistry#register

Creating new brushes

In order to create a new brush you have to extend Brush, you need to provide a name, description and player head value.
In addition to that you have to overwrite the Brush#paint method. In there you perform all of your calculations and edits.
We recommend using Brush#performEdit to retrieve an edit session and Brush#setBlock to manipulate blocks, as it immediately frees resources after execution.

For ease of use we provide some math classes for you:

  • Curve
    • BezierSpline
    • BezierSplineSegment
  • ConnectedBlocks
  • Height
  • Sphere
  • Surface

Tip

You can always take a look at our default implementations of brushes if you need help

Clone this wiki locally