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


Java NetworkPlayerInfo类代码示例

本文整理汇总了Java中net.minecraft.client.network.NetworkPlayerInfo的典型用法代码示例。如果您正苦于以下问题:Java NetworkPlayerInfo类的具体用法?Java NetworkPlayerInfo怎么用?Java NetworkPlayerInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: extract

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
private static boolean extract(String message, Pattern[] patterns, BiConsumer<GameProfile, String> callback) {
    for(Pattern pattern : patterns) {
        Matcher matcher = pattern.matcher(message);
        if (matcher.find()) {
            final String messageSender = matcher.group(1);
            final String messageOnly = matcher.group(2);
            if (!Strings.isNullOrEmpty(messageSender)) {
                for (NetworkPlayerInfo data : getLocalPlayer().connection.getPlayerInfoMap()) {
                    if (String.CASE_INSENSITIVE_ORDER.compare(messageSender, data.getGameProfile().getName()) == 0) {
                        callback.accept(data.getGameProfile(), messageOnly);
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:19,代码来源:ChatIdentifierService.java

示例2: TeamSelectionObject

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.field_178676_b = p_i45492_2_;
    this.field_178675_d = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.field_178675_d.add(networkplayerinfo);
        }
    }

    if (!this.field_178675_d.isEmpty())
    {
        String s1 = ((NetworkPlayerInfo)this.field_178675_d.get((new Random()).nextInt(this.field_178675_d.size()))).getGameProfile().getName();
        this.field_178677_c = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.field_178677_c, s1);
    }
    else
    {
        this.field_178677_c = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:TeleportToTeam.java

示例3: getLocationCape

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public ResourceLocation getLocationCape()
{
    if (!Config.isShowCapes())
    {
        return null;
    }
    else if (this.locationOfCape != null)
    {
        return this.locationOfCape;
    }
    else
    {
        NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
        return networkplayerinfo == null ? null : networkplayerinfo.getLocationCape();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:AbstractClientPlayer.java

示例4: getLocationCape

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public ResourceLocation getLocationCape()
{
    if (!Config.isShowCapes())
    {
        return null;
    }
    else if (this.ofLocationCape != null)
    {
        return this.ofLocationCape;
    }
    else
    {
        NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
        return networkplayerinfo == null ? null : networkplayerinfo.getLocationCape();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:AbstractClientPlayer.java

示例5: onRenderPlayer

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/special_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:SpecialPeopleCapeHandler.java

示例6: onRenderPlayer

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/dev_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:NekoCapeHandler.java

示例7: getPing

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public static int getPing() {
	if (isNull()) {
		return 0;
	}
	new Thread() {
		@Override
		public void run() {
			NetHandlerPlayClient nethandlerplayclient = Minecraft.getMinecraft().player.connection;
			List<NetworkPlayerInfo> list = GuiPlayerTabOverlay.ENTRY_ORDERING
					.<NetworkPlayerInfo>sortedCopy(nethandlerplayclient.getPlayerInfoMap());

			for (NetworkPlayerInfo networkplayerinfo : list) {
				String uuid = networkplayerinfo.getGameProfile().getId().toString();
				if (uuid.equals(Minecraft.getMinecraft().player.getUniqueID().toString())) {
					ping = networkplayerinfo.getResponseTime();
				}
			}
		}
	}.start();
	return ping;
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:22,代码来源:IEntityPlayer.java

示例8: getLocationCape

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@Nullable
public ResourceLocation getLocationCape()
{
    if (!Config.isShowCapes())
    {
        return null;
    }
    else if (this.locationOfCape != null)
    {
        return this.locationOfCape;
    }
    else
    {
        NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
        return networkplayerinfo == null ? null : networkplayerinfo.getLocationCape();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:AbstractClientPlayer.java

示例9: TeamSelectionObject

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public TeamSelectionObject(ScorePlayerTeam p_i45492_2_)
{
    this.team = p_i45492_2_;
    this.players = Lists.<NetworkPlayerInfo>newArrayList();

    for (String s : p_i45492_2_.getMembershipCollection())
    {
        NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getConnection().getPlayerInfo(s);

        if (networkplayerinfo != null)
        {
            this.players.add(networkplayerinfo);
        }
    }

    if (this.players.isEmpty())
    {
        this.location = DefaultPlayerSkin.getDefaultSkinLegacy();
    }
    else
    {
        String s1 = ((NetworkPlayerInfo)this.players.get((new Random()).nextInt(this.players.size()))).getGameProfile().getName();
        this.location = AbstractClientPlayer.getLocationSkin(s1);
        AbstractClientPlayer.getDownloadImageSkin(this.location, s1);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:TeleportToTeam.java

示例10: onPacketRecieved

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@SubscribeEvent
public void onPacketRecieved(PacketEvent.Incoming.Pre event) {
    if (event.getPacket() instanceof SPacketSpawnPlayer) {
        if (disconnectOnNewPlayer.getAsBoolean()) {
            AutoReconnectMod.hasAutoLogged = true; // dont automatically reconnect
            UUID id = ((SPacketSpawnPlayer) event.getPacket()).getUniqueId();

            NetworkPlayerInfo info = MC.getConnection().getPlayerInfo(id);
            String name = info != null ? info.getGameProfile().getName() : "(Failed) " + id.toString();

            getNetworkManager().closeChannel(new TextComponentString(name + " entered render distance"));
            disable();
        }
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:16,代码来源:AutoLog.java

示例11: getPlayerInfo

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
protected NetworkPlayerInfo getPlayerInfo()
{
    if (this.playerInfo == null)
    {
        this.playerInfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.getUniqueID());
    }

    return this.playerInfo;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:AbstractClientPlayer.java

示例12: TeleportToPlayer

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
public TeleportToPlayer(Collection<NetworkPlayerInfo> p_i45493_1_)
{
    this.field_178673_b = Lists.<ISpectatorMenuObject>newArrayList();

    for (NetworkPlayerInfo networkplayerinfo : field_178674_a.sortedCopy(p_i45493_1_))
    {
        if (networkplayerinfo.getGameType() != WorldSettings.GameType.SPECTATOR)
        {
            this.field_178673_b.add(new PlayerMenuObject(networkplayerinfo.getGameProfile()));
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:TeleportToPlayer.java

示例13: drawPing

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
protected void drawPing(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(icons);
    int i = 0;
    int j = 0;

    if (networkPlayerInfoIn.getResponseTime() < 0)
    {
        j = 5;
    }
    else if (networkPlayerInfoIn.getResponseTime() < 150)
    {
        j = 0;
    }
    else if (networkPlayerInfoIn.getResponseTime() < 300)
    {
        j = 1;
    }
    else if (networkPlayerInfoIn.getResponseTime() < 600)
    {
        j = 2;
    }
    else if (networkPlayerInfoIn.getResponseTime() < 1000)
    {
        j = 3;
    }
    else
    {
        j = 4;
    }

    this.zLevel += 100.0F;
    this.drawTexturedModalRect(p_175245_2_ + p_175245_1_ - 11, p_175245_3_, 0 + i * 10, 176 + j * 8, 10, 8);
    this.zLevel -= 100.0F;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:GuiPlayerTabOverlay.java

示例14: onEnable

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@Override
public void onEnable()
{
	index = 0;
	timer = -1;
	players.clear();
	
	for(NetworkPlayerInfo info : WMinecraft.getConnection()
		.getPlayerInfoMap())
	{
		String name = info.getPlayerNameForReal();
		name = StringUtils.stripControlCodes(name);
		
		if(name.equals(WMinecraft.getPlayer().getName()))
			continue;
		
		players.add(name);
	}
	Collections.shuffle(players, random);
	
	wurst.events.add(ChatInputListener.class, this);
	wurst.events.add(UpdateListener.class, this);
	
	if(players.isEmpty())
	{
		ChatUtils.error("Couldn't find any players.");
		setEnabled(false);
	}
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:30,代码来源:MassTpaMod.java

示例15: getPlayerInfo

import net.minecraft.client.network.NetworkPlayerInfo; //导入依赖的package包/类
@Nullable
protected NetworkPlayerInfo getPlayerInfo() {
  if (this.playerInfo == null) {
    this.playerInfo = Minecraft.getMinecraft().getConnection().getPlayerInfo(this.getUniqueID());
  }

  return this.playerInfo;
}
 
开发者ID:halfpetal,项目名称:CapesAPI-ClientImplementation,代码行数:9,代码来源:AbstractClientPlayer.java


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