From 04a7b633a4e99c2adc96e1ff2cc2d4ec38e46e16 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sat, 15 Aug 2020 17:58:48 -0500 Subject: [PATCH] it compiles now --- pom.xml | 7 -- .../me/totalfreedom/totalfreedommod/AMP.java | 2 +- .../totalfreedommod/ChatManager.java | 2 +- .../totalfreedommod/TotalFreedomMod.java | 9 +- .../totalfreedommod/VanishHandler.java | 83 +++++++++++++++++++ .../blocking/command/CommandBlockerRank.java | 2 +- .../bridge/BukkitTelnetBridge.java | 2 +- .../totalfreedommod/bridge/VanishBridge.java | 64 -------------- .../totalfreedommod/command/Command_amp.java | 2 +- .../command/Command_cmdspy.java | 2 +- .../totalfreedommod/command/Command_deop.java | 2 +- .../totalfreedommod/command/Command_doom.java | 2 +- .../command/Command_invis.java | 2 +- .../totalfreedommod/command/Command_list.java | 13 ++- .../command/Command_mystaff.java | 2 +- .../command/Command_nickfilter.java | 4 +- .../totalfreedommod/command/Command_op.java | 2 +- .../command/Command_playtime.java | 2 +- .../command/Command_potion.java | 2 +- .../command/Command_potionspy.java | 2 +- .../command/Command_slconfig.java | 2 +- .../totalfreedommod/command/Command_tag.java | 2 +- .../command/Command_vanish.java | 16 ++-- .../command/Command_whohas.java | 2 +- .../command/FreedomCommand.java | 4 +- .../totalfreedommod/discord/Discord.java | 2 +- .../discord/PrivateMessageListener.java | 2 +- .../totalfreedommod/httpd/HTTPDaemon.java | 4 +- .../httpd/module/Module_activitylog.java | 4 +- .../httpd/module/Module_bans.java | 2 +- .../httpd/module/Module_indefbans.java | 2 +- .../httpd/module/Module_list.java | 6 +- .../httpd/module/Module_logfile.java | 2 +- .../httpd/module/Module_players.java | 4 +- .../httpd/module/Module_punishments.java | 2 +- .../httpd/module/Module_schematic.java | 2 +- .../httpd/module/Module_staff.java | 2 +- .../totalfreedommod/player/PlayerList.java | 2 +- .../totalfreedommod/rank/Rank.java | 1 - .../totalfreedommod/rank/RankManager.java | 4 +- .../totalfreedommod/sql/SQLite.java | 2 +- .../totalfreedommod/staff/StaffList.java | 3 +- .../totalfreedommod/util/FUtil.java | 2 +- 43 files changed, 145 insertions(+), 137 deletions(-) create mode 100644 src/main/java/me/totalfreedom/totalfreedommod/VanishHandler.java delete mode 100644 src/main/java/me/totalfreedom/totalfreedommod/bridge/VanishBridge.java diff --git a/pom.xml b/pom.xml index b733dc88..9df696ab 100644 --- a/pom.xml +++ b/pom.xml @@ -140,13 +140,6 @@ compile - - com.github.MyzelYam - SuperVanish - 6.1.8 - provided - - org.spigotmc spigot diff --git a/src/main/java/me/totalfreedom/totalfreedommod/AMP.java b/src/main/java/me/totalfreedom/totalfreedommod/AMP.java index 8f78ef22..3bf1de6c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/AMP.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/AMP.java @@ -5,9 +5,9 @@ import java.util.Arrays; import java.util.List; import joptsimple.internal.Strings; import lombok.Getter; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import org.json.simple.JSONObject; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java index 723f6316..1a341886 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java @@ -1,11 +1,11 @@ package me.totalfreedom.totalfreedommod; import com.google.common.base.Strings; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Displayable; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FSync; import me.totalfreedom.totalfreedommod.util.FUtil; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 9ed62f77..a0381323 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -3,8 +3,6 @@ package me.totalfreedom.totalfreedommod; import java.io.File; import java.io.InputStream; import java.util.Properties; -import me.totalfreedom.totalfreedommod.staff.ActivityLog; -import me.totalfreedom.totalfreedommod.staff.StaffList; import me.totalfreedom.totalfreedommod.banning.BanManager; import me.totalfreedom.totalfreedommod.banning.IndefiniteBanList; import me.totalfreedom.totalfreedommod.blocking.BlockBlocker; @@ -22,7 +20,6 @@ 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; @@ -45,6 +42,8 @@ import me.totalfreedom.totalfreedommod.rank.RankManager; import me.totalfreedom.totalfreedommod.shop.Shop; import me.totalfreedom.totalfreedommod.shop.Votifier; import me.totalfreedom.totalfreedommod.sql.SQLite; +import me.totalfreedom.totalfreedommod.staff.ActivityLog; +import me.totalfreedom.totalfreedommod.staff.StaffList; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.MethodTimer; @@ -135,7 +134,7 @@ public class TotalFreedomMod extends JavaPlugin public SignBlocker snp; public EntityWiper ew; public Sitter st; - public VanishBridge vb; + public VanishHandler vh; public AMP amp; //public HubWorldRestrictions hwr; @@ -233,7 +232,7 @@ public class TotalFreedomMod extends JavaPlugin snp = new SignBlocker(); ew = new EntityWiper(); st = new Sitter(); - vb = new VanishBridge(); + vh = new VanishHandler(); amp = new AMP(); // Single admin utils diff --git a/src/main/java/me/totalfreedom/totalfreedommod/VanishHandler.java b/src/main/java/me/totalfreedom/totalfreedommod/VanishHandler.java new file mode 100644 index 00000000..ac6d59a4 --- /dev/null +++ b/src/main/java/me/totalfreedom/totalfreedommod/VanishHandler.java @@ -0,0 +1,83 @@ +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.sl.isAdmin(player) && plugin.sl.isVanished(p.getName())) + { + player.hidePlayer(plugin, p); + } + } + + for (Player p : server.getOnlinePlayers()) + { + if (!plugin.sl.isAdmin(p) && plugin.sl.isVanished(player.getName())) + { + p.hidePlayer(plugin, player); + } + } + + if (plugin.sl.isVanished(player.getName())) + { + plugin.esb.setVanished(player.getName(), true); + FLog.info(player.getName() + " joined while still vanished."); + plugin.sl.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has joined silently."); + event.setJoinMessage(null); + + new BukkitRunnable() + { + @Override + public void run() + { + if (!plugin.sl.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.sl.isVanished(player.getName())) + { + event.setQuitMessage(null); + FLog.info(player.getName() + " left while still vanished."); + plugin.sl.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has left silently."); + } + } +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlockerRank.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlockerRank.java index 91a145cf..cfb6e03c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlockerRank.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlockerRank.java @@ -1,8 +1,8 @@ package me.totalfreedom.totalfreedommod.blocking.command; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java index d8c3d397..f791e2ee 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java @@ -10,8 +10,8 @@ import me.totalfreedom.bukkittelnet.api.TelnetPreLoginEvent; import me.totalfreedom.bukkittelnet.api.TelnetRequestDataTagsEvent; import me.totalfreedom.bukkittelnet.session.ClientSession; import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/VanishBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/VanishBridge.java deleted file mode 100644 index 097309b6..00000000 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/VanishBridge.java +++ /dev/null @@ -1,64 +0,0 @@ -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.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; - -public class VanishBridge extends FreedomService -{ - @Override - public void onStart() - { - } - - @Override - public void onStop() - { - } - - @EventHandler - public void onPlayerUnvanish(PlayerShowEvent event) - { - Player player = event.getPlayer(); - Displayable display = plugin.rm.getDisplay(player); - String tag = display.getColoredTag(); - - if (event.isSilent()) - { - plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " silently unvanished."); - } - else - { - plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " unvanished and is now visible to all players."); - 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 - public void onPlayerVanish(PlayerHideEvent event) - { - Player player = event.getPlayer(); - if (event.isSilent()) - { - plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " vanished and is now only visible to admins."); - } - else - { - plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**"); - } - } -} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_amp.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_amp.java index 45064db9..edaf44ef 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_amp.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_amp.java @@ -3,9 +3,9 @@ package me.totalfreedom.totalfreedommod.command; import java.util.Arrays; import java.util.Collections; import java.util.List; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cmdspy.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cmdspy.java index c31e1d5b..d67ef7f2 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cmdspy.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cmdspy.java @@ -1,7 +1,7 @@ package me.totalfreedom.totalfreedommod.command; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java index 0b989867..b4017c47 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java @@ -35,7 +35,7 @@ public class Command_deop extends FreedomCommand if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName) || player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) { - if (player.isOp() && !plugin.sl.isVanished(player)) + if (player.isOp() && !plugin.sl.isVanished(player.getName())) { matchedPlayerNames.add(player.getName()); player.setOp(false); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_doom.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_doom.java index b9b06cae..10804c27 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_doom.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_doom.java @@ -1,11 +1,11 @@ package me.totalfreedom.totalfreedommod.command; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.banning.Ban; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.punishments.Punishment; import me.totalfreedom.totalfreedommod.punishments.PunishmentType; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java index b1e4a8a9..266350f6 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java @@ -43,7 +43,7 @@ public class Command_invis extends FreedomCommand for (Player player : server.getOnlinePlayers()) { - if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.sl.isVanished(player)) + if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.sl.isVanished(player.getName())) { players.add(player.getName()); if (clear && !plugin.sl.isStaff(player)) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java index f6fcc6b5..85248291 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java @@ -1,12 +1,12 @@ package me.totalfreedom.totalfreedommod.command; -import de.myzelyam.api.vanish.VanishAPI; import java.util.ArrayList; import java.util.List; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Displayable; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffList; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import net.md_5.bungee.api.ChatColor; import org.apache.commons.lang.StringUtils; @@ -18,7 +18,6 @@ import org.bukkit.entity.Player; @CommandParameters(description = "Lists the real names of all online players.", usage = "/ [-s | -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 +95,7 @@ public class Command_list extends FreedomCommand } else { - onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - VanishAPI.getInvisiblePlayers().size()) + onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - StaffList.vanished.size()) .append(ChatColor.BLUE) .append(" out of a maximum ") .append(ChatColor.RED) @@ -109,11 +108,11 @@ public class Command_list extends FreedomCommand { continue; } - if (listFilter == ListFilter.STAFF && plugin.sl.isVanished(p)) + if (listFilter == ListFilter.STAFF && plugin.sl.isVanished(p.getName())) { continue; } - if (listFilter == ListFilter.VANISHED_STAFF && !plugin.sl.isVanished(p)) + if (listFilter == ListFilter.VANISHED_STAFF && !plugin.sl.isVanished(p.getName())) { continue; } @@ -125,7 +124,7 @@ public class Command_list extends FreedomCommand { continue; } - if (listFilter == ListFilter.PLAYERS && plugin.sl.isVanished(p)) + if (listFilter == ListFilter.PLAYERS && plugin.sl.isVanished(p.getName())) { continue; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mystaff.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mystaff.java index e9c70f43..a30b7a80 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mystaff.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mystaff.java @@ -4,10 +4,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java index 74087862..db6a70db 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java @@ -41,11 +41,11 @@ public class Command_nickfilter extends FreedomCommand player = getPlayerByDisplayName(displayName); - if (player == null || plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender)) + if (player == null || plugin.sl.isVanished(player.getName()) && !plugin.sl.isStaff(sender)) { player = getPlayerByDisplayNameAlt(displayName); - if (player == null || !plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender)) + if (player == null || !plugin.sl.isVanished(player.getName()) && !plugin.sl.isStaff(sender)) { sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName); return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java index 7b824a7a..9cda7d52 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java @@ -36,7 +36,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() && !plugin.sl.isVanished(player)) + if (!player.isOp() && !plugin.sl.isVanished(player.getName())) { matchedPlayerNames.add(player.getName()); player.setOp(true); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playtime.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playtime.java index 493ff68d..682369c2 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playtime.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playtime.java @@ -3,8 +3,8 @@ package me.totalfreedom.totalfreedommod.command; import java.time.Instant; import java.util.Date; import java.util.List; -import me.totalfreedom.totalfreedommod.staff.ActivityLogEntry; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.ActivityLogEntry; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java index 258286d3..719b0795 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java @@ -104,7 +104,7 @@ public class Command_potion extends FreedomCommand { target = getPlayer(args[4]); - if (target == null || plugin.sl.isVanished(target) && !plugin.sl.isStaff(sender)) + if (target == null || plugin.sl.isVanished(target.getName()) && !plugin.sl.isStaff(sender)) { msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED); return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potionspy.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potionspy.java index a2fc6133..90de5609 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potionspy.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potionspy.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.math.NumberUtils; import org.bukkit.Bukkit; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_slconfig.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_slconfig.java index 2512e2cf..c14ea46f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_slconfig.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_slconfig.java @@ -5,10 +5,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java index d79d7a75..a7a4df59 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java @@ -48,7 +48,7 @@ public class Command_tag extends FreedomCommand for (final Player player : server.getOnlinePlayers()) { - if (plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender)) + if (plugin.sl.isVanished(player.getName()) && !plugin.sl.isStaff(sender)) { continue; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_vanish.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_vanish.java index 8cceba70..e7496637 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_vanish.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_vanish.java @@ -15,7 +15,7 @@ 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) +@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME) @CommandParameters(description = "Vanish/unvanish yourself.", usage = "/ [-s[ilent]]", aliases = "v") public class Command_vanish extends FreedomCommand { @@ -34,7 +34,7 @@ public class Command_vanish extends FreedomCommand } } - if (plugin.al.isVanished(playerSender.getName())) + if (plugin.sl.isVanished(playerSender.getName())) { if (silent) { @@ -59,18 +59,18 @@ public class Command_vanish extends FreedomCommand for (Player player : server.getOnlinePlayers()) { - if (plugin.al.isAdmin(player)) + if (plugin.sl.isAdmin(player)) { playerMsg(player, ChatColor.YELLOW + sender.getName() + " has unvanished and is now visible to everyone."); } - if (!plugin.al.isAdmin(player)) + if (!plugin.sl.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()); + plugin.sl.vanished.remove(playerSender.getName()); } else { @@ -79,7 +79,7 @@ public class Command_vanish extends FreedomCommand @Override public void run() { - if (plugin.al.isVanished(playerSender.getName())) + if (plugin.sl.isVanished(playerSender.getName())) { playerSender.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players.")); } @@ -101,11 +101,11 @@ public class Command_vanish extends FreedomCommand for (Player player : server.getOnlinePlayers()) { { - if (plugin.al.isAdmin(player)) + if (plugin.sl.isAdmin(player)) { playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins."); } - if (!plugin.al.isAdmin(player)) + if (!plugin.sl.isAdmin(player)) { player.hidePlayer(plugin, playerSender); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whohas.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whohas.java index 870d2c7c..f9ef9f6c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whohas.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whohas.java @@ -40,7 +40,7 @@ public class Command_whohas extends FreedomCommand for (final Player player : server.getOnlinePlayers()) { - if (!plugin.sl.isStaff(sender) && plugin.sl.isVanished(player)) + if (!plugin.sl.isStaff(sender) && plugin.sl.isVanished(player.getName())) { continue; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/FreedomCommand.java b/src/main/java/me/totalfreedom/totalfreedommod/command/FreedomCommand.java index 00396caf..04607eef 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/FreedomCommand.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/FreedomCommand.java @@ -10,9 +10,9 @@ import java.util.Timer; import java.util.TimerTask; import lombok.Getter; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; @@ -316,7 +316,7 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter Player player = Bukkit.getPlayer(name); if (player != null) { - if (nullVanished && plugin.sl.isVanished(player) && !plugin.sl.isStaff(sender)) + if (nullVanished && plugin.sl.isVanished(player.getName()) && !plugin.sl.isStaff(sender)) { return null; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java index d6f25b44..777a0bc1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java @@ -14,10 +14,10 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; import javax.security.auth.login.LoginException; import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import net.dv8tion.jda.api.AccountType; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/PrivateMessageListener.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/PrivateMessageListener.java index 67322cee..63cd4c80 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/PrivateMessageListener.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/PrivateMessageListener.java @@ -1,8 +1,8 @@ package me.totalfreedom.totalfreedommod.discord; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.player.PlayerData; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import net.dv8tion.jda.api.events.message.priv.PrivateMessageReceivedEvent; import net.dv8tion.jda.api.hooks.ListenerAdapter; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java index 9e4f0ef2..cd334bfd 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java @@ -12,17 +12,17 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response; import me.totalfreedom.totalfreedommod.httpd.module.HTTPDModule; import me.totalfreedom.totalfreedommod.httpd.module.Module_activitylog; -import me.totalfreedom.totalfreedommod.httpd.module.Module_staff; import me.totalfreedom.totalfreedommod.httpd.module.Module_bans; import me.totalfreedom.totalfreedommod.httpd.module.Module_file; import me.totalfreedom.totalfreedommod.httpd.module.Module_help; +import me.totalfreedom.totalfreedommod.httpd.module.Module_indefbans; import me.totalfreedom.totalfreedommod.httpd.module.Module_list; import me.totalfreedom.totalfreedommod.httpd.module.Module_logfile; import me.totalfreedom.totalfreedommod.httpd.module.Module_logs; -import me.totalfreedom.totalfreedommod.httpd.module.Module_indefbans; import me.totalfreedom.totalfreedommod.httpd.module.Module_players; import me.totalfreedom.totalfreedommod.httpd.module.Module_punishments; import me.totalfreedom.totalfreedommod.httpd.module.Module_schematic; +import me.totalfreedom.totalfreedommod.httpd.module.Module_staff; import me.totalfreedom.totalfreedommod.util.FLog; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java index a5b8cf52..e165878d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java @@ -2,10 +2,10 @@ package me.totalfreedom.totalfreedommod.httpd.module; import java.io.File; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.ActivityLog; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.ActivityLog; +import me.totalfreedom.totalfreedommod.staff.StaffMember; public class Module_activitylog extends HTTPDModule { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_bans.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_bans.java index 4910544c..8b0d0072 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_bans.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_bans.java @@ -1,8 +1,8 @@ package me.totalfreedom.totalfreedommod.httpd.module; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.StaffMember; public class Module_bans extends HTTPDModule { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java index 9489d1ec..63b66fc7 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java @@ -2,10 +2,10 @@ package me.totalfreedom.totalfreedommod.httpd.module; import java.io.File; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.banning.IndefiniteBanList; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.StaffMember; public class Module_indefbans extends HTTPDModule { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java index fc9bdd35..0869486d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java @@ -2,9 +2,9 @@ package me.totalfreedom.totalfreedommod.httpd.module; import java.util.Collection; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -40,7 +40,7 @@ public class Module_list extends HTTPDModule for (Player player : Bukkit.getOnlinePlayers()) { - if (plugin.sl.isVanished(player)) + if (plugin.sl.isVanished(player.getName())) { continue; } @@ -128,7 +128,7 @@ public class Module_list extends HTTPDModule for (Player player : onlinePlayers) { - if (plugin.sl.isVanished(player)) + if (plugin.sl.isVanished(player.getName())) { continue; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java index 00100400..2765f401 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java @@ -7,12 +7,12 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools; import me.totalfreedom.totalfreedommod.httpd.HTTPDPageBuilder; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringEscapeUtils; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_players.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_players.java index 8c4e809d..bd46556d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_players.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_players.java @@ -1,9 +1,9 @@ package me.totalfreedom.totalfreedommod.httpd.module; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -36,7 +36,7 @@ public class Module_players extends HTTPDModule // All online players for (Player player : Bukkit.getOnlinePlayers()) { - if (!plugin.sl.isVanished(player)) + if (!plugin.sl.isVanished(player.getName())) { players.add(player.getName()); if (plugin.sl.isStaff(player) && !plugin.sl.isAdminImpostor(player)) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java index 41105a18..3aadc42f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java @@ -2,10 +2,10 @@ package me.totalfreedom.totalfreedommod.httpd.module; import java.io.File; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.punishments.PunishmentList; +import me.totalfreedom.totalfreedommod.staff.StaffMember; public class Module_punishments extends HTTPDModule { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java index 7e0eed79..a983bef9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools; import me.totalfreedom.totalfreedommod.httpd.HTTPDPageBuilder; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; @@ -22,6 +21,7 @@ import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Method; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response; import me.totalfreedom.totalfreedommod.player.PlayerData; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringEscapeUtils; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_staff.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_staff.java index f3c07457..41c5e261 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_staff.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_staff.java @@ -1,8 +1,8 @@ package me.totalfreedom.totalfreedommod.httpd.module; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; +import me.totalfreedom.totalfreedommod.staff.StaffMember; public class Module_staff extends HTTPDModule { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java index 2a41f4ec..f4b346c2 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java @@ -9,9 +9,9 @@ import java.util.List; import java.util.Map; import lombok.Getter; import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.OfflinePlayer; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java index a6071c73..64f6c2a9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java @@ -5,7 +5,6 @@ import net.md_5.bungee.api.ChatColor; public enum Rank implements Displayable { - IMPOSTOR("an", "Impostor", Type.PLAYER, "Imp", ChatColor.YELLOW, null, false), NON_OP("a", "Non-Op", Type.PLAYER, "", ChatColor.WHITE, null, false), OP("an", "Operator", Type.PLAYER, "OP", ChatColor.GREEN, null, false), diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java index 00d5c100..e361ddde 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java @@ -1,10 +1,10 @@ package me.totalfreedom.totalfreedommod.rank; import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.PlayerData; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; @@ -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.sl.isVanished(player)) + if (!plugin.sl.isVanished(player.getName())) { FUtil.bcastMsg(craftLoginMessage(player, null)); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/sql/SQLite.java b/src/main/java/me/totalfreedom/totalfreedommod/sql/SQLite.java index c8b5c401..5e2690a8 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/sql/SQLite.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/sql/SQLite.java @@ -8,9 +8,9 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.text.MessageFormat; import me.totalfreedom.totalfreedommod.FreedomService; -import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.banning.Ban; import me.totalfreedom.totalfreedommod.player.PlayerData; +import me.totalfreedom.totalfreedommod.staff.StaffMember; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java b/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java index eb5a6924..7ab88257 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java @@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.staff; 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; @@ -32,7 +31,7 @@ public class StaffList extends FreedomService private final Map ipTable = Maps.newHashMap(); public final List verifiedNoStaff = new ArrayList<>(); public final Map> verifiedNoStaffIps = Maps.newHashMap(); - public final List vanished = new ArrayList<>(); + public static final List vanished = new ArrayList<>(); @Override public void onStart() diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index 34e30b5e..c15912a3 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -146,7 +146,7 @@ public class FUtil List names = new ArrayList<>(); for (Player player : Bukkit.getOnlinePlayers()) { - if (!TotalFreedomMod.plugin().sl.isVanished(player)) + if (!TotalFreedomMod.plugin().sl.isVanished(player.getName())) { names.add(player.getName()); }