From 54df28022f32316df3722baf5074d6611eef1457 Mon Sep 17 00:00:00 2001 From: Business Goose Date: Tue, 3 May 2022 09:23:37 +0100 Subject: [PATCH] Remove offline vanished players & check if the player is online before attempting to get the FPlayer --- .../totalfreedommod/command/Command_saconfig.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_saconfig.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_saconfig.java index 8b42346f..e9a70c45 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_saconfig.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_saconfig.java @@ -241,7 +241,8 @@ public class Command_saconfig extends FreedomCommand checkRank(Rank.ADMIN); Player player = getPlayer(args[1]); - FPlayer freedomPlayer = plugin.pl.getPlayer(player); + + FPlayer freedomPlayer = player != null ? plugin.pl.getPlayer(player) : null; Admin admin = player != null ? plugin.al.getAdmin(player) : plugin.al.getEntryByName(args[1]); String adminName = admin.getName(); @@ -256,6 +257,10 @@ public class Command_saconfig extends FreedomCommand plugin.al.save(admin); plugin.al.updateTables(); + + AdminList.vanished.remove(adminName); + plugin.esb.setVanished(adminName, false); + if (player != null) { // Update tab name @@ -267,9 +272,6 @@ public class Command_saconfig extends FreedomCommand freedomPlayer.setFuckoffRadius(0); // Disable vanish - plugin.esb.setVanished(adminName, false); - AdminList.vanished.remove(adminName); - for (Player player1 : server.getOnlinePlayers()) { player1.showPlayer(plugin, player);