Files
purpur-leaf/README.md
T
dmg a9e58b7c25
CI / build (push) Successful in 1m9s
CI / build (pull_request) Successful in 1m15s
feat(leaf): support Purpur 26.3
2026-10-16 23:52:59 -04:00

58 lines
3.5 KiB
Markdown

# Purpur Leaf
Leaf is a Purpur 26.3 plugin that lets non-aggressive players opt into visible Resistance and Strength protection.
The approved behavior is specified in the [SoMC OKF wiki](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/purpur-leaf/index.md).
## Requirements
- Purpur 26.3 build 2651
- Java 25
Distribution repository, checkout and artifacts use `purpur-leaf`. Runtime `Leaf`, Java packages/entrypoint, `plugins/Leaf/`, commands/permissions and `leaf_protected` scoreboard team are unchanged. Replace the old JAR instead of installing both distributions. Old release tags/assets remain available. New releases no longer support Java 17.
## Build
```bash
./gradlew clean check jar
```
The plugin JAR is written to `build/libs/purpur-leaf-<version>.jar`.
`check` includes `nativeLifecycleTest`. It downloads the exact Purpur 26.3 build 2651 launcher,
verifies SHA-256
`0677c1febecfbc2e5b0a7f76abd647b70a1f38d3cbdf3dd6a82e401b4262a598`, and runs Paperclip in
patch-only mode under `build/native-runtime/`. The native boundary loads the packaged entrypoint
through Purpur's plugin classloader, enables it with controlled server, scheduler, player and
scoreboard ports, restores persisted protection, exercises command-backed YAML persistence, and
disables it while verifying owned presentation cleanup. It does not start a listening server, open a
port, create a world, or provide live-client/deployed-server evidence.
## Commands
```text
/leaf on
/leaf off
/leaf status
/leaf enabled <on|off>
/leaf effect <resistance|strength> <1-5>
/leaf strength <1-5> # Deprecated Resistance alias
/leaf player <name|uuid> status
/leaf player <name|uuid> enabled <on|off>
/leaf player <name|uuid> locked <on|off>
```
Administrative commands require `leaf.admin`, granted to server operators by default.
## Compatibility
Leaf prefixes the standard Bukkit-compatible display name (used by standard chat), player-list name, and a dedicated `leaf_protected` main-scoreboard team for overhead names. Legacy `&` color codes are supported. Leaf does not move players out of an existing scoreboard team, and per-viewer/custom scoreboards may not show its overhead prefix. Chat or tab-management plugins may replace Leaf's decorated names. During cleanup, Leaf removes exact copies of its configured prefix while preserving surrounding name formatting; another plugin should therefore not intentionally use identical prefix text.
The server API identifies potion effects by type but does not expose their owning plugin. Leaf tracks the exact infinite, quiet Resistance and Strength effects it successfully installed and removes them only while each visible effect still matches. A distinct level, duration, or presentation is preserved. The server API cannot distinguish an externally supplied effect with an identical fingerprint; Leaf therefore does not claim or later remove an identical effect that was already active when reconciliation ran.
Leaf reconciles opted-in online players approximately once per second. Effects cleared by death, milk, commands, or another plugin are restored automatically. A temporary external Resistance or Strength effect is left untouched, the leaf prefix remains visible, and Leaf restores its configured effect after the external effect ends.
## Releases
Gitea Actions checks pushes and pull requests and stores a development JAR. Pull requests validate conventional commits. Main-branch conventional commits drive semantic releases after the repository defines a `RELEASE_TOKEN` with contents-write permission.