mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-12 13:53:54 +00:00
[WIP / DO NOT USE ON PRODUCTION!!] Begin implementing support for SuperVanish and fix bugs
- Update dependencies in pom.xml - Replace TotalFreedomMod's vanish system with SuperVanish. It's widely supported by many major plugins and does a better job vanishing players - Fixed a typo in the SQL command for creating admin tables, where the table would not be created on a clean install of TFM - Update bStats Metrics to latest version - Remove the VanishHandler - Sync the permissions.yml from whats on the server. Entries for Essentials and SuperVanish will be added soon KNOWN BUG: - Plugins override TFM commands (e.g. Essentials takes over /list instead of giving it to TFM). I noticed that there is a semicolon before every TFM command. (:/ban, :/list), which is the actual TFM command. I have no idea where / how this bug came from. Urgently needs to be fixed.
This commit is contained in:
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import me.totalfreedom.totalfreedommod.admin.ActivityLog;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.banning.BanManager;
|
||||
@ -23,11 +22,11 @@ import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.FAWEBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.TFGuildsBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.VanishBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.WorldGuardBridge;
|
||||
import me.totalfreedom.totalfreedommod.caging.Cager;
|
||||
import me.totalfreedom.totalfreedommod.command.CommandLoader;
|
||||
import me.totalfreedom.totalfreedommod.command.FreedomCommand;
|
||||
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
||||
import me.totalfreedom.totalfreedommod.discord.Discord;
|
||||
import me.totalfreedom.totalfreedommod.freeze.Freezer;
|
||||
@ -58,16 +57,17 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.reflections.Reflections;
|
||||
import org.spigotmc.SpigotConfig;
|
||||
|
||||
public class TotalFreedomMod extends JavaPlugin
|
||||
{
|
||||
private static TotalFreedomMod plugin;
|
||||
|
||||
public static TotalFreedomMod getPlugin()
|
||||
{
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public static final String CONFIG_FILENAME = "config.yml";
|
||||
//
|
||||
public static final BuildProperties build = new BuildProperties();
|
||||
@ -136,7 +136,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public SignBlocker snp;
|
||||
public EntityWiper ew;
|
||||
public Sitter st;
|
||||
public VanishHandler vh;
|
||||
public VanishBridge vb;
|
||||
|
||||
//public HubWorldRestrictions hwr;
|
||||
//
|
||||
@ -185,17 +185,17 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
config = new MainConfig();
|
||||
config.load();
|
||||
|
||||
if (FUtil.inDeveloperMode())
|
||||
{
|
||||
FLog.debug("Developer mode enabled.");
|
||||
}
|
||||
|
||||
cl = new CommandLoader();
|
||||
cl.loadCommands();
|
||||
|
||||
BackupManager backups = new BackupManager();
|
||||
backups.createAllBackups();
|
||||
|
||||
if (FUtil.inDeveloperMode())
|
||||
{
|
||||
FLog.debug("Developer mode enabled.");
|
||||
}
|
||||
|
||||
permissions = new PermissionConfig(this);
|
||||
permissions.load();
|
||||
|
||||
@ -233,7 +233,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
snp = new SignBlocker();
|
||||
ew = new EntityWiper();
|
||||
st = new Sitter();
|
||||
vh = new VanishHandler();
|
||||
vb = new VanishBridge();
|
||||
|
||||
// Single admin utils
|
||||
cs = new CommandSpy();
|
||||
@ -281,8 +281,8 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
timer.update();
|
||||
FLog.info("Version " + pluginVersion + " for " + ServerInterface.COMPILE_NMS_VERSION + " enabled in " + timer.getTotal() + "ms");
|
||||
|
||||
// Metrics @ https://bstats.org/plugin/bukkit/TotalFreedomMod
|
||||
new Metrics(this);
|
||||
// Metrics @ https://bstats.org/plugin/bukkit/TotalFreedomMod/2966
|
||||
new Metrics(this, 2966);
|
||||
|
||||
// Add spawnpoints later - https://github.com/TotalFreedom/TotalFreedomMod/issues/438
|
||||
new BukkitRunnable()
|
||||
@ -313,7 +313,6 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
|
||||
public static class BuildProperties
|
||||
{
|
||||
|
||||
public String author;
|
||||
public String codename;
|
||||
public String version;
|
||||
|
@ -1,83 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class VanishHandler extends FreedomService
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin(player) && plugin.al.isVanished(p.getName()))
|
||||
{
|
||||
player.hidePlayer(plugin, p);
|
||||
}
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin(p) && plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
p.hidePlayer(plugin, player);
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
plugin.esb.setVanished(player.getName(), true);
|
||||
FLog.info(player.getName() + " joined while still vanished.");
|
||||
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has joined silently.");
|
||||
event.setJoinMessage(null);
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players."));
|
||||
}
|
||||
}.runTaskTimer(plugin, 0L, 4L);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
event.setQuitMessage(null);
|
||||
FLog.info(player.getName() + " left while still vanished.");
|
||||
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has left silently.");
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package me.totalfreedom.totalfreedommod.admin;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -19,6 +20,7 @@ import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
|
||||
public class AdminList extends FreedomService
|
||||
{
|
||||
@ -31,7 +33,6 @@ public class AdminList extends FreedomService
|
||||
private final Map<String, Admin> ipTable = Maps.newHashMap();
|
||||
public final List<String> verifiedNoAdmins = new ArrayList<>();
|
||||
public final Map<String, List<String>> verifiedNoAdminIps = Maps.newHashMap();
|
||||
public static List<String> vanished = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
@ -363,8 +364,8 @@ public class AdminList extends FreedomService
|
||||
updateTables();
|
||||
}
|
||||
|
||||
public boolean isVanished(String player)
|
||||
public boolean isVanished(Player player)
|
||||
{
|
||||
return vanished.contains(player);
|
||||
return VanishAPI.isInvisible(player);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import de.myzelyam.api.vanish.PlayerHideEvent;
|
||||
import de.myzelyam.api.vanish.PlayerShowEvent;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
public class VanishBridge extends FreedomService
|
||||
{
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerUnvanish(PlayerShowEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
Displayable display = plugin.rm.getDisplay(player);
|
||||
String tag = display.getColoredTag();
|
||||
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(event.getPlayer(), null));
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " joined the server" + "**");
|
||||
PlayerData playerData = plugin.pl.getData(player);
|
||||
if (playerData.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(playerData.getTag());
|
||||
}
|
||||
playerData.setTag(tag);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerVanish(PlayerHideEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**");
|
||||
}
|
||||
}
|
@ -22,7 +22,6 @@ import org.bukkit.entity.Player;
|
||||
@CommandParameters(description = "Bans the specified player.", usage = "/<command> <username> [reason] [-nrb | -q]", aliases = "gtfo")
|
||||
public class Command_ban extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
@ -31,12 +31,12 @@ public class Command_deop extends FreedomCommand
|
||||
final String targetName = args[0].toLowerCase();
|
||||
|
||||
final List<String> matchedPlayerNames = new ArrayList<>();
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|
||||
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
|
||||
{
|
||||
if (player.isOp() && !AdminList.vanished.contains(player.getName()))
|
||||
if (player.isOp() && plugin.al.isVanished(player))
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(false);
|
||||
|
@ -43,7 +43,7 @@ public class Command_invis extends FreedomCommand
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.isVanished(player.getName()))
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.isVanished(player))
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (clear && !plugin.al.isAdmin(player))
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
@ -18,7 +19,7 @@ import org.bukkit.entity.Player;
|
||||
@CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-a | -i | -f | -v]", aliases = "who,lsit")
|
||||
public class Command_list extends FreedomCommand
|
||||
{
|
||||
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
if (args.length > 1)
|
||||
@ -96,7 +97,7 @@ public class Command_list extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - AdminList.vanished.size())
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - VanishAPI.getInvisiblePlayers().size())
|
||||
.append(ChatColor.BLUE)
|
||||
.append(" out of a maximum ")
|
||||
.append(ChatColor.RED)
|
||||
@ -109,11 +110,11 @@ public class Command_list extends FreedomCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.ADMINS && AdminList.vanished.contains(p.getName()))
|
||||
if (listFilter == ListFilter.ADMINS && plugin.al.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.VANISHED_ADMINS && !AdminList.vanished.contains(p.getName()))
|
||||
if (listFilter == ListFilter.VANISHED_ADMINS && !plugin.al.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -125,7 +126,7 @@ public class Command_list extends FreedomCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.PLAYERS && AdminList.vanished.contains(p.getName()))
|
||||
if (listFilter == ListFilter.PLAYERS && plugin.al.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ public class Command_nickfilter extends FreedomCommand
|
||||
|
||||
player = getPlayerByDisplayName(displayName);
|
||||
|
||||
if (player == null || plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
|
||||
if (player == null || plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
player = getPlayerByDisplayNameAlt(displayName);
|
||||
|
||||
if (player == null || !plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
|
||||
if (player == null || !plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName);
|
||||
return true;
|
||||
|
@ -37,7 +37,7 @@ public class Command_op extends FreedomCommand
|
||||
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|
||||
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
|
||||
{
|
||||
if (!player.isOp() && !AdminList.vanished.contains(player.getName()))
|
||||
if (!player.isOp() && !plugin.al.isVanished(player))
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(true);
|
||||
|
@ -104,7 +104,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
target = getPlayer(args[4]);
|
||||
|
||||
if (target == null || plugin.al.isVanished(target.getName()) && !plugin.al.isAdmin(sender))
|
||||
if (target == null || plugin.al.isVanished(target) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED);
|
||||
return true;
|
||||
|
@ -48,7 +48,7 @@ public class Command_tag extends FreedomCommand
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
|
||||
if (plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1,120 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||
public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
Displayable display = plugin.rm.getDisplay(playerSender);
|
||||
String displayName = display.getColor() + playerSender.getName();
|
||||
String tag = display.getColoredTag();
|
||||
boolean silent = false;
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-silent"))
|
||||
{
|
||||
silent = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.al.isVanished(playerSender.getName()))
|
||||
{
|
||||
if (silent)
|
||||
{
|
||||
msg(ChatColor.GOLD + "Silently unvanished.");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("You have unvanished.", ChatColor.GOLD);
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(playerSender, null));
|
||||
FUtil.bcastMsg(playerSender.getName() + " joined the game.", ChatColor.YELLOW);
|
||||
plugin.dc.messageChatChannel("**" + playerSender.getName() + " joined the server" + "**");
|
||||
}
|
||||
|
||||
PlayerData playerData = plugin.pl.getData(playerSender);
|
||||
if (playerData.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(playerData.getTag());
|
||||
}
|
||||
|
||||
plugin.pl.getData(playerSender).setTag(tag);
|
||||
FLog.info(playerSender.getName() + " is no longer vanished.");
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has unvanished and is now visible to everyone.");
|
||||
}
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.showPlayer(plugin, playerSender);
|
||||
}
|
||||
}
|
||||
plugin.esb.setVanished(playerSender.getName(), false);
|
||||
playerSender.setPlayerListName(StringUtils.substring(displayName, 0, 16));
|
||||
plugin.al.vanished.remove(playerSender.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (plugin.al.isVanished(playerSender.getName()))
|
||||
{
|
||||
playerSender.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players."));
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 0L, 4L);
|
||||
|
||||
if (silent)
|
||||
{
|
||||
msg("Silently vanished.", ChatColor.GOLD);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg ("You have vanished.", ChatColor.GOLD);
|
||||
FUtil.bcastMsg(playerSender.getName() + " left the game.", ChatColor.YELLOW);
|
||||
plugin.dc.messageChatChannel("**" + playerSender.getName() + " left the server" + "**");
|
||||
}
|
||||
|
||||
FLog.info(playerSender.getName() + " is now vanished.");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins.");
|
||||
}
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.hidePlayer(plugin, playerSender);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugin.esb.setVanished(playerSender.getName(), true);
|
||||
plugin.al.vanished.add(playerSender.getName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@ public class Command_whohas extends FreedomCommand
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender) && plugin.al.isVanished(player.getName()))
|
||||
if (!plugin.al.isAdmin(sender) && plugin.al.isVanished(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
if (player != null)
|
||||
{
|
||||
if (nullVanished && plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
|
||||
if (nullVanished && plugin.al.isVanished(player) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ public class Discord extends FreedomService
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
if (!plugin.al.isVanished(event.getPlayer().getName()))
|
||||
if (!plugin.al.isVanished(event.getPlayer()))
|
||||
{
|
||||
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " joined the server" + "**");
|
||||
}
|
||||
@ -263,7 +263,7 @@ public class Discord extends FreedomService
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerLeave(PlayerQuitEvent event)
|
||||
{
|
||||
if (!plugin.al.isVanished(event.getPlayer().getName()))
|
||||
if (!plugin.al.isVanished(event.getPlayer()))
|
||||
{
|
||||
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " left the server" + "**");
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class Module_list extends HTTPDModule
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
|
||||
if (plugin.al.isVanished(player.getName()))
|
||||
if (plugin.al.isVanished(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class Module_list extends HTTPDModule
|
||||
|
||||
for (Player player : onlinePlayers)
|
||||
{
|
||||
if (plugin.al.isVanished(player.getName()))
|
||||
if (plugin.al.isVanished(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class Module_players extends HTTPDModule
|
||||
// All online players
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isVanished(player.getName()))
|
||||
if (!plugin.al.isVanished(player))
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (plugin.al.isAdmin(player) && !plugin.al.isAdminImpostor(player))
|
||||
|
@ -250,7 +250,7 @@ public class RankManager extends FreedomService
|
||||
// Broadcast login message
|
||||
if (isAdmin || FUtil.isDeveloper(player.getName()) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator())
|
||||
{
|
||||
if (!plugin.al.isVanished(player.getName()))
|
||||
if (!plugin.al.isVanished(player))
|
||||
{
|
||||
FUtil.bcastMsg(craftLoginMessage(player, null));
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class SQLite extends FreedomService
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.createStatement().execute("CREATE TABLE `admins` (`username` VARCHAR NOT NULL, `ips` VARCHAR NOT NULL, `rank` VARCHAR NOT NULL, `active` BOOLEAN NOT NULL, `last_login` LONG NOT NULL, `login_message` VARCHAR, `command_spy` BOOLEAN NOT NULL, `potion_spy` BOOLEAN NOT NULL, `ac_format` VARCHAR, `old_tags` BOOLEAN NOT NULL, `log_stick` BOOLEAN NOT NULL, `display_discord` BOOLEAN NOT NULL,);");
|
||||
connection.createStatement().execute("CREATE TABLE `admins` (`username` VARCHAR NOT NULL, `ips` VARCHAR NOT NULL, `rank` VARCHAR NOT NULL, `active` BOOLEAN NOT NULL, `last_login` LONG NOT NULL, `login_message` VARCHAR, `command_spy` BOOLEAN NOT NULL, `potion_spy` BOOLEAN NOT NULL, `ac_format` VARCHAR, `old_tags` BOOLEAN NOT NULL, `log_stick` BOOLEAN NOT NULL, `display_discord` BOOLEAN NOT NULL);");
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ public class FUtil
|
||||
List<String> names = new ArrayList<>();
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (!TotalFreedomMod.plugin().al.isVanished(player.getName()))
|
||||
if (!TotalFreedomMod.plugin().al.isVanished(player))
|
||||
{
|
||||
names.add(player.getName());
|
||||
}
|
||||
|
Reference in New Issue
Block a user