IntellectualSites / FastAsyncWorldEdit

Blazingly fast world manipulation for artists, builders and everyone else: https://www.spigotmc.org/resources/13932/
Other
603 stars 214 forks source link

AsyncWorld | IllegalStateException: WorldInitEvent may only be triggered synchronously. #299

Closed xXSchrandXx closed 3 years ago

xXSchrandXx commented 4 years ago

Bug report for FastAsyncWorldEdit 1.14.4

[REQUIRED] FastAsyncWorldEdit Configuration Files:

https://athion.net/ISPaster/paste/view/77bc53510dce43f68dbd2d6e658042f4

[REQUIRED] FastAsyncWorldEdit Version Number:

Bukkit-Official(1.15-13;9efdd88)

[REQUIRED] Spigot/Paper Version Number:

git-Paper-237 (MC: 1.14.4)

[REQUIRED] Description of the problem:

[21:45:06 WARN]: [WorldEdit] Plugin WorldEdit v1.15-13;9efdd88 generated an exception while executing task 76
java.lang.IllegalStateException: WorldInitEvent may only be triggered synchronously.
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:533) ~[patched_1.14.4.jar:git-Paper-237]
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.createWorld(CraftServer.java:1018) ~[patched_1.14.4.jar:git-Paper-237]
        at org.bukkit.Bukkit.createWorld(Bukkit.java:492) ~[patched_1.14.4.jar:git-Paper-237]
        at org.bukkit.WorldCreator.createWorld(WorldCreator.java:284) ~[patched_1.14.4.jar:git-Paper-237]
        at com.boydti.fawe.bukkit.FaweBukkit.createWorldUnloaded(FaweBukkit.java:315) ~[?:?]
        at com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter.createWorld(BukkitImplAdapter.java:222) ~[?:?]
        at com.sk89q.worldedit.bukkit.adapter.IDelegateBukkitImplAdapter.createWorld(IDelegateBukkitImplAdapter.java:151) ~[?:?]
        at com.boydti.fawe.bukkit.wrapper.AsyncWorld.create(AsyncWorld.java:144) ~[?:?]
        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) [?:?]

How to replicate:

Create a AsyncWorld. (I used: WorldSystem) Plugincode for creating the world: https://github.com/Butzlabben/worldsystem/blob/master/src/main/java/de/butzlabben/world/wrapper/AsyncCreatorAdapter.java

Plugins being used on the server:

Plugins:

Checklist:

xXSchrandXx commented 4 years ago

As far as I have it right, this can only be solved by modifying the WorldEvent.class, WorldInitEvent.class and WorldLoadEvent.class. The Async function is missing for these events.

aurorasmiles commented 3 years ago

Is this still an issue with the latest version?

xXSchrandXx commented 3 years ago

Is this still an issue with the latest version?

Gonna test this...

xXSchrandXx commented 3 years ago

I tried to load an existing world with FAWE AysncWorld. I started and stopped the testserver directly. I didn't join the world with a player. But I got a error message from FAWE:

[18:11:24] [Craft Scheduler Thread - 0/WARN]: [FastAsyncWorldEdit] Plugin FastAsyncWorldEdit v1.16-366;fc91c3b generated an exception while executing task 41
java.lang.IllegalStateException: Asynchronous ChunkMapDistance::addTicket!
    at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkMapDistance.addTicket(ChunkMapDistance.java:158) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkMapDistance.addTicket(ChunkMapDistance.java:363) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkProviderServer.addTicket(ChunkProviderServer.java:919) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.WorldServer.addTicketsForSpawn(WorldServer.java:1809) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.MinecraftServer.loadSpawn(MinecraftServer.java:638) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.craftbukkit.v1_16_R2.CraftServer.createWorld(CraftServer.java:1164) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.Bukkit.createWorld(Bukkit.java:581) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.WorldCreator.createWorld(WorldCreator.java:325) ~[patched_1.16.3.jar:git-Paper-198]
    at com.boydti.fawe.bukkit.FaweBukkit.createWorldUnloaded(FaweBukkit.java:257) ~[?:?]
    at com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter.createWorld(BukkitImplAdapter.java:221) ~[?:?]
    at com.sk89q.worldedit.bukkit.adapter.IDelegateBukkitImplAdapter.createWorld(IDelegateBukkitImplAdapter.java:143) ~[?:?]
    at com.boydti.fawe.bukkit.wrapper.AsyncWorld.create(AsyncWorld.java:152) ~[?:?]
    at de.xxschrandxx.awm.api.worldcreation.fawe$1.run(fawe.java:54) ~[?:?]
    at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.16.3.jar:git-Paper-198]
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.3.jar:git-Paper-198]
    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) [?:?]

Class wich is loading the world: https://github.com/xXSchrandXx/SpigotPlugins/blob/master/AsyncWorldManager/src/main/java/de/xxschrandxx/awm/api/worldcreation/fawe.java

xXSchrandXx commented 3 years ago

And I tried to create a world with FAWE AsyncWorld:

[18:27:26] [Craft Scheduler Thread - 9/WARN]: [FastAsyncWorldEdit] Plugin FastAsyncWorldEdit v1.16-366;fc91c3b generated an exception while executing task 622
net.minecraft.server.v1_16_R2.ReportedException: Exception initializing level
    at net.minecraft.server.v1_16_R2.MinecraftServer.initWorld(MinecraftServer.java:503) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.craftbukkit.v1_16_R2.CraftServer.createWorld(CraftServer.java:1157) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.Bukkit.createWorld(Bukkit.java:581) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.WorldCreator.createWorld(WorldCreator.java:325) ~[patched_1.16.3.jar:git-Paper-198]
    at com.boydti.fawe.bukkit.FaweBukkit.createWorldUnloaded(FaweBukkit.java:257) ~[?:?]
    at com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter.createWorld(BukkitImplAdapter.java:221) ~[?:?]
    at com.sk89q.worldedit.bukkit.adapter.IDelegateBukkitImplAdapter.createWorld(IDelegateBukkitImplAdapter.java:143) ~[?:?]
    at com.boydti.fawe.bukkit.wrapper.AsyncWorld.create(AsyncWorld.java:152) ~[?:?]
    at de.xxschrandxx.awm.api.worldcreation.fawe$1.run(fawe.java:54) ~[?:?]
    at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.3.jar:git-Paper-198]
    at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.16.3.jar:git-Paper-198]
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.3.jar:git-Paper-198]
    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) [?:?]
Caused by: java.lang.IllegalStateException: Asynchronous ChunkMapDistance::addTicket!
    at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkMapDistance.addTicket(ChunkMapDistance.java:158) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkMapDistance.addTicketAtLevel(ChunkMapDistance.java:346) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkMapDistance.a(ChunkMapDistance.java:213) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkProviderServer.getChunkFutureMainThread(ChunkProviderServer.java:568) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:501) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.World.getChunkAt(World.java:356) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.IWorldReader.getChunkAt(IWorldReader.java:100) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.World.getChunkAt(World.java:297) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.WorldProviderNormal.a(SourceFile:28) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.WorldProviderNormal.a(SourceFile:62) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:570) ~[patched_1.16.3.jar:git-Paper-198]
    at net.minecraft.server.v1_16_R2.MinecraftServer.initWorld(MinecraftServer.java:489) ~[patched_1.16.3.jar:git-Paper-198]
    ... 14 more

If you try to join a world, the server crasshes...

Peda1996 commented 3 years ago

Same error happens to me, while trying to initialize a world async.

Needed the async function due to very long loading times of worlds. Fixed it for me by disabling spawn chunk loading on the spezific world, which is triggered on WorldInitEvent.

jacklollz2 commented 3 years ago

I hope this can be resolved soon.

NotMyFault commented 3 years ago

This has been resolved in some modern version.