Skip to content

fix: execute Bukkit item use on the main thread - #3619

Closed
twme-ai wants to merge 1 commit into
IntellectualSites:mainfrom
twme-ai:fix/item-use-on-main-thread
Closed

fix: execute Bukkit item use on the main thread#3619
twme-ai wants to merge 1 commit into
IntellectualSites:mainfrom
twme-ai:fix/item-use-on-main-thread

Conversation

@twme-ai

@twme-ai twme-ai commented Aug 11, 2026

Copy link
Copy Markdown

Summary

Run Bukkit item-use simulation on FAWE's synchronous task manager.

Problem

BukkitWorld.useItem() can be reached from FAWE's asynchronous execution
path. Paper's item-use implementation fires BlockCanBuildEvent, which must
run on the server thread, causing BlockCanBuildEvent may only be triggered synchronously.

The adapter call now follows the existing Bukkit integration convention and
uses TaskManager.taskManager().sync(...).

Testing

env JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64 \
  ./gradlew -Dorg.gradle.configureondemand=false \
  :worldedit-bukkit:test --no-daemon

Also exercised on Paper 1.21.10 with a Mineflayer item-use brush: the expected
sapling was placed and Paper emitted no asynchronous Bukkit-event error.

@twme-ai
twme-ai requested a review from a team as a code owner August 11, 2026 11:22
@twme-ai twme-ai closed this Aug 11, 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.

1 participant