예제 #1
0
 protected void func_77076_a(EntityEnderman p_77076_1_, float p_77076_2_) {
   super.func_77029_c(p_77076_1_, p_77076_2_);
   if (p_77076_1_.func_70822_p() > 0) {
     GL11.glEnable('\u803a');
     GL11.glPushMatrix();
     float var3 = 0.5F;
     GL11.glTranslatef(0.0F, 0.6875F, -0.75F);
     var3 *= 1.0F;
     GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
     GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
     GL11.glScalef(-var3, -var3, var3);
     int var4 = p_77076_1_.func_70070_b(p_77076_2_);
     int var5 = var4 % 65536;
     int var6 = var4 / 65536;
     OpenGlHelper.func_77475_a(
         OpenGlHelper.field_77476_b, (float) var5 / 1.0F, (float) var6 / 1.0F);
     GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
     GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
     this.func_76985_a("/terrain.png");
     this.field_76988_d.func_78600_a(
         Block.field_71973_m[p_77076_1_.func_70822_p()], p_77076_1_.func_70824_q(), 1.0F);
     GL11.glPopMatrix();
     GL11.glDisable('\u803a');
   }
 }
예제 #2
0
  protected int func_77074_a(EntityEnderman p_77074_1_, int p_77074_2_, float p_77074_3_) {
    if (p_77074_2_ != 0) {
      return -1;
    } else {
      this.func_76985_a("/mob/enderman_eyes.png");
      float var4 = 1.0F;
      GL11.glEnable(3042);
      GL11.glDisable(3008);
      GL11.glBlendFunc(1, 1);
      GL11.glDisable(2896);
      if (p_77074_1_.func_82150_aj()) {
        GL11.glDepthMask(false);
      } else {
        GL11.glDepthMask(true);
      }

      char var5 = '\uf0f0';
      int var6 = var5 % 65536;
      int var7 = var5 / 65536;
      OpenGlHelper.func_77475_a(
          OpenGlHelper.field_77476_b, (float) var6 / 1.0F, (float) var7 / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(2896);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, var4);
      return 1;
    }
  }
예제 #3
0
  public void renderNitroAndSpeed(
      RenderGameOverlayEvent.Pre event, int width, int height, EntityPlayer player) {
    int nitro =
        TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName()) == null
            ? 0
            : TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName());
    int speed =
        (int)
            ((TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName()) == null
                    ? 0
                    : TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName()))
                * 100);
    int i = TFPlayerData.getTransformationTimer(player) * 30;

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0F, 0F, 0F, 0.3F);
    drawTexturedModalRect(5 - i, height - 17, 0, 0, 202, 12);
    drawTexturedModalRect(5 - i, height - 25, 0, 0, 202, 6);
    GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F);
    drawTexturedModalRect(6 - i, height - 16, 0, 0, (int) (nitro * 1.25F), 10);
    GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);
    drawTexturedModalRect(6 - i, height - 24, 0, 0, (int) (speed * 1F), 4);
    GL11.glEnable(GL11.GL_TEXTURE_2D);

    drawCenteredString(mc.fontRenderer, "Nitro", 106 - i, height - 15, 0xffffff);
    drawCenteredString(mc.fontRenderer, speed + " km/h", 106 - i, height - 26, 0xffffff);
  }
예제 #4
0
  /** Applies fixed function bindings from the context to OpenGL */
  private void applyFixedFuncBindings(boolean forLighting) {
    if (forLighting) {
      glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, context.shininess);
      setMaterialColor(GL_AMBIENT, context.ambient, ColorRGBA.DarkGray);
      setMaterialColor(GL_DIFFUSE, context.diffuse, ColorRGBA.White);
      setMaterialColor(GL_SPECULAR, context.specular, ColorRGBA.Black);

      if (context.useVertexColor) {
        glEnable(GL_COLOR_MATERIAL);
      } else {
        glDisable(GL_COLOR_MATERIAL);
      }
    } else {
      // Ignore other values as they have no effect when
      // GL_LIGHTING is disabled.
      ColorRGBA color = context.color;
      if (color != null) {
        glColor4f(color.r, color.g, color.b, color.a);
      } else {
        glColor4f(1, 1, 1, 1);
      }
    }
    if (context.alphaTestFallOff > 0f) {
      glEnable(GL_ALPHA_TEST);
      glAlphaFunc(GL_GREATER, context.alphaTestFallOff);
    } else {
      glDisable(GL_ALPHA_TEST);
    }
  }
예제 #5
0
  protected void func_77047_a(EntityIronGolem par1EntityIronGolem, float par2) {
    super.renderEquippedItems(par1EntityIronGolem, par2);

    if (par1EntityIronGolem.func_70853_p() == 0) {
      return;
    } else {
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glPushMatrix();
      GL11.glRotatef(
          5F + (180F * field_77050_a.ironGolemRightArm.rotateAngleX) / (float) Math.PI,
          1.0F,
          0.0F,
          0.0F);
      GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F);
      GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F);
      float f = 0.8F;
      GL11.glScalef(f, -f, f);
      int i = par1EntityIronGolem.getBrightnessForRender(par2);
      int j = i % 0x10000;
      int k = i / 0x10000;
      OpenGlHelper.setLightmapTextureCoords(
          OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      loadTexture("/terrain.png");
      renderBlocks.renderBlockAsItem(Block.plantRed, 0, 1.0F);
      GL11.glPopMatrix();
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      return;
    }
  }
예제 #6
0
  private void renderPortalOverlay(float var1, int var2, int var3) {
    if (var1 < 1.0F) {
      var1 *= var1;
      var1 *= var1;
      var1 = var1 * 0.8F + 0.2F;
    }

    GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
    GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, var1);
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/terrain.png"));
    float var4 = (float) (Block.portal.blockIndexInTexture % 16) / 16.0F;
    float var5 = (float) (Block.portal.blockIndexInTexture / 16) / 16.0F;
    float var6 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16.0F;
    float var7 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16.0F;
    Tessellator var8 = Tessellator.instance;
    var8.startDrawingQuads();
    var8.addVertexWithUV(0.0D, (double) var3, -90.0D, (double) var4, (double) var7);
    var8.addVertexWithUV((double) var2, (double) var3, -90.0D, (double) var6, (double) var7);
    var8.addVertexWithUV((double) var2, 0.0D, -90.0D, (double) var6, (double) var5);
    var8.addVertexWithUV(0.0D, 0.0D, -90.0D, (double) var4, (double) var5);
    var8.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);
  }
예제 #7
0
 private void renderVignette(float f, int i, int j) {
   f = 1.0F - f;
   if (f < 0.0F) {
     f = 0.0F;
   }
   if (f > 1.0F) {
     f = 1.0F;
   }
   prevVignetteBrightness += (double) (f - prevVignetteBrightness) * 0.01D;
   GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
   GL11.glDepthMask(false);
   GL11.glBlendFunc(0, 769);
   GL11.glColor4f(prevVignetteBrightness, prevVignetteBrightness, prevVignetteBrightness, 1.0F);
   GL11.glBindTexture(
       3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("%blur%/misc/vignette.png"));
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D);
   tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D);
   tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D);
   tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D);
   tessellator.draw();
   GL11.glDepthMask(true);
   GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glBlendFunc(770, 771);
 }
예제 #8
0
 private void func_78446_a(float p_78446_1_, int p_78446_2_) {
   Tessellator var3 = Tessellator.field_78398_a;
   this.field_78455_a.field_71439_g.func_70013_c(p_78446_1_);
   float var4 = 0.1F;
   GL11.glColor4f(var4, var4, var4, 0.5F);
   GL11.glPushMatrix();
   float var5 = -1.0F;
   float var6 = 1.0F;
   float var7 = -1.0F;
   float var8 = 1.0F;
   float var9 = -0.5F;
   float var10 = 0.0078125F;
   float var11 = (float) (p_78446_2_ % 16) / 256.0F - var10;
   float var12 = ((float) (p_78446_2_ % 16) + 15.99F) / 256.0F + var10;
   float var13 = (float) (p_78446_2_ / 16) / 256.0F - var10;
   float var14 = ((float) (p_78446_2_ / 16) + 15.99F) / 256.0F + var10;
   var3.func_78382_b();
   var3.func_78374_a((double) var5, (double) var7, (double) var9, (double) var12, (double) var14);
   var3.func_78374_a((double) var6, (double) var7, (double) var9, (double) var11, (double) var14);
   var3.func_78374_a((double) var6, (double) var8, (double) var9, (double) var11, (double) var13);
   var3.func_78374_a((double) var5, (double) var8, (double) var9, (double) var12, (double) var13);
   var3.func_78381_a();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
예제 #9
0
  /** Renders the fire on the screen for first person mode. Arg: partialTickTime */
  private void renderFireInFirstPerson(float par1) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    float f = 1.0F;

    for (int i = 0; i < 2; i++) {
      GL11.glPushMatrix();
      int j = Block.fire.blockIndexInTexture + i * 16;
      int k = (j & 0xf) << 4;
      int l = j & 0xf0;
      float f1 = (float) k / 256F;
      float f2 = ((float) k + 15.99F) / 256F;
      float f3 = (float) l / 256F;
      float f4 = ((float) l + 15.99F) / 256F;
      float f5 = (0.0F - f) / 2.0F;
      float f6 = f5 + f;
      float f7 = 0.0F - f / 2.0F;
      float f8 = f7 + f;
      float f9 = -0.5F;
      GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
      GL11.glRotatef((float) (i * 2 - 1) * 10F, 0.0F, 1.0F, 0.0F);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(f5, f7, f9, f2, f4);
      tessellator.addVertexWithUV(f6, f7, f9, f1, f4);
      tessellator.addVertexWithUV(f6, f8, f9, f1, f3);
      tessellator.addVertexWithUV(f5, f8, f9, f2, f3);
      tessellator.draw();
      GL11.glPopMatrix();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
  }
예제 #10
0
 public void func_153_a(
     EntityTNTPrimed entitytntprimed, double d, double d1, double d2, float f, float f1) {
   GL11.glPushMatrix();
   GL11.glTranslatef((float) d, (float) d1, (float) d2);
   if (((float) entitytntprimed.fuse - f1) + 1.0F < 10F) {
     float f2 = 1.0F - (((float) entitytntprimed.fuse - f1) + 1.0F) / 10F;
     if (f2 < 0.0F) {
       f2 = 0.0F;
     }
     if (f2 > 1.0F) {
       f2 = 1.0F;
     }
     f2 *= f2;
     f2 *= f2;
     float f4 = 1.0F + f2 * 0.3F;
     GL11.glScalef(f4, f4, f4);
   }
   float f3 = (1.0F - (((float) entitytntprimed.fuse - f1) + 1.0F) / 100F) * 0.8F;
   loadTexture("/terrain.png");
   field_196_d.renderBlockOnInventory(Block.tnt, 0);
   if ((entitytntprimed.fuse / 5) % 2 == 0) {
     GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
     GL11.glDisable(2896 /*GL_LIGHTING*/);
     GL11.glEnable(3042 /*GL_BLEND*/);
     GL11.glBlendFunc(770, 772);
     GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);
     field_196_d.renderBlockOnInventory(Block.tnt, 0);
     GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
     GL11.glDisable(3042 /*GL_BLEND*/);
     GL11.glEnable(2896 /*GL_LIGHTING*/);
     GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
   }
   GL11.glPopMatrix();
 }
예제 #11
0
 /**
  * Renders a texture that warps around based on the direction the player is looking. Texture needs
  * to be bound before being called. Used for the water overlay. Args: parialTickTime
  */
 private void renderWarpedTextureOverlay(float par1) {
   Tessellator tessellator = Tessellator.instance;
   float f = mc.thePlayer.getBrightness(par1);
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glPushMatrix();
   float f1 = 4F;
   float f2 = -1F;
   float f3 = 1.0F;
   float f4 = -1F;
   float f5 = 1.0F;
   float f6 = -0.5F;
   float f7 = -mc.thePlayer.rotationYaw / 64F;
   float f8 = mc.thePlayer.rotationPitch / 64F;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(f2, f4, f6, f1 + f7, f1 + f8);
   tessellator.addVertexWithUV(f3, f4, f6, 0.0F + f7, f1 + f8);
   tessellator.addVertexWithUV(f3, f5, f6, 0.0F + f7, 0.0F + f8);
   tessellator.addVertexWithUV(f2, f5, f6, f1 + f7, 0.0F + f8);
   tessellator.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glDisable(GL11.GL_BLEND);
 }
예제 #12
0
 /**
  * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime,
  * blockTextureIndex
  */
 private void renderInsideOfBlock(float par1, int par2) {
   Tessellator tessellator = Tessellator.instance;
   float f = mc.thePlayer.getBrightness(par1);
   f = 0.1F;
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glPushMatrix();
   float f1 = -1F;
   float f2 = 1.0F;
   float f3 = -1F;
   float f4 = 1.0F;
   float f5 = -0.5F;
   float f6 = 0.0078125F;
   float f7 = (float) (par2 % 16) / 256F - f6;
   float f8 = ((float) (par2 % 16) + 15.99F) / 256F + f6;
   float f9 = (float) (par2 / 16) / 256F - f6;
   float f10 = ((float) (par2 / 16) + 15.99F) / 256F + f6;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(f1, f3, f5, f8, f10);
   tessellator.addVertexWithUV(f2, f3, f5, f7, f10);
   tessellator.addVertexWithUV(f2, f4, f5, f7, f9);
   tessellator.addVertexWithUV(f1, f4, f5, f8, f9);
   tessellator.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
예제 #13
0
  private void func_78442_d(float p_78442_1_) {
    Tessellator tessellator = Tessellator.field_78398_a;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    float f = 1.0F;
    for (int i = 0; i < 2; i++) {
      GL11.glPushMatrix();
      int j = Block.field_72067_ar.field_72059_bZ + i * 16;
      int k = (j & 0xf) << 4;
      int l = j & 0xf0;
      float f1 = (float) k / 256F;
      float f2 = ((float) k + 15.99F) / 256F;
      float f3 = (float) l / 256F;
      float f4 = ((float) l + 15.99F) / 256F;
      float f5 = (0.0F - f) / 2.0F;
      float f6 = f5 + f;
      float f7 = 0.0F - f / 2.0F;
      float f8 = f7 + f;
      float f9 = -0.5F;
      GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
      GL11.glRotatef((float) (i * 2 - 1) * 10F, 0.0F, 1.0F, 0.0F);
      tessellator.func_78382_b();
      tessellator.func_78374_a(f5, f7, f9, f2, f4);
      tessellator.func_78374_a(f6, f7, f9, f1, f4);
      tessellator.func_78374_a(f6, f8, f9, f1, f3);
      tessellator.func_78374_a(f5, f8, f9, f2, f3);
      tessellator.func_78381_a();
      GL11.glPopMatrix();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(3042);
  }
예제 #14
0
 private void func_78448_c(float p_78448_1_) {
   Tessellator tessellator = Tessellator.field_78398_a;
   float f = field_78455_a.field_71439_g.func_70013_c(p_78448_1_);
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glEnable(3042);
   GL11.glBlendFunc(770, 771);
   GL11.glPushMatrix();
   float f1 = 4F;
   float f2 = -1F;
   float f3 = 1.0F;
   float f4 = -1F;
   float f5 = 1.0F;
   float f6 = -0.5F;
   float f7 = -field_78455_a.field_71439_g.field_70177_z / 64F;
   float f8 = field_78455_a.field_71439_g.field_70125_A / 64F;
   tessellator.func_78382_b();
   tessellator.func_78374_a(f2, f4, f6, f1 + f7, f1 + f8);
   tessellator.func_78374_a(f3, f4, f6, 0.0F + f7, f1 + f8);
   tessellator.func_78374_a(f3, f5, f6, 0.0F + f7, 0.0F + f8);
   tessellator.func_78374_a(f2, f5, f6, f1 + f7, 0.0F + f8);
   tessellator.func_78381_a();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glDisable(3042);
 }
예제 #15
0
 private void renderPortalOverlay(float f, int i, int j) {
   if (f < 1.0F) {
     f *= f;
     f *= f;
     f = f * 0.8F + 0.2F;
   }
   GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
   GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
   GL11.glDepthMask(false);
   GL11.glBlendFunc(770, 771);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, f);
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
   float f1 = (float) (Block.portal.blockIndexInTexture % 16) / 16F;
   float f2 = (float) (Block.portal.blockIndexInTexture / 16) / 16F;
   float f3 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16F;
   float f4 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16F;
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(0.0D, j, -90D, f1, f4);
   tessellator.addVertexWithUV(i, j, -90D, f3, f4);
   tessellator.addVertexWithUV(i, 0.0D, -90D, f3, f2);
   tessellator.addVertexWithUV(0.0D, 0.0D, -90D, f1, f2);
   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);
 }
  public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
    if (this.drawButton) {
      boolean var4 =
          par2 >= this.xPosition
              && par3 >= this.yPosition
              && par2 < this.xPosition + this.width
              && par3 < this.yPosition + this.height;
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      Minecraft mc = par1Minecraft;
      int i = mc.renderEngine.getTexture("/Immunology/GUI/MedicalResearchTableGUI.png");
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      mc.renderEngine.bindTexture(i);
      int var5 = 124;
      int var6 = 219;

      if (var4) {
        var5 += 11;
      }
      if (isExpanded) {
        var6 += 12;
      }

      this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var6, 11, 12);
    }
  }
예제 #17
0
 /**
  * Renders a texture that warps around based on the direction the player is looking. Texture needs
  * to be bound before being called. Used for the water overlay. Args: parialTickTime
  */
 private void renderWarpedTextureOverlay(float par1) {
   Tessellator tessellator = Tessellator.instance;
   float f1 = this.mc.thePlayer.getBrightness(par1);
   GL11.glColor4f(f1, f1, f1, 0.5F);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glPushMatrix();
   float f2 = 4.0F;
   float f3 = -1.0F;
   float f4 = 1.0F;
   float f5 = -1.0F;
   float f6 = 1.0F;
   float f7 = -0.5F;
   float f8 = -this.mc.thePlayer.rotationYaw / 64.0F;
   float f9 = this.mc.thePlayer.rotationPitch / 64.0F;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(
       (double) f3, (double) f5, (double) f7, (double) (f2 + f8), (double) (f2 + f9));
   tessellator.addVertexWithUV(
       (double) f4, (double) f5, (double) f7, (double) (0.0F + f8), (double) (f2 + f9));
   tessellator.addVertexWithUV(
       (double) f4, (double) f6, (double) f7, (double) (0.0F + f8), (double) (0.0F + f9));
   tessellator.addVertexWithUV(
       (double) f3, (double) f6, (double) f7, (double) (f2 + f8), (double) (0.0F + f9));
   tessellator.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glDisable(GL11.GL_BLEND);
 }
예제 #18
0
  @Override
  public void drawButton(Minecraft mc, int x, int y) {
    if (this.visible) {
      int k = this.getHoverState(this.field_146123_n) - 1;

      TFC_Core.bindTexture(GuiPlanSelection.texture);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      this.drawTexturedModalRect(this.xPosition, this.yPosition, 176, k * 18, 18, 18);
      this.field_146123_n =
          isPointInRegion(
              x,
              y); // x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width
                  // && y < this.yPosition + this.height;

      if (item != null) {
        renderInventorySlot(item, this.xPosition + 1, this.yPosition + 1);
      }

      this.mouseDragged(mc, x, y);

      if (field_146123_n) {
        FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
        screen.drawTooltip(x, y, this.displayString);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      }
    }
  }
예제 #19
0
  /** Renders the fire on the screen for first person mode. Arg: partialTickTime */
  private void renderFireInFirstPerson(float par1) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    float f1 = 1.0F;

    for (int i = 0; i < 2; ++i) {
      GL11.glPushMatrix();
      Icon icon = Block.fire.func_94438_c(1);
      float f2 = icon.getMinU();
      float f3 = icon.getMaxU();
      float f4 = icon.getMinV();
      float f5 = icon.getMaxV();
      float f6 = (0.0F - f1) / 2.0F;
      float f7 = f6 + f1;
      float f8 = 0.0F - f1 / 2.0F;
      float f9 = f8 + f1;
      float f10 = -0.5F;
      GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
      GL11.glRotatef((float) (i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV((double) f6, (double) f8, (double) f10, (double) f3, (double) f5);
      tessellator.addVertexWithUV((double) f7, (double) f8, (double) f10, (double) f2, (double) f5);
      tessellator.addVertexWithUV((double) f7, (double) f9, (double) f10, (double) f2, (double) f4);
      tessellator.addVertexWithUV((double) f6, (double) f9, (double) f10, (double) f3, (double) f4);
      tessellator.draw();
      GL11.glPopMatrix();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
  }
예제 #20
0
  public static void renderLiquidOverlays(float partialTicks) {
    Minecraft minecraft = FMLClientHandler.instance().getClient();

    if (ClientProxyCore.isInsideOfFluid(minecraft.thePlayer, GalacticraftCore.fluidOil)) {
      minecraft.getTextureManager().bindTexture(ClientProxyCore.underOilTexture);
    } else {
      return;
    }

    Tessellator tessellator = Tessellator.instance;
    float f1 = minecraft.thePlayer.getBrightness(partialTicks) / 3.0F;
    GL11.glColor4f(f1, f1, f1, 1.0F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();
    float f2 = 4.0F;
    float f3 = -1.0F;
    float f4 = 1.0F;
    float f5 = -1.0F;
    float f6 = 1.0F;
    float f7 = -0.5F;
    float f8 = -minecraft.thePlayer.rotationYaw / 64.0F;
    float f9 = minecraft.thePlayer.rotationPitch / 64.0F;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(f3, f5, f7, f2 + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f5, f7, 0.0F + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f6, f7, 0.0F + f8, 0.0F + f9);
    tessellator.addVertexWithUV(f3, f6, f7, f2 + f8, 0.0F + f9);
    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
  }
예제 #21
0
  public void renderItems(TileEntity tile) {
    if (tile != null && tile instanceof TileInjector) {
      TileInjector t = (TileInjector) tile;
      float tz[] = new float[] {-0.25F, -0.25F, -0F, -0F, +0.25F, +0.25F};
      float tx[] = new float[] {-0.1F, -0.25F, -0.1F, -0.25F, -0.1F, -0.25F};

      double yit = -0.133F;
      List<FluidTank> l = t.getFluidTanks();
      int amount = l.get(0).getFluidAmount() > 0 ? l.get(0).getFluidAmount() : 1;
      float ratio = (float) amount / (float) l.get(0).getCapacity();
      if (amount > 0) yit = -0.41 + 0.4 * ratio;

      for (int i = 0; i < 6; i++) {
        if (t.items[i + 1] != null) {
          GL11.glPushMatrix();
          GL11.glTranslatef((float) tx[i], (float) yit - 0.08F, (float) tz[i]);
          GL11.glRotatef(45, 0F, 1F, 0F);
          EntityItem itemEntity2 = new EntityItem(tile.getWorldObj(), 0, 0, 0, t.items[i + 1]);
          itemEntity2.hoverStart = 0.0F;
          GL11.glScalef(0.5F, 0.5F, 0.5F);
          RenderItem.renderInFrame = true;
          GL11.glColor4f(1F, 1F, 1F, 1F);
          RenderManager.instance.renderEntityWithPosYaw(itemEntity2, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
          GL11.glColor4f(1F, 1F, 1F, 1F);
          RenderItem.renderInFrame = false;
          GL11.glPopMatrix();
        }
      }
    }
  }
예제 #22
0
  protected void renderJumpBar(int width, int height) {
    bind(icons);
    if (pre(JUMPBAR)) return;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();

    mc.mcProfiler.startSection("jumpBar");
    float charge = mc.thePlayer.getHorseJumpPower();
    final int barWidth = 182;
    int x = (width / 2) - (barWidth / 2);
    int filled = (int) (charge * (float) (barWidth + 1));
    int top = height - 32 + 3;

    drawTexturedModalRect(x, top, 0, 84, barWidth, 5);

    if (filled > 0) {
      this.drawTexturedModalRect(x, top, 0, 89, filled, 5);
    }

    GlStateManager.enableBlend();
    mc.mcProfiler.endSection();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    post(JUMPBAR);
  }
예제 #23
0
  /** Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. */
  protected int renderGlow(EntityDragon par1EntityDragon, int par2, float par3) {
    if (par2 == 1) {
      GL11.glDepthFunc(GL11.GL_LEQUAL);
    }

    if (par2 != 0) {
      return -1;
    } else {
      loadTexture("/mob/enderdragon/ender_eyes.png");
      float f = 1.0F;
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glDepthFunc(GL11.GL_EQUAL);
      int i = 61680;
      int j = i % 0x10000;
      int k = i / 0x10000;
      OpenGlHelper.setLightmapTextureCoords(
          OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f);
      return 1;
    }
  }
예제 #24
0
  public void renderKatanaDash(
      RenderGameOverlayEvent.Pre event, int width, int height, EntityPlayer player) {
    if (player.getHeldItem() != null
        && player.getHeldItem().getItem() == TFItems.purgesKatana
        && !TFPlayerData.isInVehicleMode(player)
        && TFHelper.isPlayerPurge(player)) {
      int j =
          TFItems.purgesKatana.getMaxItemUseDuration(player.getHeldItem())
              - player.getItemInUseCount();
      double d = (double) j / 10;

      if (d > 2.0D) {
        d = 2.0D;
      }

      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glColor4f(0F, 0F, 0F, 0.15F);
      drawTexturedModalRect(width / 2 - 26, height / 2 + 9, 0, 0, 52, 12);
      GL11.glColor4f(1F, 0F, 0F, 0.25F);
      drawTexturedModalRect(width / 2 - 25, height / 2 + 10, 0, 0, (int) (d * 25), 10);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
  }
예제 #25
0
 private void renderInsideOfBlock(float par1, int par2) {
   Tessellator var3 = Tessellator.instance;
   this.mc.thePlayer.getBrightness(par1);
   float var4 = 0.1F;
   GL11.glColor4f(var4, var4, var4, 0.5F);
   GL11.glPushMatrix();
   float var5 = -1.0F;
   float var6 = 1.0F;
   float var7 = -1.0F;
   float var8 = 1.0F;
   float var9 = -0.5F;
   float var10 = 0.0078125F;
   float var11 = (float) (par2 % 16) / 256.0F - var10;
   float var12 = ((float) (par2 % 16) + 15.99F) / 256.0F + var10;
   float var13 = (float) (par2 / 16) / 256.0F - var10;
   float var14 = ((float) (par2 / 16) + 15.99F) / 256.0F + var10;
   var3.startDrawingQuads();
   var3.addVertexWithUV(
       (double) var5, (double) var7, (double) var9, (double) var12, (double) var14);
   var3.addVertexWithUV(
       (double) var6, (double) var7, (double) var9, (double) var11, (double) var14);
   var3.addVertexWithUV(
       (double) var6, (double) var8, (double) var9, (double) var11, (double) var13);
   var3.addVertexWithUV(
       (double) var5, (double) var8, (double) var9, (double) var12, (double) var13);
   var3.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
  /** Render the EvolvedEndermans eyes */
  protected int renderEyes(
      SCSednaEntityEvolvedEnderman par1EntityEvolvedEnderman, int par2, float par3) {
    if (par2 != 0) {
      return -1;
    } else {
      this.bindTexture(EvolvedEndermanEyesTexture);
      float f1 = 1.0F;
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
      GL11.glDisable(GL11.GL_LIGHTING);

      if (par1EntityEvolvedEnderman.isInvisible()) {
        GL11.glDepthMask(false);
      } else {
        GL11.glDepthMask(true);
      }

      char c0 = 61680;
      int j = c0 % 65536;
      int k = c0 / 65536;
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
      return 1;
    }
  }
예제 #27
0
 private void func_78446_a(float p_78446_1_, int p_78446_2_) {
   Tessellator tessellator = Tessellator.field_78398_a;
   float f = field_78455_a.field_71439_g.func_70013_c(p_78446_1_);
   f = 0.1F;
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glPushMatrix();
   float f1 = -1F;
   float f2 = 1.0F;
   float f3 = -1F;
   float f4 = 1.0F;
   float f5 = -0.5F;
   float f6 = 0.0078125F;
   float f7 = (float) (p_78446_2_ % 16) / 256F - f6;
   float f8 = ((float) (p_78446_2_ % 16) + 15.99F) / 256F + f6;
   float f9 = (float) (p_78446_2_ / 16) / 256F - f6;
   float f10 = ((float) (p_78446_2_ / 16) + 15.99F) / 256F + f6;
   tessellator.func_78382_b();
   tessellator.func_78374_a(f1, f3, f5, f8, f10);
   tessellator.func_78374_a(f2, f3, f5, f7, f10);
   tessellator.func_78374_a(f2, f4, f5, f7, f9);
   tessellator.func_78374_a(f1, f4, f5, f8, f9);
   tessellator.func_78381_a();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
예제 #28
0
  /** R_PolyBlend */
  void R_PolyBlend() {
    if (gl_polyblend.value == 0.0f) return;

    if (v_blend[3] == 0.0f) return;

    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    GL11.glLoadIdentity();

    // FIXME: get rid of these
    GL11.glRotatef(-90, 1, 0, 0); // put Z going up
    GL11.glRotatef(90, 0, 0, 1); // put Z going up

    GL11.glColor4f(v_blend[0], v_blend[1], v_blend[2], v_blend[3]);

    GL11.glBegin(GL11.GL_QUADS);

    GL11.glVertex3f(10, 100, 100);
    GL11.glVertex3f(10, -100, 100);
    GL11.glVertex3f(10, -100, -100);
    GL11.glVertex3f(10, 100, -100);
    GL11.glEnd();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    GL11.glColor4f(1, 1, 1, 1);
  }
예제 #29
0
  /** Sets the spider's glowing eyes */
  protected int setSpiderEyeBrightness(EntitySpider par1EntitySpider, int par2, float par3) {
    if (par2 != 0) {
      return -1;
    } else {
      this.loadTexture("/mob/spider_eyes.png");
      float f1 = 1.0F;
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);

      if (par1EntitySpider.isInvisible()) {
        GL11.glDepthMask(false);
      } else {
        GL11.glDepthMask(true);
      }

      char c0 = 61680;
      int j = c0 % 65536;
      int k = c0 / 65536;
      OpenGlHelper.setLightmapTextureCoords(
          OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
      return 1;
    }
  }
예제 #30
0
  /** R_DrawSpriteModel */
  void R_DrawSpriteModel(entity_t e) {
    float alpha = 1.0F;

    qfiles.dsprframe_t frame;
    qfiles.dsprite_t psprite;

    // don't even bother culling, because it's just a single
    // polygon without a surface cache

    psprite = (qfiles.dsprite_t) currentmodel.extradata;

    e.frame %= psprite.numframes;

    frame = psprite.frames[e.frame];

    if ((e.flags & Defines.RF_TRANSLUCENT) != 0) alpha = e.alpha;

    if (alpha != 1.0F) GL11.glEnable(GL11.GL_BLEND);

    GL11.glColor4f(1, 1, 1, alpha);

    GL_Bind(currentmodel.skins[e.frame].texnum);

    GL_TexEnv(GL11.GL_MODULATE);

    if (alpha == 1.0) GL11.glEnable(GL11.GL_ALPHA_TEST);
    else GL11.glDisable(GL11.GL_ALPHA_TEST);

    GL11.glBegin(GL11.GL_QUADS);

    GL11.glTexCoord2f(0, 1);
    Math3D.VectorMA(e.origin, -frame.origin_y, vup, point);
    Math3D.VectorMA(point, -frame.origin_x, vright, point);
    GL11.glVertex3f(point[0], point[1], point[2]);

    GL11.glTexCoord2f(0, 0);
    Math3D.VectorMA(e.origin, frame.height - frame.origin_y, vup, point);
    Math3D.VectorMA(point, -frame.origin_x, vright, point);
    GL11.glVertex3f(point[0], point[1], point[2]);

    GL11.glTexCoord2f(1, 0);
    Math3D.VectorMA(e.origin, frame.height - frame.origin_y, vup, point);
    Math3D.VectorMA(point, frame.width - frame.origin_x, vright, point);
    GL11.glVertex3f(point[0], point[1], point[2]);

    GL11.glTexCoord2f(1, 1);
    Math3D.VectorMA(e.origin, -frame.origin_y, vup, point);
    Math3D.VectorMA(point, frame.width - frame.origin_x, vright, point);
    GL11.glVertex3f(point[0], point[1], point[2]);

    GL11.glEnd();

    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL_TexEnv(GL11.GL_REPLACE);

    if (alpha != 1.0F) GL11.glDisable(GL11.GL_BLEND);

    GL11.glColor4f(1, 1, 1, 1);
  }