Skip to content

Fix Folia inventory close thread access#292

Merged
ptthanh02 merged 1 commit into
OpenVdra:mainfrom
Alexteens24:agent/fix-folia-inventory-close
Jul 17, 2026
Merged

Fix Folia inventory close thread access#292
ptthanh02 merged 1 commit into
OpenVdra:mainfrom
Alexteens24:agent/fix-folia-inventory-close

Conversation

@Alexteens24

@Alexteens24 Alexteens24 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Resolve the storage inventory holder directly during InventoryCloseEvent.
  • Pass the resolved StoragePageHolder to close handling instead of scheduling another entity task.

Why

On Folia/Canvas, the deferred entity task could execute in the player's current region while Inventory#getHolder() accessed a block-backed inventory owned by another region. Canvas rejected that cross-region world read with Thread failed main thread check: Cannot read world asynchronously.

Impact

Closing inventories no longer causes SmartSpawner to perform an invalid cross-region holder lookup, while dirty storage state continues to be marked for persistence.

Validation

  • ./gradlew :core:compileJava
  • git diff --check

@Alexteens24
Alexteens24 force-pushed the agent/fix-folia-inventory-close branch from 3032375 to ff1a26b Compare July 16, 2026 23:27
@Alexteens24
Alexteens24 marked this pull request as ready for review July 16, 2026 23:28
@ptthanh02
ptthanh02 merged commit 2e3804d into OpenVdra:main Jul 17, 2026
1 check passed
@Alexteens24 Alexteens24 changed the title Fix Folia inventory close thread access Avoid cross-region inventory holder reads on Folia Jul 17, 2026
@Alexteens24 Alexteens24 changed the title Avoid cross-region inventory holder reads on Folia Fix Folia inventory close thread access Jul 17, 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