Esempio n. 1
0
 public static void renderEnchantmentEffects(Tessellator tessellator) {
   GL11.glDepthFunc(GL11.GL_EQUAL);
   GL11.glDisable(GL11.GL_LIGHTING);
   FMLClientHandler.instance().getClient().renderEngine.bindTexture(ITEM_GLINT);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
   float f7 = 0.76F;
   GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
   GL11.glMatrixMode(GL11.GL_TEXTURE);
   GL11.glPushMatrix();
   float f8 = 0.125F;
   GL11.glScalef(f8, f8, f8);
   float f9 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
   GL11.glTranslatef(f9, 0.0F, 0.0F);
   GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
   RenderManager.instance.itemRenderer.renderItemIn2D(
       tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
   GL11.glPopMatrix();
   GL11.glPushMatrix();
   GL11.glScalef(f8, f8, f8);
   f9 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
   GL11.glTranslatef(-f9, 0.0F, 0.0F);
   GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
   RenderManager.instance.itemRenderer.renderItemIn2D(
       tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
   GL11.glPopMatrix();
   GL11.glMatrixMode(GL11.GL_MODELVIEW);
   GL11.glDisable(GL11.GL_BLEND);
   GL11.glEnable(GL11.GL_LIGHTING);
   GL11.glDepthFunc(GL11.GL_LEQUAL);
 }
Esempio n. 2
0
  public void renderTransformed() {
    CoreRegistry.get(ShaderManager.class).enableDefault();

    if (isVisible()) {

      for (Animation animation : animations) {
        if (animation.isStarted()) {
          animation.renderBegin();
        }
      }

      if (positionType == EPositionType.RELATIVE) {
        glPushMatrix();
        glTranslatef(getPosition().x, getPosition().y, 0);
        render();
        glPopMatrix();
      } else if (positionType == EPositionType.ABSOLUTE) {
        glPushMatrix();
        glLoadIdentity();
        glTranslatef(getPosition().x, getPosition().y, 0);
        render();
        glPopMatrix();
      }

      for (Animation animation : animations) {
        if (animation.isStarted()) {
          animation.renderEnd();
        }
      }
    }
  }
Esempio n. 3
0
  @Override
  public void renderTileEntityAt(
      TileEntityDryingTable tile, double xPos, double yPos, double zPos) {
    EntityItem customitem = new EntityItem(getWorldObj());
    customitem.hoverStart = 0f;
    float blockScale = 1.0F;

    if (((TileEntityDryingTable) tile).getStackInSlot(0) != null) {
      GL11.glPushMatrix(); // start
      GL11.glTranslatef((float) xPos + 0.5F, (float) yPos + 0.5F, (float) zPos + 0.5F);
      if (RenderManager.instance.options.fancyGraphics) {
        GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
      }
      GL11.glScalef(blockScale, blockScale, blockScale);
      ItemStack target = ((TileEntityDryingTable) tile).getStackInSlot(0).copy();
      target.stackSize = 1;
      customitem.setEntityItemStack(target);
      itemRenderer.doRender(customitem, 0, 0, 0, 0, 0);
      GL11.glPopMatrix(); // end
    }

    if (((TileEntityDryingTable) tile).getStackInSlot(1) != null) {
      GL11.glPushMatrix(); // start
      GL11.glTranslatef((float) xPos + 0.5F, (float) yPos + 0.2F, (float) zPos + 0.5F);
      if (RenderManager.instance.options.fancyGraphics) {
        GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
      }
      GL11.glScalef(blockScale, blockScale, blockScale);
      ItemStack target = ((TileEntityDryingTable) tile).getStackInSlot(1).copy();
      target.stackSize = 1;
      customitem.setEntityItemStack(target);
      itemRenderer.doRender(customitem, 0, 0, 0, 0, 0);
      GL11.glPopMatrix(); // end
    }
  }
Esempio n. 4
0
  public void renderLoop() {
    angle += 2.0f;

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glPushMatrix();
    glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
    glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
    glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);

    glPushMatrix();
    glTranslatef(-3.0f, -2.0f, 0.0f);
    glRotatef(angle, 0.0f, 0.0f, 1.0f);
    glCallList(gear1);
    glPopMatrix();

    glPushMatrix();
    glTranslatef(3.1f, -2.0f, 0.0f);
    glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
    glCallList(gear2);
    glPopMatrix();

    glPushMatrix();
    glTranslatef(-3.1f, 4.2f, 0.0f);
    glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
    glCallList(gear3);
    glPopMatrix();

    glPopMatrix();
  }
  @Override
  public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
    if (tileEntity instanceof TEBellJar) {
      TEBellJar tileAltar = (TEBellJar) tileEntity;
      GL11.glPushMatrix();
      GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
      ResourceLocation test =
          new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
      FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
      GL11.glPushMatrix();
      GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
      this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
      GL11.glPopMatrix();
      GL11.glPopMatrix();

      ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
      if (info.length >= 1 && info[0] != null) {
        ReagentStack reagentStack = info[0].reagent;
        int capacity = info[0].capacity;
        if (reagentStack != null && reagentStack.reagent != null) {
          Reagent reagent = reagentStack.reagent;
          this.renderTankContents(
              d0,
              d1,
              d2,
              reagent.getColourRed(),
              reagent.getColourGreen(),
              reagent.getColourBlue(),
              200 * reagentStack.amount / capacity);
        }
      }
    }
  }
Esempio n. 6
0
  /** Sets the models various rotation angles then renders the model. */
  public void render(
      Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    this.setRotationAngles(par2, par3, par4, par5, par6, par7);

    if (this.isChild) {
      float var8 = 2.0F;
      GL11.glPushMatrix();
      GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8);
      GL11.glTranslatef(0.0F, 10.0F * par7, 4.0F * par7);
      this.field_48220_g.render(par7);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8);
      GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
      this.field_48226_n.render(par7);
      this.field_48225_a.render(par7);
      this.field_48223_b.render(par7);
      this.field_48224_c.render(par7);
      this.field_48221_d.render(par7);
      this.field_48222_e.render(par7);
      this.field_48219_f.render(par7);
      GL11.glPopMatrix();
    } else {
      this.field_48220_g.render(par7);
      this.field_48226_n.render(par7);
      this.field_48222_e.render(par7);
      this.field_48219_f.render(par7);
      this.field_48225_a.render(par7);
      this.field_48223_b.render(par7);
      this.field_48224_c.render(par7);
      this.field_48221_d.render(par7);
    }
  }
Esempio n. 7
0
  @Override
  public void doRender(Entity entity, double x, double y, double z, float a, float b) {
    EntityRippleMark mark = (EntityRippleMark) entity;
    long dt = GameTimer.getTime() - mark.creationTime;

    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0);
    GL11.glDepthMask(false);
    GL11.glPushMatrix();

    GL11.glTranslated(x, y, z);

    for (int i = 0; i < timeOffsets.length; ++i) {
      GL11.glPushMatrix();

      long mod = (dt - timeOffsets[i]) % CYCLE;
      float size = getSize(mod);

      GL11.glTranslatef(0, getHeight(mod), 0);
      GL11.glScalef(size, 1, size);
      material.color = mark.color.copy();
      material.color.a *= getAlpha(mod);
      mesh.draw(material);

      GL11.glPopMatrix();
    }

    GL11.glPopMatrix();
    GL11.glDepthMask(true);
    GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1f);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
  }
 @SubscribeEvent(priority = EventPriority.LOWEST)
 @Optional.Method(modid = Mods.OpenComputers)
 public void onRobotRender(RobotRenderEvent e) {
   if (!rendering) {
     return;
   }
   if (e.mountPoints == null || e.mountPoints.length < 2) {
     return;
   }
   MountPoint mountPoint = e.mountPoints[1];
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   GL11.glTranslatef(0.5f, 0.5f, 0.5f);
   GL11.glColor3f(color.r, color.g, color.b);
   float degrees = 360 - ((time % 160) / 160F * 360F);
   Minecraft.getMinecraft().getTextureManager().bindTexture(modelRadar);
   GL11.glDisable(GL11.GL_CULL_FACE);
   GL11.glRotatef(180, 1, 0, 0);
   GL11.glRotatef(
       mountPoint.rotation.getW(),
       mountPoint.rotation.getX(),
       mountPoint.rotation.getY(),
       mountPoint.rotation.getZ());
   GL11.glTranslatef(0F, -0.8F, 0F);
   GL11.glTranslatef(mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ());
   GL11.glScalef(0.3f, 0.3f, 0.3f);
   GL11.glPushMatrix();
   radarModel.render(Math.max(degrees, 0));
   GL11.glPopMatrix();
   GL11.glPopMatrix();
   GL11.glPopAttrib();
 }
  public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
    int i;
    if (tileentity.getWorldObj() == null) {
      i = 0;
    } else {
      Block block = tileentity.getBlockType();
      i = tileentity.getBlockMetadata();
      if ((block != null) && (i == 0)) {
        i = tileentity.getBlockMetadata();
      }
    }

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    GL11.glPushMatrix();
    GL11.glRotatef(180.0F, 180.0F, 0.0F, 0.0F);
    int j = 0;
    if (i == 3) {
      j = 0;
    }
    if (i == 2) {
      j = 180;
    }
    if (i == 4) {
      j = 90;
    }
    if (i == 5) {
      j = 270;
    }
    GL11.glRotatef(j, 0.0F, 1.0F, 0.0F);
    this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
Esempio n. 10
0
  /** Sets the models various rotation angles then renders the model. */
  public void render(
      Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);

    if (this.isChild) {
      float var8 = 2.0F;
      GL11.glPushMatrix();
      GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8);
      GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F);
      this.bipedHead.render(par7);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8);
      GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
      this.bipedBody.render(par7);
      this.bipedRightArm.render(par7);
      this.bipedLeftArm.render(par7);
      this.bipedRightLeg.render(par7);
      this.bipedLeftLeg.render(par7);
      this.bipedHeadwear.render(par7);
      GL11.glPopMatrix();
    } else {
      this.bipedHead.render(par7);
      this.bipedBody.render(par7);
      this.bipedRightArm.render(par7);
      this.bipedLeftArm.render(par7);
      this.bipedRightLeg.render(par7);
      this.bipedLeftLeg.render(par7);
      this.bipedHeadwear.render(par7);
    }
  }
  @Override
  public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GL11.glRotatef(180, 0F, 0F, 1F);

    switch (tileentity.getBlockMetadata()) {
      case 5:
        GL11.glRotatef(90, 0F, 1F, 0F);
        break;
      case 3:
        GL11.glRotatef(180, 0F, 1F, 0F);
        break;
      case 4:
        GL11.glRotatef(270, 0F, 1F, 0F);
        break;
      case 2:
        GL11.glRotatef(0, 0F, 1F, 0F);
        break;
    }

    this.bindTexture(texture);

    GL11.glPushMatrix();
    this.model.renderModel(0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
Esempio n. 12
0
  @Override
  public void draw(Canvas canvas) {

    Color currColor = canvas.getColor();

    canvas.setColor(Color.GREEN);
    int width = mRect.widht() * mHealth / mMaxHelth;
    glPushMatrix();
    glTranslated(mX, mY, 0);
    glBegin(GL_QUADS);
    glVertex2d(1, 1);
    glVertex2d(width, 1);
    glVertex2d(width, mRect.height() - 1);
    glVertex2d(1, mRect.height() - 1);
    glEnd();
    glTranslated(0, 0, 0);
    glPopMatrix();
    canvas.setColor(currColor);

    canvas.setColor(Color.RED);
    glPushMatrix();
    glTranslated(mX, mY, 0);
    glBegin(GL_QUADS);
    glVertex2d(1, 1);
    glVertex2d(mRect.widht() - 1, 1);
    glVertex2d(mRect.widht() - 1, mRect.height() - 1);
    glVertex2d(1, mRect.height() - 1);
    glEnd();
    glTranslated(0, 0, 0);
    glPopMatrix();
    canvas.setColor(currColor);

    super.draw(canvas);
  }
Esempio n. 13
0
  public void renderModelAt(TileEntitySafe safe, double d, double d1, double d2, float f) {
    int x;
    if (safe.worldObj == null) {
      x = 0;
    } else {
      x = ZoocraftiaDirection.getOpposite(safe.getDirection());
    }

    GL11.glPushMatrix();
    GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
    if (x == 1) GL11.glRotatef(-90, 0, 1F, 0);
    if (x == 3) GL11.glRotatef(90, 0, 1F, 0);
    if (x == 2) GL11.glRotatef(180, 0, 1F, 0);
    if (x == 0) GL11.glRotatef(0, 0, 1F, 0);
    GL11.glRotatef(180, 1F, 0, 0);
    bindTextureByName("/zoocraftia/functional/textures/safe.png");
    GL11.glPushMatrix();
    float rotation = safe.prevAngle + (safe.currentAngle - safe.prevAngle) * f;
    rotation = 1.0F - rotation;
    rotation = 1.0F - rotation;
    safeModel.SafeDoor.rotateAngleY = -(rotation * (float) Math.PI * 1.5F) / 2;
    safeModel.renderModel(0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
Esempio n. 14
0
  @Override
  protected void drawGuiContainerForegroundLayer(int x, int y) {
    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glPushMatrix();

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

    // GL11.glBegin(GL11.GL_TRIANGLE_FAN);
    GL11.glBegin(GL11.GL_LINE_LOOP);
    for (int ii = 0; ii < 50; ii++) {
      float theta = 2.0f * 3.1415926f * ii / 50; // get the current angle

      float xLocation = 50 * (float) Math.cos(theta); // calculate the x component
      float yLocation = 50 * (float) Math.sin(theta); // calculate the y component

      GL11.glVertex2f(xLocation + 60f, yLocation + 60f); // output vertex
    }
    GL11.glEnd();

    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();

    super.drawGuiContainerForegroundLayer(x, y);
  }
 @Override
 @SideOnly(Side.CLIENT)
 public void preRender(
     Entity entity, BodyPart[] parts, BodyPartLocation location, ModelBase model) {
   RenderBlocks renderBlocks = new RenderBlocks();
   ClientProxy.bindTexture(TextureMap.locationItemsTexture);
   GL11.glEnable(GL11.GL_CULL_FACE);
   if (location == BodyPartLocation.Torso) {
     GL11.glPushMatrix();
     GL11.glScalef(1.0F, -1.0F, 1.0F);
     GL11.glTranslatef(0.4F, 0.4F, 0.0F);
     GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
     renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
     GL11.glTranslatef(0.1F, 0.0F, -0.4F);
     GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F);
     renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
     GL11.glPopMatrix();
   }
   if (location == BodyPartLocation.Head) {
     GL11.glPushMatrix();
     head[0].postRender(0.0625F);
     GL11.glScalef(1.0F, -1.0F, 1.0F);
     GL11.glTranslatef(0.0F, 0.75F, -0.1F);
     GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F);
     renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); // head
     GL11.glPopMatrix();
   }
   GL11.glDisable(GL11.GL_CULL_FACE);
   ClientProxy.bindTexture(texture);
 }
  public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
    f = 0.0625f;
    RenderState.blendingOn();
    int timestep = (int) ((System.currentTimeMillis()) % 10000);
    double angle = timestep * Math.PI / 5000.0;
    GL11.glPushMatrix();
    GL11.glRotatef(180.0f, 1.0f, 0, 0);
    GL11.glTranslatef(0.5f, -1.5f, -0.5f);
    middletable.render(f);
    uppertable.render(f);
    footbase.render(f);
    foot1.render(f);
    fatfoot2.render(f);
    fatfoot1.render(f);
    backsupport.render(f);
    tank3.render(f);
    tank2.render(f);
    tank1.render(f);
    wireshort4.render(f);
    wireshort3.render(f);
    wireshort2.render(f);
    Wireshort1.render(f);
    Wirelong1.render(f);

    RenderState.glowOn();
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glTranslated(0.5f, 1.05f, 0.5f);
    GL11.glTranslated(0, 0.02f * Math.sin(angle * 3), 0);
    // GLRotate uses degrees instead of radians for some reason grr
    GL11.glRotatef((float) (angle * 57.2957795131), 0.0f, 1.0f, 0.0f);
    GL11.glRotatef(45f, 1.0f, 0.0f, 0.0f);
    // arctangent of 0.5.
    GL11.glRotatef(35.2643897f, 0, 1, 1);
    // cube.render(0.0625f);
    GL11.glColor4d(1, 1, 1, 0.8);
    cube.render(f / 2.0f);
    // cube.render(0.016000f);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glRotatef(180.0f, 1.0f, 0, 0);
    GL11.glTranslatef(0.5f, -1.5f, -0.5f);
    screen3.render(f);
    screen2.render(f);
    screen1.render(f);
    particles.render(f);
    GL11.glPopMatrix();
    // GL11.glPushMatrix();
    // if (Minecraft.getMinecraft().isFancyGraphicsEnabled()) {
    // if (f1 != 0) {
    // GL11.glDisable(GL11.GL_CULL_FACE);
    // for (int i = 0; i < 1; i++) {
    // drawScanLine(angle);
    // }
    // }
    // }
    // GL11.glPopMatrix();
    RenderState.glowOff();
    RenderState.blendingOff();
  }
Esempio n. 17
0
 protected void setupGLState() {
   GL11.glPushAttrib(
       GL11.GL_ENABLE_BIT
           | GL11.GL_TRANSFORM_BIT
           | GL11.GL_HINT_BIT
           | GL11.GL_COLOR_BUFFER_BIT
           | GL11.GL_SCISSOR_BIT
           | GL11.GL_LINE_BIT
           | GL11.GL_TEXTURE_BIT);
   GL11.glMatrixMode(GL11.GL_PROJECTION);
   GL11.glPushMatrix();
   GL11.glLoadIdentity();
   GL11.glOrtho(0, width, height, 0, -1.0, 1.0);
   GL11.glMatrixMode(GL11.GL_MODELVIEW);
   GL11.glPushMatrix();
   GL11.glLoadIdentity();
   GL11.glEnable(GL11.GL_TEXTURE_2D);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glEnable(GL11.GL_LINE_SMOOTH);
   GL11.glDisable(GL11.GL_DEPTH_TEST);
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glDisable(GL11.GL_SCISSOR_TEST);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
 }
Esempio n. 18
0
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    RenderBlocks renderer = (RenderBlocks) data[0];
    int metadata = item.getItemDamage();
    GL11.glPushMatrix();
    renderer.setOverrideBlockTexture(PillarMaterials.values()[metadata].block.getIcon(0, 0));
    Tessellator tessellator = Tessellator.instance;
    renderer.setRenderBoundsFromBlock(this.bl);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(this.bl, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(this.bl, 0));
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(this.bl, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(this.bl, 0));
    tessellator.draw();

    renderer.clearOverrideBlockTexture();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    GL11.glPushMatrix();
    GL11.glRotatef(180, 0F, 1F, 0F);
    Minecraft.getMinecraft().renderEngine.bindTexture(this.textureFrame);
    this.modelFrame.renderAll();
    GL11.glPopMatrix();

    GL11.glPopMatrix();
  }
  public void renderAnuAt(
      TileEntityAnubiteStatue tileentity, double x, double y, double z, float f) {
    int i1 = 0;
    if (tileentity.hasWorldObj()) {
      i1 = tileentity.getBlockMetadata();
    }
    short short1 = 0;
    if (i1 == 2) {

      short1 = 360;
    }

    if (i1 == 3) {
      short1 = 180;
    }

    if (i1 == 4) {
      short1 = 90;
    }

    if (i1 == 5) {
      short1 = -90;
    }

    GL11.glPushMatrix();
    GL11.glTranslatef(0f, 0f, 0f);
    GL11.glTranslated((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    GL11.glRotatef(180, 0F, 0F, 1F);
    GL11.glRotatef((float) short1 * -1F, 0.0F, 1.0F, 0.0F);
    GL11.glPushMatrix();
    this.bindTexture(texture);
    this.modelBlock.renderBlock(0.0625F);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
Esempio n. 20
0
  public void render(
      Entity p_78088_1_,
      float p_78088_2_,
      float p_78088_3_,
      float p_78088_4_,
      float p_78088_5_,
      float p_78088_6_,
      float p_78088_7_) {
    this.setRotationAngles(
        p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);

    if (this.isChild) {
      float f6 = 2.0F;
      GL11.glPushMatrix();
      GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
      GL11.glTranslatef(0.0F, 16.0F * p_78088_7_, 0.0F);
      this.bipedHat1.render(p_78088_7_);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
      GL11.glTranslatef(0.0F, 16.0F * p_78088_7_, 0.0F);
      this.bipedHat2.render(p_78088_7_);
      GL11.glPopMatrix();

    } else {
      this.bipedHat1.render(p_78088_7_);
      this.bipedHat2.render(p_78088_7_);
    }
  }
Esempio n. 21
0
  @Override
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    float field_78145_g = 8.0F;
    float field_78151_h = 4.0F;

    if (this.isChild) {
      float var8 = 2.0F;
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5);
      HEADROT.render(f5);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8);
      GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F);
      Body.render(f5);
      Body.render(f5);
      wingrig.render(f5);
      winglef.render(f5);
      tail.render(f5);
      LEGRIGTOPROT.render(f5);
      LEGLEFTOPROT.render(f5);
      GL11.glPopMatrix();
    } else {
      Body.render(f5);
      wingrig.render(f5);
      winglef.render(f5);
      tail.render(f5);
      LEGRIGTOPROT.render(f5);
      LEGLEFTOPROT.render(f5);
      HEADROT.render(f5);
    }
  }
Esempio n. 22
0
  /**
   * Actually renders the given argument. This is a synthetic bridge method, always casting down its
   * argument and then handing it off to a worker function which does the actual work. In all
   * probabilty, the class Render is generic (Render<T extends Entity) and this method has signature
   * public void doRender(T entity, double d, double d1, double d2, float f, float f1). But JAD is
   * pre 1.5 so doesn't do that.
   */
  public void doRender(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glScalef(0.5F, 0.5F, 0.5F);
    // this.loadTexture("/warpcraft/items/Items.png");
    Tessellator var10 = Tessellator.instance;

    if (this.itemIconIndex == 9) {
      int var11 = PotionHelper.func_77915_a(((EntityPotion) par1Entity).getPotionDamage(), false);
      float var12 = (float) (var11 >> 16 & 255) / 255.0F;
      float var13 = (float) (var11 >> 8 & 255) / 255.0F;
      float var14 = (float) (var11 & 255) / 255.0F;
      GL11.glColor3f(var12, var13, var14);
      GL11.glPushMatrix();
      this.func_77026_a(var10, 141);
      GL11.glPopMatrix();
      GL11.glColor3f(1.0F, 1.0F, 1.0F);
    }

    this.func_77026_a(var10, this.itemIconIndex);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
  }
  /**
   * Actually renders the given argument. This is a synthetic bridge method, always casting down its
   * argument and then handing it off to a worker function which does the actual work. In all
   * probabilty, the class Render is generic (Render<T extends Entity) and this method has signature
   * public void doRender(T entity, double d, double d1, double d2, float f, float f1). But JAD is
   * pre 1.5 so doesn't do that.
   */
  public void doRender(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);

    if (icon != null) {
      GL11.glPushMatrix();
      GL11.glTranslatef((float) par2, (float) par4, (float) par6);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glScalef(0.5F, 0.5F, 0.5F);
      this.bindEntityTexture(par1Entity);
      Tessellator tessellator = Tessellator.instance;

      if (icon == ItemPotion.func_94589_d("bottle_splash")) {
        int i = PotionHelper.func_77915_a(((LaunchedPotion) par1Entity).getPotionDamage(), false);
        float f2 = (float) (i >> 16 & 255) / 255.0F;
        float f3 = (float) (i >> 8 & 255) / 255.0F;
        float f4 = (float) (i & 255) / 255.0F;
        GL11.glColor3f(f2, f3, f4);
        GL11.glPushMatrix();
        this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
        GL11.glPopMatrix();
        GL11.glColor3f(1.0F, 1.0F, 1.0F);
      }

      this.func_77026_a(tessellator, icon);
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      GL11.glPopMatrix();
    }
  }
Esempio n. 24
0
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    TurretFeetI.render(f5);
    TurretFeetII.render(f5);
    TurretFeetIII.render(f5);
    TurretFeetIV.render(f5);
    TurretFeetV.render(f5);
    TurretHead.render(f5);
    TurretThroatI.render(f5);
    TurretThroatII.render(f5);
    TurretThroatIII.render(f5);
    TurretThroatIV.render(f5);
    TurretThroatV.render(f5);
    TurretAntennaI.render(f5);
    TurretAntennaII.render(f5);
    RightBarrel.render(f5);
    LeftBarrel.render(f5);

    GL11.glPushMatrix();
    if (this.isGlowTexture) {
      GL11.glScalef(1.1F, 1.1F, 1.1F);
      GL11.glTranslatef(0.010F, -0.11F, -0.00F);
    }
    HealthBar.render(f5);
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    if (this.isGlowTexture) {
      GL11.glScalef(1.1F, 1.1F, 1.1F);
      GL11.glTranslatef(-0.010F, -0.11F, -0.00F);
    }
    AmmoBar.render(f5);
    GL11.glPopMatrix();
  }
Esempio n. 25
0
  @Override
  public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glPushMatrix();
    GL11.glTranslated(-tileentity.xCoord, -tileentity.yCoord, -tileentity.zCoord);
    GL11.glTranslated(x, y, z);

    if (tileentity instanceof IBoxesProvider) {
      for (Box b : ((IBoxesProvider) tileentity).getBoxes()) {
        if (b.isVisible) {
          RenderBox.doRender(
              TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b);
        }
      }
    } else if (tileentity instanceof IBoxProvider) {
      Box b = ((IBoxProvider) tileentity).getBox();

      if (b.isVisible) {
        RenderBox.doRender(
            TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b);
      }
    }

    GL11.glPopMatrix();

    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }
  /** Sets the models various rotation angles then renders the model. */
  public void render(
      Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);

    if (this.isChild) {
      float var8 = 2.0F;
      GL11.glPushMatrix();
      GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8);
      GL11.glTranslatef(0.0F, 10.0F * par7, 4.0F * par7);
      this.ocelotHead.render(par7);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8);
      GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
      this.ocelotBody.render(par7);
      this.ocelotBackLeftLeg.render(par7);
      this.ocelotBackRightLeg.render(par7);
      this.ocelotFrontLeftLeg.render(par7);
      this.ocelotFrontRightLeg.render(par7);
      this.ocelotTail.render(par7);
      this.ocelotTail2.render(par7);
      GL11.glPopMatrix();
    } else {
      this.ocelotHead.render(par7);
      this.ocelotBody.render(par7);
      this.ocelotTail.render(par7);
      this.ocelotTail2.render(par7);
      this.ocelotBackLeftLeg.render(par7);
      this.ocelotBackRightLeg.render(par7);
      this.ocelotFrontLeftLeg.render(par7);
      this.ocelotFrontRightLeg.render(par7);
    }
  }
Esempio n. 27
0
  /** Sets the models various rotation angles then renders the model. */
  public void render(
      Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    super.render(par1Entity, par2, par3, par4, par5, par6, par7);
    this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);

    if (this.isChild) {
      float f6 = 2.0F;
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7);
      this.WolfHead.render(par7);
      GL11.glPopMatrix();
      GL11.glPushMatrix();
      GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
      GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
      this.Body.render(par7);
      this.leg1.render(par7);
      this.leg2.render(par7);
      this.leftarm.render(par7);
      this.rightarm.render(par7);
      GL11.glPopMatrix();
    } else {
      this.WolfHead.renderWithRotation(par7);
      this.Body.render(par7);
      this.leg1.render(par7);
      this.leg2.render(par7);
      this.leftarm.render(par7);
      this.rightarm.render(par7);
    }
  }
Esempio n. 28
0
  public void renderSpinningCubes(int cubes, int repeat, int origRepeat) {
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    final float modifier = 6F;
    final float rotationModifier = 0.2F;
    final float radiusBase = 0.35F;
    final float radiusMod = 0.05F;

    double ticks =
        ClientTickHandler.ticksInGame
            + ClientTickHandler.partialTicks
            - 1.3 * (origRepeat - repeat);
    float offsetPerCube = 360 / cubes;

    GL11.glPushMatrix();
    GL11.glTranslatef(-0.025F, 0.85F, -0.025F);
    for (int i = 0; i < cubes; i++) {
      float offset = offsetPerCube * i;
      float deg = (int) (ticks / rotationModifier % 360F + offset);
      float rad = deg * (float) Math.PI / 180F;
      float radiusX = (float) (radiusBase + radiusMod * Math.sin(ticks / modifier));
      float radiusZ = (float) (radiusBase + radiusMod * Math.cos(ticks / modifier));
      float x = (float) (radiusX * Math.cos(rad));
      float z = (float) (radiusZ * Math.sin(rad));
      float y = (float) Math.cos((ticks + 50 * i) / 5F) / 10F;

      GL11.glPushMatrix();
      GL11.glTranslatef(x, y, z);
      float xRotate = (float) Math.sin(ticks * rotationModifier) / 2F;
      float yRotate = (float) Math.max(0.6F, Math.sin(ticks * 0.1F) / 2F + 0.5F);
      float zRotate = (float) Math.cos(ticks * rotationModifier) / 2F;

      GL11.glRotatef(deg, xRotate, yRotate, zRotate);
      if (repeat < origRepeat) {
        GL11.glColor4f(1F, 1F, 1F, (float) repeat / (float) origRepeat * 0.4F);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
      } else GL11.glColor4f(1F, 1F, 1F, 1F);

      int light = 15728880;
      int lightmapX = light % 65536;
      int lightmapY = light / 65536;

      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
      spinningCube.render(1F / 16F);

      if (repeat < origRepeat) {
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
      }

      GL11.glPopMatrix();
    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);

    if (repeat != 0) renderSpinningCubes(cubes, repeat - 1, origRepeat);
  }
  private void renderGlow(TileEntityBiomePainter te, float par8, int axis) {
    Tessellator v5 = Tessellator.instance;
    v5.setBrightness(240);
    int c =
        te.isInWorld()
            ? ReikaColorAPI.getModifiedHue(0xff0000, (te.getTicksExisted() * 2 + axis * 10) % 360)
            : 0xffffff;
    float r = ReikaColorAPI.getRed(c) / 255F;
    float g = ReikaColorAPI.getGreen(c) / 255F;
    float b = ReikaColorAPI.getBlue(c) / 255F;
    GL11.glColor4f(r, g, b, 1);
    GL11.glPushMatrix();
    double s = 0.5;
    GL11.glTranslated(0.5, 0, 0.5);
    GL11.glScaled(s, s, s);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    BlendMode.ADDITIVE.apply();
    double dy =
        te.isInWorld() ? 0.5 * Math.sin((te.getTicksExisted() + par8) / 12D + axis / 4D) : 0;
    if (axis >= 3) {
      dy = -dy;
    }
    double rx = 0;
    double ry = 0;
    double rz = 0;

    GL11.glPushMatrix();
    switch (axis) {
      case 0:
      case 3:
        GL11.glTranslated(0, dy, 0);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
      case 1:
      case 4:
        GL11.glTranslated(dy, 0, 0);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
      case 2:
      case 5:
        GL11.glTranslated(0, 0, dy);
        GL11.glRotated(rx, 1, 0, 0);
        GL11.glRotated(ry, 0, 1, 0);
        GL11.glRotated(rz, 0, 0, 1);
        movingFrame.renderAll(te, null);
        break;
    }
    GL11.glPopMatrix();

    GL11.glPopMatrix();
  }
  private void renderStorageRackDual(
      TileEntityStorageRack tile, double x, double y, double z, float animationMultiplier) {
    int type = tile.getSize();
    ForgeDirection direction = ForgeDirection.getOrientation(tile.getDirection());

    ItemStack content = tile.getContainerContent(0);

    // fourteen
    Point topBoxIcon =
        translator.translate(
            ForgeDirection.NORTH,
            direction,
            new Point(px.six, px.fifteen - px.quarter, px.fourteen + 0.01));
    Point topBoxText =
        translator.translate(
            ForgeDirection.NORTH,
            direction,
            new Point(px.eight, px.ten + px.half, px.fourteen + 0.01));

    if (content != null) {
      GL11.glPushMatrix();

      GL11.glTranslated(x + topBoxIcon.x, y + topBoxIcon.y, z + topBoxIcon.z);

      this.drawIcon(direction, px.one / 4.0F, content);
      GL11.glPopMatrix();

      GL11.glPushMatrix();
      GL11.glTranslated(x + topBoxText.x, y + topBoxText.y, z + topBoxText.z);
      this.drawText(direction, px.one / 5.0F, content, tile.getContainerContentCount(0));
      GL11.glPopMatrix();

      // box 2
    }

    content = tile.getContainerContent(1);
    if (content != null) {
      topBoxIcon =
          translator.translate(
              ForgeDirection.NORTH, direction, new Point(px.six, px.seven, px.fourteen + 0.01));
      topBoxText =
          translator.translate(
              ForgeDirection.NORTH,
              direction,
              new Point(px.eight, px.three - px.quarter, px.fourteen + 0.01));

      GL11.glPushMatrix();

      GL11.glTranslated(x + topBoxIcon.x, y + topBoxIcon.y, z + topBoxIcon.z);

      this.drawIcon(direction, px.one / 4.0F, content);
      GL11.glPopMatrix();

      GL11.glPushMatrix();
      GL11.glTranslated(x + topBoxText.x, y + topBoxText.y, z + topBoxText.z);
      this.drawText(direction, px.one / 5.0F, content, tile.getContainerContentCount(1));
      GL11.glPopMatrix();
    }
  }