Beispiel #1
0
  public void func_175180_a(float p_175180_1_) {
    ScaledResolution var2 =
        new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
    int var3 = var2.getScaledWidth();
    int var4 = var2.getScaledHeight();
    this.mc.entityRenderer.setupOverlayRendering();
    GlStateManager.enableBlend();

    if (Minecraft.isFancyGraphicsEnabled()) {
      this.func_180480_a(this.mc.thePlayer.getBrightness(p_175180_1_), var2);
    } else {
      GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    }

    ItemStack var5 = this.mc.thePlayer.inventory.armorItemInSlot(3);

    if (this.mc.gameSettings.thirdPersonView == 0
        && var5 != null
        && var5.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) {
      this.func_180476_e(var2);
    }

    if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) {
      float var6 =
          this.mc.thePlayer.prevTimeInPortal
              + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * p_175180_1_;

      if (var6 > 0.0F) {
        this.func_180474_b(var6, var2);
      }
    }

    if (this.mc.playerController.enableEverythingIsScrewedUpMode()) {
      this.field_175197_u.func_175264_a(var2, p_175180_1_);
    } else {
      this.func_180479_a(var2, p_175180_1_);
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(icons);
    GlStateManager.enableBlend();

    if (this.func_175183_b()) {
      GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0);
      GlStateManager.enableAlpha();
      this.drawTexturedModalRect(var3 / 2 - 7, var4 / 2 - 7, 0, 0, 16, 16);
    }

    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    this.mc.mcProfiler.startSection("bossHealth");
    this.renderBossHealth();
    this.mc.mcProfiler.endSection();

    if (this.mc.playerController.shouldDrawHUD()) {
      this.func_180477_d(var2);
    }

    GlStateManager.disableBlend();
    float var7;
    int var8;
    int var11;

    // TODO t
    InstanceMain.getGuiManager().renderPinned();
    // TODO t
    drawRadar();

    if (this.mc.thePlayer.getSleepTimer() > 0) {
      this.mc.mcProfiler.startSection("sleep");
      GlStateManager.disableDepth();
      GlStateManager.disableAlpha();
      var11 = this.mc.thePlayer.getSleepTimer();
      var7 = (float) var11 / 100.0F;

      if (var7 > 1.0F) {
        var7 = 1.0F - (float) (var11 - 100) / 10.0F;
      }

      var8 = (int) (220.0F * var7) << 24 | 1052704;
      drawRect(0, 0, var3, var4, var8);
      GlStateManager.enableAlpha();
      GlStateManager.enableDepth();
      this.mc.mcProfiler.endSection();
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    var11 = var3 / 2 - 91;

    if (this.mc.thePlayer.isRidingHorse()) {
      this.func_175186_a(var2, var11);
    } else if (this.mc.playerController.gameIsSurvivalOrAdventure()) {
      this.func_175176_b(var2, var11);
    }

    if (this.mc.gameSettings.heldItemTooltips
        && !this.mc.playerController.enableEverythingIsScrewedUpMode()) {
      this.func_175182_a(var2);
    } else if (this.mc.thePlayer.func_175149_v()) {
      this.field_175197_u.func_175263_a(var2);
    }

    if (this.mc.isDemo()) {
      this.func_175185_b(var2);
    }

    if (this.mc.gameSettings.showDebugInfo) {
      this.overlayDebug.func_175237_a(var2);
    }

    // Note: debug screen stuff has been moved to function above ^

    // TODO t
    if (checkKeyState(Keyboard.KEY_U)) {
      Minecraft.getMinecraft().m.getRender().cmdTab =
          !Minecraft.getMinecraft().m.getRender().cmdTab;
      Minecraft.getMinecraft().m.getRender().rendercmdTextbox();
    } else if (checkKeyState(Keyboard.KEY_Y)) {
      InstanceMain.getRender().ingamegui = !InstanceMain.getRender().ingamegui;
      Minecraft.getMinecraft().m.getRender().renderIngameGui();
    } else if (checkKeyState(Keyboard.KEY_X)) {
      if (InstanceMain.containsMod("xray")) {
        InstanceMain.getMod("xray").execute();
      }
    }
    for (String mod_ : KeyBinds.binds.keySet()) {
      if (checkKeyState(KeyBinds.binds.get(mod_))) {
        if (InstanceMain.getMod(mod_).getNeedUpdate()) {
          InstanceMain.getMod(mod_).execute(true);
        } else {
          InstanceMain.getMod(mod_).execute();
        }
      }
    }

    int var9;

    if (this.recordPlayingUpFor > 0) {
      this.mc.mcProfiler.startSection("overlayMessage");
      var7 = (float) this.recordPlayingUpFor - p_175180_1_;
      var8 = (int) (var7 * 255.0F / 20.0F);

      if (var8 > 255) {
        var8 = 255;
      }

      if (var8 > 8) {
        GlStateManager.pushMatrix();
        GlStateManager.translate((float) (var3 / 2), (float) (var4 - 68), 0.0F);
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        var9 = 16777215;

        if (this.recordIsPlaying) {
          var9 = Color.HSBtoRGB(var7 / 50.0F, 0.7F, 0.6F) & 16777215;
        }

        this.func_175179_f()
            .drawString(
                this.recordPlaying,
                -this.func_175179_f().getStringWidth(this.recordPlaying) / 2,
                -4,
                var9 + (var8 << 24 & -16777216));
        GlStateManager.disableBlend();
        GlStateManager.popMatrix();
      }

      this.mc.mcProfiler.endSection();
    }

    if (this.field_175195_w > 0) {
      this.mc.mcProfiler.startSection("titleAndSubtitle");
      var7 = (float) this.field_175195_w - p_175180_1_;
      var8 = 255;

      if (this.field_175195_w > this.field_175193_B + this.field_175192_A) {
        float var14 =
            (float) (this.field_175199_z + this.field_175192_A + this.field_175193_B) - var7;
        var8 = (int) (var14 * 255.0F / (float) this.field_175199_z);
      }

      if (this.field_175195_w <= this.field_175193_B) {
        var8 = (int) (var7 * 255.0F / (float) this.field_175193_B);
      }

      var8 = MathHelper.clamp_int(var8, 0, 255);

      if (var8 > 8) {
        GlStateManager.pushMatrix();
        GlStateManager.translate((float) (var3 / 2), (float) (var4 / 2), 0.0F);
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        GlStateManager.pushMatrix();
        GlStateManager.scale(4.0F, 4.0F, 4.0F);
        var9 = var8 << 24 & -16777216;
        this.func_175179_f()
            .func_175065_a(
                this.field_175201_x,
                (float) (-this.func_175179_f().getStringWidth(this.field_175201_x) / 2),
                -10.0F,
                16777215 | var9,
                true);
        GlStateManager.popMatrix();
        GlStateManager.pushMatrix();
        GlStateManager.scale(2.0F, 2.0F, 2.0F);
        this.func_175179_f()
            .func_175065_a(
                this.field_175200_y,
                (float) (-this.func_175179_f().getStringWidth(this.field_175200_y) / 2),
                5.0F,
                16777215 | var9,
                true);
        GlStateManager.popMatrix();
        GlStateManager.disableBlend();
        GlStateManager.popMatrix();
      }

      this.mc.mcProfiler.endSection();
    }

    Scoreboard var12 = this.mc.theWorld.getScoreboard();
    ScoreObjective var13 = null;
    ScorePlayerTeam var15 = var12.getPlayersTeam(this.mc.thePlayer.getName());

    if (var15 != null) {
      int var10 = var15.func_178775_l().func_175746_b();

      if (var10 >= 0) {
        var13 = var12.getObjectiveInDisplaySlot(3 + var10);
      }
    }

    ScoreObjective var16 = var13 != null ? var13 : var12.getObjectiveInDisplaySlot(1);

    if (var16 != null) {
      this.func_180475_a(var16, var2);
    }

    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.disableAlpha();
    GlStateManager.pushMatrix();
    GlStateManager.translate(0.0F, (float) (var4 - 48), 0.0F);
    this.mc.mcProfiler.startSection("chat");
    this.persistantChatGUI.drawChat(this.updateCounter);
    this.mc.mcProfiler.endSection();
    GlStateManager.popMatrix();
    var16 = var12.getObjectiveInDisplaySlot(0);

    if (this.mc.gameSettings.keyBindPlayerList.getIsKeyPressed()
        && (!this.mc.isIntegratedServerRunning()
            || this.mc.thePlayer.sendQueue.func_175106_d().size() > 1
            || var16 != null)) {
      this.overlayPlayerList.func_175246_a(true);
      this.overlayPlayerList.func_175249_a(var3, var12, var16);
    } else {
      this.overlayPlayerList.func_175246_a(false);
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableLighting();
    GlStateManager.enableAlpha();
  }
Beispiel #2
0
 public void drawRadar() {
   tick++;
   if (tick >= 50) {
     tick = 0;
   }
   GL11.glLineWidth(2.0F);
   InstanceMain.getInstance()
       .getRender()
       .drawFilledCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 50, 0x55008881);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 50, 0x8800999C);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 38, 0x8800999C);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 25, 0x8800999C);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 13, 0x8800999C);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, tick, 0x33000000);
   InstanceMain.getInstance()
       .getRender()
       .dr(
           Minecraft.getMinecraft().displayWidth / 2 - 110,
           59.5,
           Minecraft.getMinecraft().displayWidth / 2 - 10,
           60.5,
           0x99000000);
   InstanceMain.getInstance()
       .getRender()
       .dr(
           Minecraft.getMinecraft().displayWidth / 2 - 59.5,
           10,
           Minecraft.getMinecraft().displayWidth / 2 - 60.5,
           110,
           0x99000000);
   InstanceMain.getInstance()
       .getRender()
       .drawCircle(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 1, 0xffffffff); // Player
   List<Entity> list1 = this.mc.theWorld.loadedEntityList;
   GL11.glLineWidth(1.0F);
   for (int i = 0; i < list1.size(); i++) {
     Entity entity = list1.get(i);
     double xdis = this.mc.thePlayer.posX - entity.posX;
     double zdis = this.mc.thePlayer.posZ - entity.posZ;
     double tdis = Math.sqrt((xdis * xdis) + (zdis * zdis));
     double difInAng =
         MathHelper.wrapAngleTo180_double(
             this.mc.thePlayer.rotationYaw - ((Math.atan2(zdis, xdis) * 180.0D) / Math.PI));
     double finalX = Math.cos(Math.toRadians(difInAng)) * tdis;
     double finalY = -Math.sin(Math.toRadians(difInAng)) * tdis;
     GL11.glPushMatrix();
     GL11.glTranslatef(Minecraft.getMinecraft().displayWidth / 2 - 60, 60, 0);
     if (tdis <= 100) {
       if (!(entity instanceof EntityPlayerSP)) {
         if (entity instanceof EntityPlayer) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xff0000ff);
           GL11.glScalef(0.5F, 0.5F, 0.5F);
           EntityPlayer p = (EntityPlayer) entity;
           String u = p.getName();
           this.mc.fontRendererObj.drawString(
               u,
               (int) (finalX) - (this.mc.fontRendererObj.getStringWidth(u) / 2),
               (int) finalY - 10,
               0xffffff);
           GL11.glScalef(1F, 0.5F, 1F);
         }
         if (entity instanceof EntityAnimal) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xff00ff00);
         }
         if (entity instanceof EntityMob) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xffff0000);
         }
         if (entity instanceof EntitySlime) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xffff88cc);
         }
         if (entity instanceof EntityVillager) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xff8b4513);
         }
         if (entity instanceof EntityBat) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xfff4a460);
         }
         if (entity instanceof EntitySquid) {
           InstanceMain.getInstance()
               .getRender()
               .drawCircle((int) finalX / 2, (int) finalY / 2, 1, 0xff003399);
         }
       }
     }
     GL11.glPopMatrix();
   }
 }