RonanPlugins / BetterRTP

Official wiki of the BetterRTP plugin!
https://www.spigotmc.org/resources/36081/
MIT License
112 stars 85 forks source link

Async Chunk Generation Before Teleporting #37

Closed pianwan closed 4 years ago

pianwan commented 4 years ago

Plugin Version:

2.11.1-BETA Request:

Async chunk generation before teleporting.

How/Why:

If a player is teleported to a location without generated chunks nearby, a huge amount of the nearby chunks will be generate in main thread. It will cause a sudden TPS Loss. If we generate chunks asynchronously before teleporting, It will be solved. You can find what I do here PaperLib is a better solution maybe.

Additional Context:

None

SuperRonanCraft commented 4 years ago

I've attempted to load chunks async in the past, but the bukkit api does not allow to be called/run asynchronously. So this is fairly impossible to do to keep it compatible for most spigot and bukkit servers.

pianwan commented 4 years ago

I've attempted to load chunks async in the past, but the bukkit api does not allow to be called/run asynchronously. So this is fairly impossible to do to keep it compatible for most spigot and bukkit servers.

Why not try PaperLib?

SuperRonanCraft commented 4 years ago

mhh, you know what, I just learned about maven plugins, i'll take you up on the challenge and try this out. I will let you know if i'm successful ;)

SuperRonanCraft commented 4 years ago

Using this library seems to work as expected. I will be doing some more tests, but this seems like I will be using this library moving forward. Thank you for the great suggestion ;)