Try detect more reloads

This commit is contained in:
libraryaddict 2021-02-09 16:23:42 +13:00
parent 25f6ac8b1e
commit ccff8bc6dc

View File

@ -59,14 +59,14 @@ public class LibsDisguises extends JavaPlugin {
@Override @Override
public void onLoad() { public void onLoad() {
instance = this; if (instance != null || !Bukkit.getServer().getWorlds().isEmpty() || !Bukkit.getOnlinePlayers().isEmpty()) {
if (!Bukkit.getServer().getWorlds().isEmpty()) {
reloaded = true; reloaded = true;
getLogger().severe("Server was reloaded! Please do not report any bugs! This plugin can't handle " + "reloads gracefully!"); getLogger().severe("Server was reloaded! Please do not report any bugs! This plugin can't handle " + "reloads gracefully!");
return; return;
} }
instance = this;
Plugin plugin = Bukkit.getPluginManager().getPlugin("ProtocolLib"); Plugin plugin = Bukkit.getPluginManager().getPlugin("ProtocolLib");
if (plugin == null || DisguiseUtilities.isOlderThan(DisguiseUtilities.getProtocolLibRequiredVersion(), plugin.getDescription().getVersion())) { if (plugin == null || DisguiseUtilities.isOlderThan(DisguiseUtilities.getProtocolLibRequiredVersion(), plugin.getDescription().getVersion())) {
@ -286,6 +286,8 @@ public class LibsDisguises extends JavaPlugin {
for (Player player : Bukkit.getOnlinePlayers()) { for (Player player : Bukkit.getOnlinePlayers()) {
DisguiseUtilities.removeSelfDisguiseScoreboard(player); DisguiseUtilities.removeSelfDisguiseScoreboard(player);
} }
reloaded = true;
} }
public boolean isReleaseBuild() { public boolean isReleaseBuild() {