Unneeded tasks constantly running
darbyjack opened this issue · 2 comments
As per discussed in the Discord with chickeneer, ACF is constantly looping through all the players online to get their Client Locale. This is great when you support per-client locale in a project, but when it's not even enabled, this should not need to be running when it's using the default locale.
Hello, this is indeed the case.
For my part, in order not to have this useless task in my plugins, I do
//Register command
PaperCommandManager paperCommandManager = new PaperCommandManager(this);
paperCommandManager.enableUnstableAPI("help");
paperCommandManager.registerCommand(new RegionCommand(regionManager));
//Cancel ACF Laggy task
Bukkit.getScheduler().cancelTasks(this);
On your CommandManager. You want to use this method to disable the usePerIssuerLocale/autoDetectFromClient.
https://github.com/aikar/commands/blob/master/bukkit/src/main/java/co/aikar/commands/BukkitCommandManager.java#L387
Additionally, I am pushing up some changes that reduce the load from that task, in addition to making it run less frequently.
#343
Will close this issue after merging/pushing.