mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Remove offline vanished players & check if the player is online before attempting to get the FPlayer
This commit is contained in:
parent
0326171e85
commit
54df28022f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user