Added async capability and location caching, now 10x faster on spigot, and over 100x faster on paper
Even though this update adds very few settings, it is probably the biggest single update to this plugin so far!
Don't want to read the whole update? Watch this video showing off the new speed of the plugin instead.
Here's the more wordy update for those interested:
Now Supporting Location Caching Previously, J-RTP would find the location at the time the command is run. If it took 800ms to load a chunk, and 200ms to find a safe location in that chunk, the server is waiting a full 1000 before the next tick gets processed (more about that later). That means running the command to getting teleported could at times take over a whole second.
To fix this, I have added location caching. Basically, the server will "run" the rtp command at startup and find a few safe locations to teleport players to. When the player runs the rtp command, they instantly get teleported to the location, avoiding all the lag.
That doesn't fix the whole problem though, since loading chunks could still take upwards of 800ms, and thats why this plugin now uses PaperLib... Now uses PaperLib for async chunk loading. (And I also made as much of my run async as I logically should have) getChunkAtAsync() Did you ever hate having the whole server lag when one person runs /rtp? That lag is gone now, hidden away in an async thread where it won't bother anyone. I may joke, but even though the process still happens, since it is happening outside the main thread, the server as a whole will not feel any lag. Take this as a reminder to use paper over spigot though. I may have moved a lot of the processing of my own plugin into its own thread, and while the performance increase from that will be noticeable, most of the performance increase comes from methods that only work using Paper.