Skip to content

feat: MiniMessage locales on Paper + cloplib entity protection - #2

Closed
noaskers wants to merge 2 commits into
masterfrom
feat/Paper-Cloplib-Minimessage
Closed

feat: MiniMessage locales on Paper + cloplib entity protection#2
noaskers wants to merge 2 commits into
masterfrom
feat/Paper-Cloplib-Minimessage

Conversation

@noaskers

Copy link
Copy Markdown
Owner

Two commits, on top of the fork's master.

1. MiniMessage locales on Paper

Paper 26.2 ships Adventure 5, which drops the ClickEvent.Action enum MineDown compiles against, so MineDown can no longer format messages there. Formatting moves behind a MessageFormatter interface with two implementations: MineDownFormatter for Bukkit/Fabric and MiniMessageFormatter for Paper, backed by a parallel set of MiniMessage locale files.

The formatter in use decides which locale file loads, and switching markup format rewrites the existing messages file rather than leaving a second one behind. A malformed messages file falls back to the bundled locale instead of failing to enable the plugin.

-Dhuskclaims.skipFabric=true leaves the Fabric projects out of the build, so a Loom failure doesn't break configuration for unrelated tasks.

2. cloplib Paper listener for entity protection

Supersedes WiIIiam278#504 — this replaces that PR's reflection with a native listener.

Explosions. cloplib resolves the damager before the cause, and getPlayerSource() unwraps projectile shooters and passengers, so a blast attributable to a player is checked against player_damage_player rather than explosion_damage_entity. That flag is on by default, so end crystals detonated just outside a claim boundary killed players and destroyed armour stands inside it. Checked at LOW, ahead of cloplib, so the explosion flag applies regardless of attribution.

Knockback. Spears use the piercing_weapon component, which applies knockback without dealing damage, so no damage event fires and an armour stand can be shoved out of a claim. cloplib 2.0.13 handles EntityPushedByEntityAttackEvent natively in its new paper module; PaperListener implements PaperEntityDamageListener and inherits the handler — no reflection.

Closes WiIIiam278#479, WiIIiam278#461, WiIIiam278#497, WiIIiam278#297.

Dependency note

Requires cloplib 2.0.13, from noaskers/ClopLib feat/paper-module-entity-fixes (both bug fixes + the new paper module). That has to merge and publish before this builds on CI. cloplib_version defaults to 2.0.12 in gradle.properties so existing builds are unaffected; test against a local publish with:

./gradlew :paper:build -Pcloplib_version=<local version>

cloplib-paper is an implementation rather than compileOnly dependency — verified: with compileOnly the relocated PaperEntityDamageListener class is absent from the shaded jar, and PaperListener implements it, so the server would fail at class load.

Testing

:common:test, :bukkit:build, :paper:build all pass — 16 tests, 0 failures.

Paper 26.2 ships Adventure 5, which drops the ClickEvent.Action enum that
MineDown compiles against, so MineDown can no longer format messages
there. Message formatting moves behind a MessageFormatter interface with
two implementations: MineDownFormatter for Bukkit and Fabric, and
MiniMessageFormatter for Paper, backed by a parallel set of MiniMessage
locale files.

The formatter in use decides which locale file is loaded, and switching
markup format rewrites the existing messages file rather than leaving a
second one behind for the other format. A malformed messages file falls
back to the bundled locale instead of failing to enable the plugin.

Fabric configures through Loom, so its setup failing breaks configuration
for unrelated tasks; -Dhuskclaims.skipFabric=true leaves those projects
out of the build.
Two ways to harm entities inside a claim from outside it.

End crystals (and player-lit TNT) detonated just outside a boundary kill
players and destroy armour stands inside it. cloplib resolves the damager
before the cause, and getPlayerSource() unwraps projectile shooters and
passengers, so a blast attributable to a player is checked against
player_damage_player rather than explosion_damage_entity. That flag is on
by default, so the damage goes through. Checked here at LOW, ahead of
cloplib, so the explosion flag applies regardless of attribution.

Spears use the piercing_weapon component, which applies knockback without
dealing damage, so no damage event fires and an armour stand can be shoved
out of a claim. cloplib 2.0.13 handles EntityPushedByEntityAttackEvent in
its new paper module; PaperListener implements PaperEntityDamageListener
and inherits the handler, so no reflection is needed.

cloplib-paper is an implementation rather than compileOnly dependency, as
the interface must be present at runtime for PaperListener to load. The
cloplib version moves to a gradle property, with mavenLocal() ahead of the
remote repositories, so a locally published build can be tested with:

    ./gradlew :paper:build -Pcloplib_version=<local version>

Closes WiIIiam278#479
Closes WiIIiam278#461
Closes WiIIiam278#497
Closes WiIIiam278#297
@noaskers noaskers closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EndCrystals, I can kill someone on the claim

1 participant