【发布时间】:2020-08-12 17:37:15
【问题描述】:
我制作了一个消失插件,但我无法制作它,以便服务器管理员可以在该人消失时看到他们。我想这样做,如果他们获得许可,他们可以看到人消失。
public class VanishCommand implements CommandExecutor {
VanishPlugin plugin;
public VanishCommand(VanishPlugin plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
if (p.hasPermission("vanish.vanish")) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (plugin.invisible_list.contains(player)) {
for (Player people : Bukkit.getOnlinePlayers()) {
people.showPlayer(plugin, player);
}
plugin.invisible_list.remove(player);
player.sendMessage("§cYou Are Now Un Vanished§r");
} else if (!plugin.invisible_list.contains(player)) {
for (Player people : Bukkit.getOnlinePlayers()) {
people.hidePlayer(plugin, player);
}
plugin.invisible_list.add(player);
player.sendMessage("§aYou Are Now Vanished!§r");
}
}
}
return true;
}
}
【问题讨论】: