Skip to content

Hotfix/dupe unclaim - #473

Closed
bestzige wants to merge 8 commits into
espidev:masterfrom
DojoSMP:hotfix/dupe-unclaim
Closed

Hotfix/dupe unclaim#473
bestzige wants to merge 8 commits into
espidev:masterfrom
DojoSMP:hotfix/dupe-unclaim

Conversation

@bestzige

@bestzige bestzige commented Jul 4, 2026

Copy link
Copy Markdown

No description provided.

bestzige and others added 8 commits May 7, 2026 16:06
Root cause:
- /ps unclaim returned the protection stone item before deleting the region.
- On Folia/Canvas, deleting the protection block could fail when it touched an unloaded chunk or the wrong region thread.
- When that happened, the player already received the item, but the WorldGuard region still existed, allowing repeated unclaim attempts to duplicate items.

Changes:
- Move item return to happen only after the region is successfully deleted.
- Run the unclaim delete step on the Folia region scheduler for the protection stone location.
- Add a region-exists check to prevent repeated/concurrent unclaim attempts from returning duplicate items.
- Pre-check inventory space when item dropping is disabled, preserving the no-room behavior before deletion.
- Catch delete failures so failed unclaims do not return items.

Merged region handling:
- Stop using deleteRegion(true) from /ps unclaim because merged regions may contain protection blocks in multiple Folia region threads.
- Delete the WorldGuard/merged region data first with deleteRegion(false).
- Snapshot all protection block locations before deletion.
- Schedule each physical protection block removal on its own Folia region scheduler.
- Only remove a block if it still matches the original protection block type.
@github-actions github-actions Bot closed this Jul 4, 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.

2 participants