Also cancel tasks when we setup boot error

This commit is contained in:
Ghost_chu committed 2021-06-21 10:57:32 +08:00
1 parent 931ccfe673
commit 481b28931e
2 files changed
+2 -1

No files matched your search

@@ -1880,6 +1880,7 @@ public class QuickShop extends JavaPlugin {
public void setupBootError(BootError bootError) {
this.bootError = bootError;
HandlerList.unregisterAll(this);
Bukkit.getScheduler().cancelTasks(this);
}
public void registerCustomCommands() {
@@ -365,7 +365,7 @@ public class CommandManager implements TabCompleter, CommandExecutor {
@NotNull String commandLabel,
@NotNull String[] cmdArg) {
if (plugin.getBootError() != null) {
if (cmdArg.length != 1 && !"paste".equalsIgnoreCase(cmdArg[0]) && !"reload".equalsIgnoreCase(cmdArg[0])) {
if (cmdArg.length != 1 && !"paste".equalsIgnoreCase(cmdArg[0])) {
plugin.getBootError().printErrors(sender);
return true;
}