/ClopLib

Minecraft server library for handling events that take place in varying positions within game worlds

Primary LanguageJavaApache License 2.0Apache-2.0

Claim Operations Library


ClopLib (Claim Operations Library) is a Minecraft server library for handling events that take place in varying positions within game worlds, to allow developers to contextually cancel or modify the outcome of operations such as block placement, block breaking, entity spawning, based on whether the type of operation was performed within a claimed region.

Currently, ClopLib targets bukkit servers running Spigot/Paper 1.17.1+. ClopLib requires Java 17.

Setup

ClopLib is available on Maven. You can browse the Javadocs here.

Gradle setup instructions

First, add the Maven repository to your build.gradle file:

repositories {
    maven { url "https://repo.william278.net/releases" }
}

Then, add the dependency itself. Replace VERSION with the latest release version. (e.g., 1.0.11) and PLATFORM with the platform you are targeting (e.g., bukkit). If you want to target pre-release "snapshot" versions (not recommended), you should use the /snapshots repository instead.

dependencies {
    implementation "net.william278.cloplib:cloplib-PLATFORM:VERSION"
}

Using Maven/something else? There's instructions on how to include ClopLib on the repo browser.

Using

  • ✅ This library IS intended for people developing land protection or plugins & mods that want an easy way of contextually handling when the world or players do stuff.
  • ❌ This library IS NOT intended for people wanting to develop hooks for HuskClaims or HuskTowns. Please see the API reference for HuskClaims and HuskTowns respectively. You do not need to include this library or add it to your /plugins folder; ClopLib is shaded & relocated in the final jar for each plugin.

Documentation on using ClopLib in your projects is a WIP! At it's core, though, HuskClaims exposes a:

  • The Handler interface, which you should implement in your plugin
  • The OperationUser interface, which you should implement via your object representing online players
  • The OperationPosition/World/Chunk interfaces, which you should implement via your object(s) representing game world positions
  • The OperationListener interface, and platform-specific interfaces such as BukkitOperationListener, the latter of which you should extend to register ClopLib's handlers and supply your implementing OperationUser/Position/World/Chunk objects.

A good place to start would be looking at how HuskClaims' code implements ClopLib in its common module, and then implements the platform operation handler on bukkit.

Building

To build ClopLib, run clean build in the root directory. The output JARs will be in target/.

License

ClopLib is licensed under Apache-2.0. See LICENSE for more information.