Plugin crashes server when generating a new chunk

I have developed a new plugin, it works fine in a chunk that is already generated but if I try to move to a new chunk it crashes the server.

I can’t see anything in the server crash log that points to anything specific.

My server crash log: server-crash-log -

My plugin code: GitHub - selabie68/OreGenUltimateSponge: Plugin for Minecraft Sponge Servers that generates ore when lava meets water. For example, in a cobblestone generator.

Description: Watching Server

This means that something going on during the game loop is taking too long to run. The stack trace is supposed to help; it seems to be in the middle of yelling about some other error. Are there any other logs available?

Also just out of curiosity, is this running on top of an NFS server?

The logs from the console created a large output file >300MB. It seems to just be a repeat of the same error. I have created file of what seems like the most relevant lines.

No NFS services running. It is just running on my iMac as a test server for my development environment.

@JBYoshi Could the issue be with my listener? I was unable to find an appropriate filter so I am simply listening to all ChangeBlockEvent.Modify events, this could be too much for generating new chunks?

Probably. Instead of using ourBlock.setBlockType(), use Transaction.setFinal() to change the final block:

Transaction<BlockSnapshot> transaction = e.getTransactions().get(0);
BlockSnapshot bto = transaction.getOriginal();
// ...

Not sure why it isn’t simply throwing a StackOverflowError, but whatever it is, this should fix it.

These changes break the functionality of the plugin. i.e it is not replacing the blocks and always creates cobble.

I did use the Transaction.setCustom() method as this appeared to be the method to use and I did not have the Transaction.setFinal() method.

I am using org.spongepowered:spongeapi:7.0.0 in my gradle build