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


Java GuiPlayerInfo类代码示例

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


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

示例1: onlineInList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
public static ArrayList<String> onlineInList(ArrayList<String> playersToFind) {
	ArrayList<String> returnPlayers = new ArrayList<String>();
	List<GuiPlayerInfo> onlinePlayers = mc.thePlayer.sendQueue.playerInfoList;
	
	// Cycle through every player that's online.
	for (GuiPlayerInfo player : onlinePlayers) {
		String playerName = player.name.replaceAll("\u00A7.", "");
		
		// Cycle through all the players in the specified list (friends).
		for (String friend : playersToFind) {
			
			// Use startsWith because names are sometimes cut off in tab.
			if (friend.startsWith(playerName)) {
				
				// Add the whole friend's name instead of the potentiall cut-off version.
				returnPlayers.add(friend);
			}
		}
	}
	return returnPlayers;
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:22,代码来源:FriendsList.java

示例2: getColorPrefix

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
public static String getColorPrefix(String playerName) {
	
	// Cycle through each online player.
	for (GuiPlayerInfo player : getPlayersGui()) {
		
		if (player.name.startsWith("\u00A7")) {
			String realName = player.name.replaceAll("\u00A7.(.*)", "$1");

			if (playerName.startsWith(realName))
				return player.name.replaceAll("\u00A7(.).*", "$1");
		}

		if (player.name.endsWith(playerName) && player.name.startsWith("\u00A7")) {
			return player.name.replaceAll("\u00A7(.).*", "$1");
		}
	}
	return " ";
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:19,代码来源:ServerHelper.java

示例3: isOnline

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
protected boolean isOnline(String user)
{
	if (Minecraft.getMinecraft().getNetHandler() == null || Minecraft.getMinecraft().getNetHandler().playerInfoList == null) return false;
	Iterator iter = Minecraft.getMinecraft().getNetHandler().playerInfoList.iterator();
	while (iter.hasNext())
	{
		if (user.equals(((GuiPlayerInfo)iter.next()).name)) return true;
	}
	return false;
}
 
开发者ID:rodolphito,项目名称:Rival-Rebels-Mod,代码行数:11,代码来源:GuiSpawn.java

示例4: getTeamsLeft

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
public static int getTeamsLeft() {
	ArrayList<String> found = new ArrayList<String>();
	for (GuiPlayerInfo info : ServerHelper.getPlayersGui()) {
		String prefix = ServerHelper.getColorPrefix(info.name);
		if (AllTeam.getTeamFromColor(prefix.charAt(0)) == AllTeam.NONE 
				|| AllTeam.getTeamFromColor(prefix.charAt(0)) == AllTeam.GRAY)
			continue;
		if (!found.contains(ServerHelper.getColorPrefix(info.name))) {
			found.add(ServerHelper.getColorPrefix(info.name));
		}
	}
	return found.size();
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:14,代码来源:InfoMaze.java

示例5: onlineInListOnTeam

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
public static ArrayList<String> onlineInListOnTeam(ArrayList checkPlayers, TeamCTF team) {
	ArrayList<String> returnPlayers = new ArrayList<String>();
	List<GuiPlayerInfo> onlinePlayers = mc.thePlayer.sendQueue.playerInfoList;
	
	for (GuiPlayerInfo player : onlinePlayers) {
		String playerName = player.name.replaceAll("\u00A7.", "");
		if (checkPlayers.contains(playerName) && TeamCTF.getTeam(playerName).equals(team)) {
			returnPlayers.add(playerName);
		}
	}
	return returnPlayers;
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:13,代码来源:FriendsList.java

示例6: getPlayers

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
/**
 * @return A list of all player's as EntityPlayers. The list of players
 * is identical to what is showing in tab.
 */
public static List<EntityPlayer> getPlayers() {
	List<EntityPlayer> players = new ArrayList<EntityPlayer>();
	for (GuiPlayerInfo player : getPlayersGui()) {
		players.add(Main.mc.theWorld.getPlayerEntityByName(player.name));
	}
	return players;
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:12,代码来源:ServerHelper.java

示例7: renderPlayerList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void renderPlayerList(int width, int height)
{
    ScoreObjective scoreobjective = this.field_73839_d.field_71441_e.func_96441_U().func_96539_a(0);
    NetHandlerPlayClient handler = field_73839_d.field_71439_g.field_71174_a;

    if (field_73839_d.field_71474_y.field_74321_H.func_151470_d() && (!field_73839_d.func_71387_A() || handler.field_147303_b.size() > 1 || scoreobjective != null))
    {
        if (pre(PLAYER_LIST)) return;
        this.field_73839_d.field_71424_I.func_76320_a("playerList");
        List<GuiPlayerInfo> players = (List<GuiPlayerInfo>)handler.field_147303_b;
        int maxPlayers = handler.field_147304_c;
        int rows = maxPlayers;
        int columns = 1;

        for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns)
        {
            columns++;
        }

        int columnWidth = 300 / columns;

        if (columnWidth > 150)
        {
            columnWidth = 150;
        }

        int left = (width - columns * columnWidth) / 2;
        byte border = 10;
        func_73734_a(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

        for (int i = 0; i < maxPlayers; i++)
        {
            int xPos = left + i % columns * columnWidth;
            int yPos = border + i / columns * 9;
            func_73734_a(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_ALPHA_TEST);

            if (i < players.size())
            {
                GuiPlayerInfo player = (GuiPlayerInfo)players.get(i);
                ScorePlayerTeam team = field_73839_d.field_71441_e.func_96441_U().func_96509_i(player.field_78831_a);
                String displayName = ScorePlayerTeam.func_96667_a(team, player.field_78831_a);
                fontrenderer.func_78261_a(displayName, xPos, yPos, 16777215);

                if (scoreobjective != null)
                {
                    int endX = xPos + fontrenderer.func_78256_a(displayName) + 5;
                    int maxX = xPos + columnWidth - 12 - 5;

                    if (maxX - endX > 5)
                    {
                        Score score = scoreobjective.func_96682_a().func_96529_a(player.field_78831_a, scoreobjective);
                        String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.func_96652_c();
                        fontrenderer.func_78261_a(scoreDisplay, maxX - fontrenderer.func_78256_a(scoreDisplay), yPos, 16777215);
                    }
                }

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                field_73839_d.func_110434_K().func_110577_a(Gui.field_110324_m);
                int pingIndex = 4;
                int ping = player.field_78829_b;
                if (ping < 0) pingIndex = 5;
                else if (ping < 150) pingIndex = 0;
                else if (ping < 300) pingIndex = 1;
                else if (ping < 600) pingIndex = 2;
                else if (ping < 1000) pingIndex = 3;

                field_73735_i += 100.0F;
                func_73729_b(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                field_73735_i -= 100.0F;
            }
        }
        post(PLAYER_LIST);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:79,代码来源:GuiIngameForge.java

示例8: renderPlayerList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void renderPlayerList(int width, int height)
{
    ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0);
    NetHandlerPlayClient handler = mc.thePlayer.sendQueue;

    if (mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null))
    {
        if (pre(PLAYER_LIST)) return;
        this.mc.mcProfiler.startSection("playerList");
        List<GuiPlayerInfo> players = (List<GuiPlayerInfo>)handler.playerInfoList;
        int maxPlayers = handler.currentServerMaxPlayers;
        int rows = maxPlayers;
        int columns = 1;

        for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns)
        {
            columns++;
        }

        int columnWidth = 300 / columns;

        if (columnWidth > 150)
        {
            columnWidth = 150;
        }

        int left = (width - columns * columnWidth) / 2;
        byte border = 10;
        drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

        for (int i = 0; i < maxPlayers; i++)
        {
            int xPos = left + i % columns * columnWidth;
            int yPos = border + i / columns * 9;
            drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_ALPHA_TEST);

            if (i < players.size())
            {
                GuiPlayerInfo player = (GuiPlayerInfo)players.get(i);
                ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name);
                String displayName = ScorePlayerTeam.formatPlayerName(team, player.name);
                fontrenderer.drawStringWithShadow(displayName, xPos, yPos, 16777215);

                if (scoreobjective != null)
                {
                    int endX = xPos + fontrenderer.getStringWidth(displayName) + 5;
                    int maxX = xPos + columnWidth - 12 - 5;

                    if (maxX - endX > 5)
                    {
                        Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective);
                        String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints();
                        fontrenderer.drawStringWithShadow(scoreDisplay, maxX - fontrenderer.getStringWidth(scoreDisplay), yPos, 16777215);
                    }
                }

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                mc.getTextureManager().bindTexture(Gui.icons);
                int pingIndex = 4;
                int ping = player.responseTime;
                if (ping < 0) pingIndex = 5;
                else if (ping < 150) pingIndex = 0;
                else if (ping < 300) pingIndex = 1;
                else if (ping < 600) pingIndex = 2;
                else if (ping < 1000) pingIndex = 3;

                zLevel += 100.0F;
                drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                zLevel -= 100.0F;
            }
        }
        post(PLAYER_LIST);
    }
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:79,代码来源:GuiIngameForge.java

示例9: getPlayersGui

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
/**
 * @return A list of all player's GuiInfo. The list of players
 * is identical to what is showing in tab.
 */
public static List<GuiPlayerInfo> getPlayersGui() {
	if (Main.mc.thePlayer == null) return new ArrayList<GuiPlayerInfo>();
	return Main.mc.thePlayer.sendQueue.playerInfoList;
}
 
开发者ID:NomNuggetNom,项目名称:mcpvp-mod,代码行数:9,代码来源:ServerHelper.java

示例10: renderPlayerList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
protected void renderPlayerList(int width, int height)
{
    ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0);
    NetClientHandler handler = mc.thePlayer.sendQueue;

    if (mc.gameSettings.keyBindPlayerList.pressed && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null))
    {
        if (pre(PLAYER_LIST)) return;
        this.mc.mcProfiler.startSection("playerList");
        List players = handler.playerInfoList;
        int maxPlayers = handler.currentServerMaxPlayers;
        int rows = maxPlayers;
        int columns = 1;

        for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns)
        {
            columns++;
        }

        int columnWidth = 300 / columns;

        if (columnWidth > 150)
        {
            columnWidth = 150;
        }

        int left = (width - columns * columnWidth) / 2;
        byte border = 10;
        drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

        for (int i = 0; i < maxPlayers; i++)
        {
            int xPos = left + i % columns * columnWidth;
            int yPos = border + i / columns * 9;
            drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_ALPHA_TEST);

            if (i < players.size())
            {
                GuiPlayerInfo player = (GuiPlayerInfo)players.get(i);
                ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name);
                String displayName = ScorePlayerTeam.formatPlayerName(team, player.name);
                fontrenderer.drawStringWithShadow(displayName, xPos, yPos, 16777215);

                if (scoreobjective != null)
                {
                    int endX = xPos + fontrenderer.getStringWidth(displayName) + 5;
                    int maxX = xPos + columnWidth - 12 - 5;

                    if (maxX - endX > 5)
                    {
                        Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective);
                        String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints();
                        fontrenderer.drawStringWithShadow(scoreDisplay, maxX - fontrenderer.getStringWidth(scoreDisplay), yPos, 16777215);
                    }
                }

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                mc.getTextureManager().bindTexture(Gui.icons);
                int pingIndex = 4;
                int ping = player.responseTime;
                if (ping < 0) pingIndex = 5;
                else if (ping < 150) pingIndex = 0;
                else if (ping < 300) pingIndex = 1;
                else if (ping < 600) pingIndex = 2;
                else if (ping < 1000) pingIndex = 3;

                zLevel += 100.0F;
                drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                zLevel -= 100.0F;
            }
        }
        post(PLAYER_LIST);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:78,代码来源:GuiIngameForge.java

示例11: renderPlayerList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
@Override
   @SuppressWarnings("rawtypes")
protected void renderPlayerList(int width, int height) {
       ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0);
       NetClientHandler handler = mc.thePlayer.sendQueue;

       if (mc.gameSettings.keyBindPlayerList.pressed && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null)) {
           this.mc.mcProfiler.startSection("playerList");
           List players = handler.playerInfoList;
           int maxPlayers = handler.currentServerMaxPlayers;
           int rows = maxPlayers;
           int columns = 1;

           for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns) {
               columns++;
           }

           int columnWidth = 300 / columns;

           if (columnWidth > 150) {
               columnWidth = 150;
           }

           int left = (width - columns * columnWidth) / 2;
           byte border = 10;
           drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

           for (int i = 0; i < maxPlayers; i++) {
               int xPos = left + i % columns * columnWidth;
               int yPos = border + i / columns * 9;
               drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
               GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
               GL11.glEnable(GL11.GL_ALPHA_TEST);

               if (i < players.size()) {
                   GuiPlayerInfo player = (GuiPlayerInfo)players.get(i);
                   ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name);
                   String displayName = ScorePlayerTeam.formatPlayerName(team, player.name);
                   fontrenderer.drawStringWithShadow(displayName, xPos, yPos, 16777215);

                   if (scoreobjective != null) {
                       int endX = xPos + fontrenderer.getStringWidth(displayName) + 5;
                       int maxX = xPos + columnWidth - 12 - 5;

                       if (maxX - endX > 5) {
                           Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective);
                           String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints();
                           fontrenderer.drawStringWithShadow(scoreDisplay, maxX - fontrenderer.getStringWidth(scoreDisplay), yPos, 16777215);
                       }
                   }

                   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                   mc.func_110434_K().func_110577_a(Gui.field_110324_m);
                   int pingIndex = 4;
                   int ping = player.responseTime;
                   if (ping < 0) pingIndex = 5;
                   else if (ping < 150) pingIndex = 0;
                   else if (ping < 300) pingIndex = 1;
                   else if (ping < 600) pingIndex = 2;
                   else if (ping < 1000) pingIndex = 3;

                   zLevel += 100.0F;
                   drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                   zLevel -= 100.0F;
               }
           }
       }
   }
 
开发者ID:Aurilux,项目名称:HotbarPlus,代码行数:70,代码来源:HBPGui.java

示例12: render

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
@Override
public void render(Minecraft mc, ScaledResolution res, float partialTicks, HPHud hud) {
	super.render(mc, res, partialTicks, hud);
       ScoreObjective scoreobjective = mc.theWorld.getScoreboard().func_96539_a(0);
       NetClientHandler handler = mc.thePlayer.sendQueue;

       if (handler.playerInfoList.size() > 1 || scoreobjective != null) {
           @SuppressWarnings("rawtypes")
		List players = handler.playerInfoList;
           int maxPlayers = handler.currentServerMaxPlayers;
           int rows = maxPlayers;
           int columns = 1;

           for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns) {
               columns++;
           }

           int columnWidth = 300 / columns;

           if (columnWidth > 150) {
               columnWidth = 150;
           }

           int left = (width - columns * columnWidth) / 2;
           byte border = 10;
           Gui.drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

           for (int i = 0; i < maxPlayers; i++) {
               int xPos = left + i % columns * columnWidth;
               int yPos = border + i / columns * 9;
               Gui.drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
               GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
               GL11.glEnable(GL11.GL_ALPHA_TEST);

               if (i < players.size()) {
               	FontRenderer fr = hud.fontrenderer;
                   GuiPlayerInfo player = (GuiPlayerInfo)players.get(i);
                   ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name);
                   String displayName = ScorePlayerTeam.formatPlayerName(team, player.name);
                   fr.drawStringWithShadow(displayName, xPos, yPos, 16777215);

                   if (scoreobjective != null) {
                       int endX = xPos + fr.getStringWidth(displayName) + 5;
                       int maxX = xPos + columnWidth - 12 - 5;

                       if (maxX - endX > 5) {
                           Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective);
                           String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints();
                           fr.drawStringWithShadow(scoreDisplay, maxX - fr.getStringWidth(scoreDisplay), yPos, 16777215);
                       }
                   }

                   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                   mc.func_110434_K().func_110577_a(Gui.field_110324_m);
                   int pingIndex = 4;
                   int ping = player.responseTime;
                   if (ping < 0) pingIndex = 5;
                   else if (ping < 150) pingIndex = 0;
                   else if (ping < 300) pingIndex = 1;
                   else if (ping < 600) pingIndex = 2;
                   else if (ping < 1000) pingIndex = 3;

                   //hud.zLevel += 100.0F;
                   hud.drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                   //hud.zLevel -= 100.0F;
               }
           }
       }
}
 
开发者ID:Aurilux,项目名称:HudPlus,代码行数:71,代码来源:HPPlayerList.java

示例13: renderPlayerList

import net.minecraft.client.gui.GuiPlayerInfo; //导入依赖的package包/类
@Override
protected void renderPlayerList(int width, int height) {
    mc.mcProfiler.startSection("playerList");
    ScoreObjective scoreobjective = mc.theWorld.getScoreboard().func_96539_a(0);
    NetHandlerPlayClient handler = mc.thePlayer.sendQueue;

    if (mc.gameSettings.keyBindPlayerList.isPressed() && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null)) {
        List<?> players = handler.playerInfoList;
        int maxPlayers = handler.currentServerMaxPlayers;
        int rows = maxPlayers;
        int columns;

        for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns) {
            columns++;
        }

        int columnWidth = 300 / columns;

        if (columnWidth > 150) {
            columnWidth = 150;
        }

        int left = (width - columns * columnWidth) / 2;
        byte border = 10;
        drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE);

        for (int i = 0; i < maxPlayers; i++) {
            int xPos = left + i % columns * columnWidth;
            int yPos = border + i / columns * 9;
            drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glEnable(GL11.GL_ALPHA_TEST);

            if (i < players.size()) {
                GuiPlayerInfo player = (GuiPlayerInfo) players.get(i);
                ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name);
                String displayName = ScorePlayerTeam.formatPlayerName(team, player.name);
                mc.fontRenderer.drawStringWithShadow(displayName, xPos, yPos, 16777215);

                if (scoreobjective != null) {
                    int endX = xPos + mc.fontRenderer.getStringWidth(displayName) + 5;
                    int maxX = xPos + columnWidth - 12 - 5;

                    if (maxX - endX > 5) {
                        Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective);
                        String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints();
                        mc.fontRenderer.drawStringWithShadow(scoreDisplay, maxX - mc.fontRenderer.getStringWidth(scoreDisplay), yPos, 16777215);
                    }
                }

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                RenderAssist.bindTexture(Gui.icons);
                int pingIndex = 4;
                int ping = player.responseTime;
                if (ping < 0) {
                    pingIndex = 5;
                } else if (ping < 150) {
                    pingIndex = 0;
                } else if (ping < 300) {
                    pingIndex = 1;
                } else if (ping < 600) {
                    pingIndex = 2;
                } else if (ping < 1000) {
                    pingIndex = 3;
                }

                zLevel += 100.0F;
                drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8);
                zLevel -= 100.0F;
            }
        }
    }
    mc.mcProfiler.endSection();
}
 
开发者ID:maxpowa,项目名称:AdvancedHUD,代码行数:76,代码来源:GuiAdvancedHUD.java


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