Plugin crashes server when generating a new chunk


#1

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: https://pastebin.com/VNfSRNuc

My plugin code: https://github.com/selabie68/OreGenUltimateSponge


#2

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?


#3

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


#4

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.


#5

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


#6

@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?


#7

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();
// ...
transaction.setFinal(transaction.getFinal().withState(this.randomiser.next().getDefaultState());

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


#8

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