Skip to content

feature: Run //bc on the queue of FastAsyncWorldEdit - #144

Merged
kous500 merged 1 commit into
mainfrom
feature/bc-fawe-queue-20261126
Nov 26, 2026
Merged

kous500 merged 1 commit into
mainfrom
feature/bc-fawe-queue-20261126

Conversation

@kous500

@kous500 kous500 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

What and why

//bc ran on the server thread, so the server stopped until the curve was
built. Measured on Paper 1.21.8 before this change, with about 225,000
blocks, the server stopped for 0.7 to 2.5 seconds with FastAsyncWorldEdit
2.13.2 and for 1.7 to 2.9 seconds with WorldEdit 7.3.16.

With FastAsyncWorldEdit, //bc is now put in the queue of the player
(Actor.queueAction), after the WorldEdit commands they ran before, and
runs on a thread of FastAsyncWorldEdit. With WorldEdit alone and on Fabric,
it runs during the command as before.

  • EditRunner: where the edit of //bc runs. DIRECT runs it during the command.
  • FaweQueue (Bukkit): finds queueAction by reflection, as it is only in FastAsyncWorldEdit, and uses DIRECT without it.
    • The edit session is set on the Request of the edit, where FastAsyncWorldEdit looks for the edits to cancel, so //cancel and leaving the server stop it.
    • An edit whose player left before its turn is not run, as FastAsyncWorldEdit does with its own commands.
  • BcCommand: reads the arguments and copies the curve when the command is typed, and gives the edit to the runner. An argument that cannot be used shows its error without calling the runner.
  • BcEdit.build: takes the curve instead of reading it from PosManager, and hands the edit session to the runner before anything is read or placed with it. The selection is read when the edit runs.
  • PosData.copy: a copy of the curve that changes to it do not reach, so //bcpos while the edit waits does not change it.

How it was tested

  • Minecraft version: 1.21.8 (in the game); 26.3 (game tests); every built version compiled

  • Server software / loader: Paper 1.21.8-32 (in the game); Fabric Loader 0.20.1 (game tests)

  • WorldEdit / FastAsyncWorldEdit version: FastAsyncWorldEdit 2.13.2-SNAPSHOT-1160 (in the game); WorldEdit 7.4.6 (game tests)

  • ./gradlew build: every version compiles and the unit tests pass.

  • ./gradlew :curvebuilding-fabric:26.3:runGameTest: all 17 game tests pass.

  • ./gradlew checkCodeStyle: no warnings.

  • New unit tests:

    • BcCommandTest: the runner gets the edit without it running, and is not called for an argument that cannot be used.
    • PosDataTest: changes do not reach a copy.
  • In the game, with FastAsyncWorldEdit 2.13.2, read from the server log, spark's tick monitor and the history of FastAsyncWorldEdit:

    • //bc of about 225,000 and about 6,000,000 blocks: no tick over 100 ms while it ran. The longest ticks after it, up to 385 ms, were garbage collection.
    • //cancel while //bc ran: the edit stopped with no blocks changed.
    • Leaving while //bc ran: the edit stopped part of the way.
    • //bcpos and a second //bc typed right after a //bc, and /curvebuilding reload after a //bc: each //bc built the curve it was typed with, in order. These curves were small, so the first //bc may have finished before the next command.

Notes

  • Not tried with other versions of FastAsyncWorldEdit.

With FastAsyncWorldEdit, //bc is queued after the WorldEdit commands the
player ran before and runs on its thread, so the server goes on while the
curve is built. //cancel and leaving the server stop it. The curve and the
config are those at the time of the command; the selection is read when the
edit runs. With WorldEdit alone and on Fabric, //bc runs during the command.
@kous500
kous500 enabled auto-merge (squash) November 26, 2026 15:52
@kous500
kous500 merged commit f1ad951 into main Nov 26, 2026
28 checks passed
@kous500
kous500 deleted the feature/bc-fawe-queue-20261126 branch November 26, 2026 15:56
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