Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance issues #27

Open
matipoirierg opened this issue Mar 16, 2024 · 1 comment
Open

performance issues #27

matipoirierg opened this issue Mar 16, 2024 · 1 comment

Comments

@matipoirierg
Copy link

matipoirierg commented Mar 16, 2024

https://spark.lucko.me/MoRmNCYAIZ
The plugin is spiking my mspt very high, is the chunk loading request async?

@Tonnanto
Copy link
Owner

It's not. Thanks for pointing out this issue.
FindStructureQuests periodically check if a player has found the structure by calling World.locateNearestStructure.
I assumed that locating structures within a radius of 3 chunks wouldn't cause any performance issues. However, I just found this in the spigot documentation:

Do not assume that only a radius x radius chunk area will be checked. For example, Structure.MANSION can potentially check up to 20,000 blocks away (or more) regardless of the radius used.

I tried to make the task asynchronous using Bukkit.getScheduler().runTaskAsynchronously. However, this results in the following Error: java.lang.IllegalStateException: StructuresLocateEvent may only be triggered synchronously.
Seems like I cannot locate structures asynchronously? Will dig deeper into this when I have the time. I do not have a lot of experience with asynchronous tasks in bukkit development. Any ideas and suggestions are very welcome.

Can you tell me more about:

  • What server software and version are you using?
  • How many players are on your server?
  • How severe is the lag you're noticing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants