Unregister all listeners when plugin boot failed

Former-commit-id: 19d6f96bdcdb11794c647b6d96f0b9ad98c4cedc [formerly 1a7bce710a18d8888ac0280c1007fe9b5cf20d72]
Former-commit-id: b49fcfe955d929fb2a8ba34351df10c3e5aba03b
This commit is contained in:
Ghost_chu committed 2019-07-15 12:31:55 +08:00
1 parent b9aae93a15
commit a5eb79f44a
1 file changed
+3
@@ -11,6 +11,7 @@ import lombok.*;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
@@ -729,6 +730,8 @@ public class QuickShop extends JavaPlugin {
getLogger().severe("QuickShop could not hook into a economy/Not found Vault or Reserve!");
getLogger().severe("QuickShop CANNOT start!");
bootError = BuiltInSolution.econError();
HandlerList.unregisterAll(this);
getLogger().severe("Plugin listeners was disabled, please fix the economy issue.");
return false;
}
}