当前位置: 首页>>代码示例>>Java>>正文


Java VanishPlugin类代码示例

本文整理汇总了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();
}
 
开发者ID:DSH105,项目名称:SparkTrail,代码行数:26,代码来源:Effect.java

示例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));
        }
    }
}
 
开发者ID:disturbedfood,项目名称:PercentSleep,代码行数:37,代码来源:PercentSleep.java

示例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;
	}
}
 
开发者ID:TealNerd,项目名称:RadarJammer,代码行数:11,代码来源:CompatManager.java

示例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;
}
 
开发者ID:EquestriaCubed,项目名称:MCProfiler,代码行数:21,代码来源:VanishController.java

示例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()));

}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:13,代码来源:PlayerManager.java

示例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;
}
 
开发者ID:DSH105,项目名称:SparkTrail,代码行数:8,代码来源:PluginHook.java

示例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);
}
 
开发者ID:KovuTheHusky,项目名称:FixChat,代码行数:31,代码来源:FixChat.java

示例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();
    }
}
 
开发者ID:iso2013,项目名称:MultiLineAPI,代码行数:7,代码来源:VisibilityUtil.java

示例9: isVanished

import org.kitteh.vanish.VanishPlugin; //导入依赖的package包/类
public boolean isVanished(Player player) {
    return ((VanishPlugin) Bukkit.getPluginManager().getPlugin("VanishNoPacket")).getManager().isVanished(player);
}
 
开发者ID:lucko,项目名称:ConditionalPerms,代码行数:4,代码来源:VanishNoPacketHook.java


注:本文中的org.kitteh.vanish.VanishPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。