本文整理汇总了Java中org.kitteh.vanish.VanishPlugin类的典型用法代码示例。如果您正苦于以下问题:Java VanishPlugin类的具体用法?Java VanishPlugin怎么用?Java VanishPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VanishPlugin类属于org.kitteh.vanish包,在下文中一共展示了VanishPlugin类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: play
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public boolean play() {
if (this.getEffectType().equals(EffectHolder.EffectType.PLAYER)) {
Player p = Bukkit.getPlayerExact(this.getHolder().getDetails().playerName);
if (p == null) {
return false;
}
boolean vanished = false;
if (PluginHook.getVNP() != null) {
VanishPlugin vnp = PluginHook.getVNP();
vanished = vnp.getManager().isVanished(this.getHolder().getDetails().playerName);
}
if (vanished) {
if (this.checkForFeetDisplay(p, true)) {
this.playDemo(p);
}
return false;
}
if (this.checkForFeetDisplay(p, false)) {
return !this.callPlayEvent();
}
}
return !this.callPlayEvent();
}
示例2: onEnable
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
@Override
public void onEnable() {
this.saveDefaultConfig();
Bukkit.getServer().getPluginManager().registerEvents(new PercentSleepListener(this), this);
plugin = this;
PluginManager pm = Bukkit.getServer().getPluginManager();
// Hook Vanish/Essentials listeners if the plugins exist
essentials = (IEssentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
if (essentials != null) {
pm.registerEvents(new PercentSleepEssentialsListener(this), this);
anyPluginsHooked = true;
this.getLogger().info("Hooked into Essentials");
}
vanish = (VanishPlugin) Bukkit.getServer().getPluginManager().getPlugin("VanishNoPacket");
if (vanish != null) {
pm.registerEvents(new PercentSleepVanishListener(this), this);
anyPluginsHooked = true;
this.getLogger().info("Hooked into VanishNoPacket");
}
if (pm.getPlugin("SuperVanish") != null || pm.getPlugin("PremiumVanish") != null) {
pm.registerEvents(new SVListener(this), this);
anyPluginsHooked = true;
this.getLogger().info("Hooked into SuperVanish/PremiumVanish");
}
final List<World> worlds = Bukkit.getWorlds();
final List<String> ignored = this.getConfig().getStringList("ignored-worlds");
for (World w: worlds) {
if (w.getEnvironment().equals(World.Environment.NORMAL) && !ignored.contains(w.getName())) {
this.worlds.put(w.getName(), new PercentSleepWorld(w));
}
}
}
示例3: initialize
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public static void initialize() {
if(Bukkit.getPluginManager().isPluginEnabled("CombatTagPlus")) {
ctManager = ((CombatTagPlus)Bukkit.getServer().getPluginManager().getPlugin("CombatTagPlus")).getTagManager();
combattag = true;
}
if(Bukkit.getPluginManager().isPluginEnabled("VanishNoPacket")) {
vnp = (VanishPlugin) Bukkit.getPluginManager().getPlugin("VanishNoPacket");
vanish = true;
}
}
示例4: canSee
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
/**
* Checks if the sender can see the admin
*
* @param admin
* the player to check if they are vanished
* @param sender
* the player
* @return true if they can see them, else false
*/
boolean canSee(final Player admin, final Player sender) {
if (vnp) {
if (JavaPlugin.getPlugin(VanishPlugin.class).getManager().isVanished(admin)) {
return perm.has(sender, "vanish.see");
}
}
if (spv) {
return VanishAPI.canSee(sender, admin);
}
return true;
}
示例5: isVanished
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
/**
* Checks if a player is vanished
*
* @param player player
* @return boolean
*/
public boolean isVanished(Player player) {
return player != null
&& (plugin.getDependencyManager().isEnabled(Dependency.VANISHNOPACKET) && plugin.getDependencyManager().get(Dependency.VANISHNOPACKET, VanishPlugin.class).getManager().isVanished(player)
|| plugin.getDependencyManager().isEnabled(Dependency.ESSENTIALS) && plugin.getDependencyManager().get(Dependency.ESSENTIALS, Essentials.class).getVanishedPlayers().contains(player.getName()));
}
示例6: getVNP
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public static VanishPlugin getVNP() {
Plugin plugin = SparkTrailPlugin.getInstance().getServer().getPluginManager().getPlugin("VanishNoPacket");
if (plugin == null || !(plugin instanceof VanishPlugin)) {
return null;
}
return (VanishPlugin) plugin;
}
示例7: onEnable
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
@Override
public void onEnable() {
new Metrics(this);
this.saveDefaultConfig();
configuration = this.getConfig();
configuration.options().copyDefaults(true);
this.saveConfig();
server = this.getServer();
server.getPluginManager().registerEvents(this, this);
if (configuration.getBoolean("afk"))
new BukkitRunnable() {
@Override
public void run() {
for (Player p : server.getOnlinePlayers())
if (idle.get(p) != null && !away.contains(p))
if (System.currentTimeMillis() - idle.get(p) > AWAY) {
if (Bukkit.getPluginManager().isPluginEnabled("VanishNoPacket")) {
VanishManager vanish = ((VanishPlugin) Bukkit.getPluginManager().getPlugin("VanishNoPacket")).getManager();
if (vanish != null)
if ((Boolean) new VanishCheck(vanish, p.getName()).call())
return;
}
away.add(p);
Bukkit.broadcastMessage(ChatColor.YELLOW + p.getName() + Strings.AWAY);
if (Bukkit.getPluginManager().isPluginEnabled("dynmap"))
((DynmapCommonAPI) Bukkit.getPluginManager().getPlugin("dynmap")).sendBroadcastToWeb(null, p.getName() + " is away from keyboard.");
}
}
}.runTaskTimer(this, INTERVAL, INTERVAL);
}
示例8: init
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public static void init(JavaPlugin parent) {
vanishNoPacket = parent.getServer().getPluginManager().isPluginEnabled("VanishNoPacket");
if (vanishNoPacket) {
manager = ((VanishPlugin) parent.getServer().getPluginManager().getPlugin("VanishNoPacket")).getManager();
}
}
示例9: isVanished
import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public boolean isVanished(Player player) {
return ((VanishPlugin) Bukkit.getPluginManager().getPlugin("VanishNoPacket")).getManager().isVanished(player);
}