What does BlockBreakCaptures error mean?

Hello!

In my plugin, I’m calling the following code, which sets the block type at the specified position to beacon.

        val loc = Location<World>(
              world,
              CreateWorldsTask.SpawnPointLoc.x,
              CreateWorldsTask.SpawnPointLoc.y,
              CreateWorldsTask.SpawnPointLoc.z
        )
        loc.blockType = BlockTypes.BEACON

I get the error given below.

What does it mean?

Thanks in advance

Dmitri Pisarenko

[16:28:14] [pool-6-thread-3/FATAL] [Sponge/sponge]: stopTiming called async for world2 - syncChunkLoad - Data
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: java.lang.Throwable
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at co.aikar.timings.TimingHandler.stopTiming(TimingHandler.java:130)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.gen.ChunkProviderServer.handler$onOriginalLoadChunkEnd$0(ChunkProviderServer.java:62)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:172)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:114)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:84)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.gen.ChunkProviderServer.func_73154_d(ChunkProviderServer.java:181)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.func_72964_e(World.java:287)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.func_175726_f(World.java:282)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.func_180501_a(World.java:1112)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.setBlock(World.java:1391)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.setBlock(World.java:374)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.extent.MutableBlockVolume.setBlockType(MutableBlockVolume.java:92)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.extent.MutableBlockVolume.setBlockType(MutableBlockVolume.java:76)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.Location.setBlockType(Location.java:505)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.fillRegion(FillWorldsTask.kt:88)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.accept(FillWorldsTask.kt:50)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.accept(FillWorldsTask.kt:36)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$77(SchedulerBase.java:177)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.FutureTask.run(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.lang.Thread.run(Unknown Source)
[16:28:14] [pool-6-thread-3/FATAL] [Sponge/sponge]: stopTiming called async for world2 - causeTracker - BlockBreakCaptures
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: java.lang.Throwable
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at co.aikar.timings.TimingHandler.stopTiming(TimingHandler.java:130)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.common.event.CauseTracker.handleBlockBreak(CauseTracker.java:703)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:528)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.func_180501_a(World.java:1151)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.setBlock(World.java:1391)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at net.minecraft.world.World.setBlock(World.java:374)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.extent.MutableBlockVolume.setBlockType(MutableBlockVolume.java:92)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.extent.MutableBlockVolume.setBlockType(MutableBlockVolume.java:76)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.api.world.Location.setBlockType(Location.java:505)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.fillRegion(FillWorldsTask.kt:88)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.accept(FillWorldsTask.kt:50)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at com.mycompany.myproduct.mc.cmd.FillWorldsTask.accept(FillWorldsTask.kt:36)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$77(SchedulerBase.java:177)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.FutureTask.run(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[16:28:14] [pool-6-thread-3/INFO] [STDERR/sponge]: [co.aikar.timings.TimingHandler:stopTiming:130]: 	at java.lang.Thread.run(Unknown Source)

What language is that?

Also we need to see more of the code, where is this being called from? it’s own thread, a scheduler? an event listener?

The error suggests that you may be doing something that is threaded incorrectly I believe.

1 Like

Kotlin. Basically, Java with some syntactic sugar.

It’s called from a scheduled task, i. e. a class, which implements java.util.function.Consumer<org.spongepowered.api.scheduler.Task> interface. This task is started like this:

    val taskBuilder = scheduler.createTaskBuilder()
    taskBuilder.execute(task)
          .async()
          .intervalTicks(0)
          .submit(plugin)

Note that I’m trying to put a block into a world created by ProjectWorlds commands. First, I create several worlds with commands

/world create w1 d:overworld g:overworld s:175205
/world gamemode w1 1
/world setspawn w1 66,63,79

Thereafter I exit the world (manually in Minecraft) and enter it again (so that the newly generated worlds are loaded), and then run a command, which calls the code with the error.

The location, where my code tries to put a block, is correct (I found it out by going into those world in Minecraft). The error occurs with both beacon and cobblestone block types.

All of this happens in the singleplayer mode.

If you want to modify the world the task must be sync and not async like in your code

2 Likes

Or, if you need to do some long-running task asynchronously, you can start another non-asynchronous task inside your asynchronous task and modify the world from there - if it’s not asynchronous, it’s always run on the main thread, even if you started it from an asynchronous task.

2 Likes

Ok cool, I wasn’t aware that Kotlin had universal access syntax / properties and was compatible with Java libraries as well.

I’ve used Scala which was able to do that, but I’m not 100% sure of it’s compatibility with java getters / setters when it comes to the syntax sugaring.

1 Like