feature/coreprotect-block-logging #2

Contributor

Summary

  • Adds optional CoreProtect logging for pasted block changes (The coreprotect loggin is automatic, but the plugin functions normally if CoreProtect not loaded).
  • Records changes under the player who initiated the paste.
  • Logs replacements as removal followed by placement, matching similar WorldEdit behavior.
  • Keeps existing paste mechanics unchanged and continues normally if logging fails.

This covers block-state changes only; tile-entity NBT and entities are too complicated to hook into coreprotect properly in this initial feature.

Tested with

  • Runtime-tested on Paper 26.2 with CoreProtect 24.0-rc1.
  • Verified pasted blocks appear under the initiating player with /co i.
## Summary - Adds optional CoreProtect logging for pasted block changes (The coreprotect loggin is automatic, but the plugin functions normally if CoreProtect not loaded). - Records changes under the player who initiated the paste. - Logs replacements as removal followed by placement, matching similar WorldEdit behavior. - Keeps existing paste mechanics unchanged and continues normally if logging fails. This covers block-state changes only; tile-entity NBT and entities are too complicated to hook into coreprotect properly in this initial feature. ## Tested with - Runtime-tested on Paper 26.2 with CoreProtect 24.0-rc1. - Verified pasted blocks appear under the initiating player with `/co i`.
Records successful block-state transitions under the initiating player while leaving paste scheduling and mechanics unchanged. The optional integration remains fail-open when CoreProtect is absent or rejects a record.
fix: connect CoreProtect after late plugin enable
Some checks are pending
Build / build (pull_request) Blocked by required conditions
3b732cdd49
Owner

Merged. Thanks a lot for this one, it's exactly how I'd want an optional integration to look: no-op default, lazy classload so servers without CoreProtect never touch its classes, and fail-open everywhere. The PluginEnableEvent retry was a good catch too. Since this plugin is load: STARTUP and CoreProtect is POSTWORLD, the "late enable" path isn't an edge case, it's the normal path on every single boot.

Before merging I ran it through the whole battery:

  • unit suite + boot/paste/save smokes on Folia 26.2 without CoreProtect: clean no-op, zero regressions
  • Paper 26.2 and Folia 26.2 with a 26.2-capable CoreProtect build (API v12): late-enable connects, console pastes attributed to #litematica, identical re-paste writes zero rows, and a dirt-to-stone re-paste produces exactly 64 removals + 64 placements in co_block, rollback-compatible
  • 4.19M-block / 629k-TE stress paste with logging on: 5.4 s to 7.1 s, all 4,194,303 rows ingested, no thread errors on Folia region threads

One thing you'll want to know for your own server: stock CoreProtect CE 24.0 refuses MC 26.2 at boot ("Minecraft 26.2 is not supported") and disables itself. Your integration correctly stays dormant when that happens (tested that path too). I assume your 24.0-rc1 was a newer dev build.

I added two small things on top: a logging.coreprotect config toggle (default on) as an escape hatch for people pasting city-sized schematics, and README notes. Shipping as 0.6.0+26.2. You're credited in the README and the Modrinth changelog.

Merged. Thanks a lot for this one, it's exactly how I'd want an optional integration to look: no-op default, lazy classload so servers without CoreProtect never touch its classes, and fail-open everywhere. The `PluginEnableEvent` retry was a good catch too. Since this plugin is `load: STARTUP` and CoreProtect is POSTWORLD, the "late enable" path isn't an edge case, it's the normal path on every single boot. Before merging I ran it through the whole battery: - unit suite + boot/paste/save smokes on Folia 26.2 without CoreProtect: clean no-op, zero regressions - Paper 26.2 **and** Folia 26.2 with a 26.2-capable CoreProtect build (API v12): late-enable connects, console pastes attributed to `#litematica`, identical re-paste writes zero rows, and a dirt-to-stone re-paste produces exactly 64 removals + 64 placements in `co_block`, rollback-compatible - 4.19M-block / 629k-TE stress paste with logging on: 5.4 s to 7.1 s, all 4,194,303 rows ingested, no thread errors on Folia region threads One thing you'll want to know for your own server: stock CoreProtect CE 24.0 refuses MC 26.2 at boot ("Minecraft 26.2 is not supported") and disables itself. Your integration correctly stays dormant when that happens (tested that path too). I assume your 24.0-rc1 was a newer dev build. I added two small things on top: a `logging.coreprotect` config toggle (default on) as an escape hatch for people pasting city-sized schematics, and README notes. Shipping as **0.6.0+26.2**. You're credited in the README and the Modrinth changelog.
Some checks are pending
Build / build (pull_request) Blocked by required conditions
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
admin_ekaii/litematica-folia-ekaii!2
No description provided.