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


Java Player.showPlayer方法代码示例

本文整理汇总了Java中org.bukkit.entity.Player.showPlayer方法的典型用法代码示例。如果您正苦于以下问题:Java Player.showPlayer方法的具体用法?Java Player.showPlayer怎么用?Java Player.showPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.entity.Player的用法示例。


在下文中一共展示了Player.showPlayer方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stop

import org.bukkit.entity.Player; //导入方法依赖的package包/类
/**
 * Stops the tutorial for the given player.
 *
 * @param id The UUID of the player.
 * @param interrupted {@code true} if the tutorial is stopped because it was interrupted
 *                    using {@link #stopForAll(String)}, {@link #stop(UUID)} or if the
 *                    user disconnected.
 */
void stop(UUID id, final Boolean interrupted) // package-private
{
	if (!isWatchingTutorial(id)) return;

	Player player = p.getServer().getPlayer(id);

	if (player != null)
	{
		// The player can now move.
		player.setFlySpeed(0.1f);
		player.setFlying(false);
		player.setAllowFlight(false);

		// All other players are displayed
		for (Player other : p.getServer().getOnlinePlayers())
		{
			player.showPlayer(other);
			other.showPlayer(player);
		}

		player.resetPlayerTime();
	}

	try
	{
		viewers.get(id).cancel();
	}
	catch (IllegalStateException ignored) {}

	viewers.remove(id);

	onTutorialEnds(player, interrupted);
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:42,代码来源:Tutorial.java

示例2: refreshVisibility

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void refreshVisibility() {
    final Player bukkit = getBukkit();
    bukkit.showInvisibles(isObserving());

    for(MatchPlayer other : match.getPlayers()) {
        if(canSee(other)) {
            bukkit.showPlayer(other.getBukkit());
        } else {
            bukkit.hidePlayer(other.getBukkit());
        }

        if(other.canSee(this)) {
            other.getBukkit().showPlayer(bukkit);
        } else {
            other.getBukkit().hidePlayer(bukkit);
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:19,代码来源:MatchPlayer.java

示例3: finish

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void finish(Player player, boolean message) {
	if(!player.isOnline())
		return;
	if(message) {
		player.sendMessage(Lang.HEADERS_TOKENS.toString() + Lang.TOKENS_RUNE_EXPIRE.toString()
				.replaceAll("%s", getActiveRune(player).getName()));
	}
	
	if(getActiveRune(player).getName().equals("Invisibility")) {
		for(Player p : Bukkit.getOnlinePlayers()) {
			p.showPlayer(player);
		}
		removeInvisiblePlayer(player);
	}
	
	Cooldowns.setCooldown(player, "rune", 15000);
	removeActiveRune(player);
	removeEffect(player);
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:20,代码来源:RuneManager.java

示例4: sendAllToPlayer

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void sendAllToPlayer(Player current)
{
    if (current == null)
        return;
    //final EntityPlayer currentNMS = ((CraftPlayer) current).getHandle();
   // Bukkit.getScheduler().runTaskAsynchronously(pluginAPI, () -> {

        for (Player player : Bukkit.getOnlinePlayers()) {
            if (player == null || current.getName().equals(player.getName()))
                continue;

            current.hidePlayer(player);
            //TODO show if not moderator
            current.showPlayer(player);

            /*
            EntityPlayer entity = ((CraftPlayer) player).getHandle();
            if (entity == null || currentNMS == null || currentNMS.playerConnection == null)
                continue;
            currentNMS.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));*/
        }
   // });
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:24,代码来源:InvisiblePlayerFixListener.java

示例5: sendPlayerToAll

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void sendPlayerToAll(Player current)
{
    if (current == null)
        return;
   // final EntityPlayer currentNMS = ((CraftPlayer) current).getHandle();
   // Bukkit.getScheduler().runTaskAsynchronously(pluginAPI, () -> {
        //PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, currentNMS);

        for (Player p : Bukkit.getOnlinePlayers()) {
            if (p == null || current.getName().equals(p.getName()))
                continue;

            p.hidePlayer(current);
            p.showPlayer(current);
            /*EntityPlayer entity = ((CraftPlayer) p).getHandle();
            if (entity == null|| currentNMS == null || entity.playerConnection == null)
                continue;
            entity.playerConnection.sendPacket(packet);*/
        }
    //});
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:22,代码来源:InvisiblePlayerFixListener.java

示例6: removeStealth

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public static void removeStealth(Player p) {
    Spell.notify(p, "You are no longer stealthed.");
    invis.remove(p);
    for(Player p2 : plugin.getServer().getOnlinePlayers())
        p2.showPlayer(p);
    p.removePotionEffect(PotionEffectType.INVISIBILITY);
    RParticles.showWithOffset(ParticleEffect.CLOUD, p.getLocation().add(0, p.getEyeHeight() * 0.7, 0), 1.0, 15);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:9,代码来源:StealthManager.java

示例7: sendNPC

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void sendNPC(Player p, CustomNPC npc)
{
    Reflection.sendPacket(p, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, npc));

    p.hidePlayer(npc.getBukkitEntity());
    p.showPlayer(npc.getBukkitEntity());

    this.api.getPlugin().getServer().getScheduler().runTaskLater(this.api.getPlugin(), () ->
    {
        Reflection.sendPacket(p, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc));
    }, 60L);
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:13,代码来源:NPCManager.java

示例8: setCloak

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public static void setCloak(Player player, boolean state) {
	setCloakState(player, state);
	for (Player ps : Bukkit.getOnlinePlayers()) {
		if (isCloaked(player)) {
			ps.hidePlayer(player);
		} else {
			ps.showPlayer(player);
		}
	}
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:11,代码来源:ConfigTranslater.java

示例9: removeSpectator

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public static void removeSpectator(Player player) {
    player.setFoodLevel(20);
    player.setLevel(0);
    player.setGameMode(GameMode.SURVIVAL);
    player.setAllowFlight(false);
    player.setExp(0);
    player.setHealthScale(20);
    player.setHealth(20);
    player.setTotalExperience(0);
    player.setCanPickupItems(false);
    for (PotionEffect eff : player.getActivePotionEffects()) {
        player.removePotionEffect(eff.getType());
    }

    if (PREFIXES.containsKey(player.getName())) {
        player.setCustomName(player.getDisplayName().replace(PREFIXES.get(player.getName()), ""));
        player.setPlayerListName(player.getDisplayName().replace(PREFIXES.get(player.getName()), ""));
        player.setDisplayName(player.getDisplayName().replace(PREFIXES.get(player.getName()), ""));
        player.setCustomNameVisible(true);
    }

    for (Player p : Bukkit.getOnlinePlayers()) {
        p.showPlayer(player);
    }

    PlayerUtil.removeDeadPlayer(player);
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:28,代码来源:Spectator.java

示例10: showPlayer

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public static void showPlayer(Player p) {
	for (Player player : Bukkit.getOnlinePlayers()) {
		p.showPlayer(player);
	}
	
	PVPlayer.add(p);
}
 
开发者ID:DianoxDragon,项目名称:UltimateSpawn,代码行数:8,代码来源:PlayerVisibility.java

示例11: showPlayer

import org.bukkit.entity.Player; //导入方法依赖的package包/类
@Override
public void showPlayer(Plugin plugin, Player player) {
    player.showPlayer(plugin, player);
}
 
开发者ID:CyR1en,项目名称:Minecordbot,代码行数:5,代码来源:DiscordPlayerCommandSender.java


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