BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

Pregen chunks

Open tastybento opened this issue 4 years ago • 0 comments

This is an experimental PR that performs some pre-loading of chunks about 10 seconds after an island is created or reset. It aims to keep a buffer of 5 islands available ahead of the current one. This might help reduce CPU during the initial joining of the server.

This change only runs on Paper because it relies on the PaperLibb async chunk loading.

The very first island generated on a server usually at 0,0 will kick off 5 islands-worth of generation. After that, each new island should only need to generate one additional island because there will be a buffer of 5 available.

The chunks that are pregenerated are determined by the server's view distance. If that is small, then fewer chunks need to be generated around the new island location.

I am not sure how this will perform. In theory it should work, but it needs some server to test it. Attached is a binary version for testing:

BentoBox-1.16.2-SNAPSHOT-LOCAL.jar.zip

tastybento avatar Apr 03 '21 16:04 tastybento