fix vanish bug

This commit is contained in:
speedxx 2020-08-18 22:56:32 -04:00
parent d65f584707
commit d38ddac311
2 changed files with 8 additions and 16 deletions

View File

@ -31,7 +31,7 @@ public class VanishHandler extends FreedomService
for (Player p : server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!plugin.sl.isAdmin(player) && plugin.sl.isVanished(p.getName())) if (!plugin.sl.isStaff(player) && plugin.sl.isVanished(p.getName()))
{ {
player.hidePlayer(plugin, p); player.hidePlayer(plugin, p);
} }
@ -39,7 +39,7 @@ public class VanishHandler extends FreedomService
for (Player p : server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!plugin.sl.isAdmin(p) && plugin.sl.isVanished(player.getName())) if (!plugin.sl.isStaff(p) && plugin.sl.isVanished(player.getName()))
{ {
p.hidePlayer(plugin, player); p.hidePlayer(plugin, player);
} }

View File

@ -13,7 +13,6 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v") @CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
@ -56,14 +55,11 @@ public class Command_vanish extends FreedomCommand
plugin.pl.getData(playerSender).setTag(tag); plugin.pl.getData(playerSender).setTag(tag);
FLog.info(playerSender.getName() + " is no longer vanished."); FLog.info(playerSender.getName() + " is no longer vanished.");
plugin.sl.messageAllStaff(ChatColor.YELLOW + sender.getName() + " has unvanished and is now visible to everyone.");
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
if (plugin.sl.isAdmin(player)) if (!plugin.sl.isStaff(player))
{
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has unvanished and is now visible to everyone.");
}
if (!plugin.sl.isAdmin(player))
{ {
player.showPlayer(plugin, playerSender); player.showPlayer(plugin, playerSender);
} }
@ -98,17 +94,13 @@ public class Command_vanish extends FreedomCommand
} }
FLog.info(playerSender.getName() + " is now vanished."); FLog.info(playerSender.getName() + " is now vanished.");
plugin.sl.messageAllStaff(ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to staff members.");
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
if (!plugin.sl.isStaff(player))
{ {
if (plugin.sl.isAdmin(player)) player.hidePlayer(plugin, playerSender);
{
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins.");
}
if (!plugin.sl.isAdmin(player))
{
player.hidePlayer(plugin, playerSender);
}
} }
} }