本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
示例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));*/
}
// });
}
示例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);*/
}
//});
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例11: showPlayer
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@Override
public void showPlayer(Plugin plugin, Player player) {
player.showPlayer(plugin, player);
}