Merge pull request #276 from speedxx/development

fix vanish bug
This commit is contained in:
Telesphoreo 2020-08-18 23:18:34 -05:00 committed by GitHub
commit 04fee7d5c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,19 +94,15 @@ 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))
{
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins.");
}
if (!plugin.sl.isAdmin(player))
{ {
player.hidePlayer(plugin, playerSender); player.hidePlayer(plugin, playerSender);
} }
} }
}
plugin.esb.setVanished(playerSender.getName(), true); plugin.esb.setVanished(playerSender.getName(), true);
plugin.sl.vanished.add(playerSender.getName()); plugin.sl.vanished.add(playerSender.getName());