Repository navigation
feature: Run //bc on the queue of FastAsyncWorldEdit - #144
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
//bcran on the server thread, so the server stopped until the curve wasbuilt. 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,
//bcis now put in the queue of the player(
Actor.queueAction), after the WorldEdit commands they ran before, andruns on a thread of FastAsyncWorldEdit. With WorldEdit alone and on Fabric,
it runs during the command as before.
EditRunner: where the edit of//bcruns.DIRECTruns it during the command.FaweQueue(Bukkit): findsqueueActionby reflection, as it is only in FastAsyncWorldEdit, and usesDIRECTwithout it.Requestof the edit, where FastAsyncWorldEdit looks for the edits to cancel, so//canceland leaving the server stop it.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 fromPosManager, 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//bcposwhile 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:
//bcof 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.//cancelwhile//bcran: the edit stopped with no blocks changed.//bcran: the edit stopped part of the way.//bcposand a second//bctyped right after a//bc, and/curvebuilding reloadafter a//bc: each//bcbuilt the curve it was typed with, in order. These curves were small, so the first//bcmay have finished before the next command.Notes