From 42482ef8e7390867560b4c11f53b1e8179fbceec Mon Sep 17 00:00:00 2001 From: Paul Reilly Date: Sun, 9 Apr 2023 23:17:31 -0500 Subject: [PATCH] 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. --- .../java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 136c6c46..97c65713 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -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();