Is your feature request related to a problem? Please describe.
To solve FAWE-1.13+ #299 could you patch the WorldEvents?
Describe the solution you'd like
Add Async to every WorldEvent.
public WorldEvent(@NotNull World world, boolean async) {
super(async);
this.world = world;
}
Describe alternatives you've considered
The developers at Bukkit or Spigot ask if this can be changed for them.
exposing the async boolean does not fix anything here, the logic listening to these events expect, as defined by the API, that these events occur on the main thread. Calling the logic there async is also not supported.
The root cause of this person's issue is a bug in the multiworld plugin they use. For some reason, it attempts to create a world async (which is insane as the operation is not thread-safe).
calling FAWE a multiworld plugin is an odd take on things.
Quoting the stacktrace:
at de.butzlabben.world.wrapper.AsyncCreatorAdapter.lambda$0(AsyncCreatorAdapter.java:22) ~[?:?]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.14.4.jar:git-Paper-237]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.14.4.jar:git-Paper-237]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.14.4.jar:git-Paper-237]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Notice the world plugin? It just happens that FAWE is in the stacktrace too. I don't deny FAWE has a bug as well for even allowing this, but still, it's async world creation in the end.
yea but presumably the guy who made the world plugin thought that FAWE's API is safe to use because I guess they didn't realize that stood for FastAsyncWorldException. But yea it's pedantic, just ragging on FAWE. :^)
didn't FAWE have async world creation feature back in 1.12.2?
yea but presumably the guy who made the world plugin thought that FAWE's API is safe to use because I guess they didn't realize that stood for FastAsyncWorldException. But yea it's pedantic, just ragging on FAWE. :^)
I'm pretty new to this, but could adding a org.bukkit.craftbukkit.vXXX.CraftServer.createWorld(WorldCreator creator, boolean async) with
this.pluginManager.callEvent(new WorldInitEvent(internal.getWorld(), async));
this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld(), async));
and ofcorse a org.bukkit.Server.createWorld(WorldCreator creator, boolean async) and org.bukkit.Bukkit.createWorld(WorldCreator creator, boolean async) do something (beside breaking everything)?
Once again:
the logic listening to these events expect, as defined by the API, that these events occur on the main thread
Firing those events async would be a breaking change
And again; That does not also fix the fact that the logic there is not designed to be called async.
You haven't solved the fundamental thread-safety problems. It _will_ break everything, and in addition is also an API-breaking change (plugins relying on WorldInitEvent and WorldLoadEvent being fired on the main thread would have that assumption broken).
why dont you just create the world normally, and just disable spawn chunks if the loading time is such an issue for you?
why dont you just create the world normally, and just disable spawn chunks if the loading time is such an issue for you?
I have not yet checked why ...
But there was a difference. I could only test that with versions prior to 1.13.
Most helpful comment
yea but presumably the guy who made the world plugin thought that FAWE's API is safe to use because I guess they didn't realize that stood for FastAsyncWorldException. But yea it's pedantic, just ragging on FAWE. :^)