Package com.flansmod.common.network

Examples of com.flansmod.common.network.PacketTeamInfo$TeamData


  public static final ResourceLocation texture2 = new ResourceLocation("flansmod", "gui/teamsScores2.png");
 
  @Override
  public void drawScreen(int i, int j, float f)
  {
    PacketTeamInfo teamInfo = FlansModClient.teamInfo;
    if(teamInfo == null || teamInfo.gametype == null || teamInfo.gametype.equals("") || teamInfo.teamData == null || teamInfo.teamData.length < 1)
    {
      mc.displayGuiScreen(null);
      return;
    }
View Full Code Here


            }
          }
        }
      }
     
      PacketTeamInfo teamInfo = FlansModClient.teamInfo;
     
      if(teamInfo != null && FlansModClient.minecraft.thePlayer != null && (teamInfo.numTeams > 0 || !teamInfo.sortedByTeam) && teamInfo.getPlayerScoreData(FlansModClient.minecraft.thePlayer.getCommandSenderName()) != null)
      {
        GL11.glEnable(3042 /* GL_BLEND */);
        GL11.glDisable(2929 /* GL_DEPTH_TEST */);
        GL11.glDepthMask(false);
        GL11.glBlendFunc(770, 771);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(3008 /* GL_ALPHA_TEST */);
 
        mc.renderEngine.bindTexture(GuiTeamScores.texture);
               
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(i / 2 - 43, 27, -90D, 85D / 256D, 27D / 256D);
        tessellator.addVertexWithUV(i / 2 + 43, 27, -90D, 171D / 256D, 27D / 256D);
        tessellator.addVertexWithUV(i / 2 + 43, 0D, -90D, 171D / 256D, 0D / 256D);
        tessellator.addVertexWithUV(i / 2 - 43, 0D, -90D, 85D / 256D, 0D / 256D);
        tessellator.draw();
       
        //If we are in a two team gametype, draw the team scores at the top of the screen
        if(teamInfo.numTeams == 2 && teamInfo.sortedByTeam)
        {
          //Draw team 1 colour bit
          int colour = teamInfo.teamData[0].team.teamColour; 
          GL11.glColor4f(((colour >> 16) & 0xff) / 256F, ((colour >> 8) & 0xff) / 256F, (colour & 0xff) / 256F, 1.0F);
          tessellator.startDrawingQuads();
          tessellator.addVertexWithUV(i / 2 - 43, 27, -90D, 0D / 256D, 125D / 256D);
          tessellator.addVertexWithUV(i / 2 - 19, 27, -90D, 24D / 256D, 125D / 256D);
          tessellator.addVertexWithUV(i / 2 - 19, 0D, -90D, 24D / 256D, 98D / 256D);
          tessellator.addVertexWithUV(i / 2 - 43, 0D, -90D, 0D / 256D, 98D / 256D);
          tessellator.draw();
          //Draw team 2 colour bit
          colour = teamInfo.teamData[1].team.teamColour; 
          GL11.glColor4f(((colour >> 16) & 0xff) / 256F, ((colour >> 8) & 0xff) / 256F, (colour & 0xff) / 256F, 1.0F);
          tessellator.startDrawingQuads();
          tessellator.addVertexWithUV(i / 2 + 19, 27, -90D, 62D / 256D, 125D / 256D);
          tessellator.addVertexWithUV(i / 2 + 43, 27, -90D, 86D / 256D, 125D / 256D);
          tessellator.addVertexWithUV(i / 2 + 43, 0D, -90D, 86D / 256D, 98D / 256D);
          tessellator.addVertexWithUV(i / 2 + 19, 0D, -90D, 62D / 256D, 98D / 256D);
          tessellator.draw();
         
          GL11.glDepthMask(true);
          GL11.glEnable(2929 /* GL_DEPTH_TEST */);
          GL11.glEnable(3008 /* GL_ALPHA_TEST */);
          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
         
          //Draw the team scores
          mc.fontRenderer.drawString(teamInfo.teamData[0].score + "", i / 2 - 35, 9, 0x000000);
          mc.fontRenderer.drawString(teamInfo.teamData[0].score + "", i / 2 - 36, 8, 0xffffff);
          mc.fontRenderer.drawString(teamInfo.teamData[1].score + "", i / 2 + 35 - mc.fontRenderer.getStringWidth(teamInfo.teamData[1].score + ""), 9, 0x000000);
          mc.fontRenderer.drawString(teamInfo.teamData[1].score + "", i / 2 + 34 - mc.fontRenderer.getStringWidth(teamInfo.teamData[1].score + ""), 8, 0xffffff);
        }
       
        mc.fontRenderer.drawString(teamInfo.gametype + "", i / 2 + 48, 9, 0x000000);
        mc.fontRenderer.drawString(teamInfo.gametype + "", i / 2 + 47, 8, 0xffffff);
        mc.fontRenderer.drawString(teamInfo.map + "", i / 2 - 47 - mc.fontRenderer.getStringWidth(teamInfo.map + ""), 9, 0x000000);
        mc.fontRenderer.drawString(teamInfo.map + "", i / 2 - 48 - mc.fontRenderer.getStringWidth(teamInfo.map + ""), 8, 0xffffff);
       
        int secondsLeft = teamInfo.timeLeft / 20;
        int minutesLeft = secondsLeft / 60;
        secondsLeft = secondsLeft % 60;
        String timeLeft = minutesLeft + ":" + (secondsLeft < 10 ? "0" + secondsLeft : secondsLeft);
        mc.fontRenderer.drawString(timeLeft, i / 2 - mc.fontRenderer.getStringWidth(timeLeft) / 2 - 1, 29, 0x000000);
        mc.fontRenderer.drawString(timeLeft, i / 2 - mc.fontRenderer.getStringWidth(timeLeft) / 2, 30, 0xffffff);
 
       
        GL11.glDepthMask(true);
        GL11.glEnable(2929 /* GL_DEPTH_TEST */);
        GL11.glEnable(3008 /* GL_ALPHA_TEST */);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        String playerUsername = FlansModClient.minecraft.thePlayer.getCommandSenderName();
       
        mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).score + "", i / 2 - 7, 1, 0x000000);
        mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).kills + "", i / 2 - 7, 9, 0x000000);
        mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).deaths + "", i / 2 - 7, 17, 0x000000);
      }
      for(int n = 0; n < killMessages.size(); n++)
      {
        KillMessage killMessage = killMessages.get(n);
        mc.fontRenderer.drawString("\u00a7" + killMessage.killerName + "     " + "\u00a7" + killMessage.killedName, i - mc.fontRenderer.getStringWidth(killMessage.killerName + "     " + killMessage.killedName) - 6, j - 32 - killMessage.line * 16, 0xffffff);
View Full Code Here

  public void tick()
  {
    //Send a full team info update to players every 2 seconds.
    if(time % 40 == 0)
    {
      FlansMod.INSTANCE.getPacketHandler().sendToAll(new PacketTeamInfo());
      showTeamsMenuToAll(true);
    }
   
    if(!enabled)
      return;
View Full Code Here

TOP

Related Classes of com.flansmod.common.network.PacketTeamInfo$TeamData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.