Deferred command loading

Moved command loading into a runnable that will execute on the first server tick. This way, we can ensure that all the plugins are loaded before we load our commands, so TFD4J and Shop can both have their respective commands loaded in.
This commit is contained in:
Paul Reilly 2023-04-09 23:17:31 -05:00
parent 11f9313653
commit 42482ef8e7

View File

@ -161,7 +161,8 @@ public class TotalFreedomMod extends JavaPlugin
}
cl = new CommandLoader();
cl.loadCommands();
Bukkit.getScheduler().runTaskLater(plugin, cl::loadCommands, 1);
// Deferring command loading allowing TFD4J and Shop to load before registering our commands.
BackupManager backups = new BackupManager();
backups.createAllBackups();