public static void renderRotatingBlockIntoGUI(
      FontRenderer fontRenderer,
      RenderEngine renderEngine,
      ItemStack stack,
      int x,
      int y,
      float zLevel,
      float scale) {

    RenderBlocks renderBlocks = new RenderBlocks();

    Block block = Block.blocksList[stack.itemID];
    renderEngine.bindTexture(renderEngine.getTexture(block.getTextureFile()));
    GL11.glPushMatrix();
    GL11.glTranslatef((float) (x - 2), (float) (y + 3), -3.0F + zLevel);
    GL11.glScalef(10.0F, 10.0F, 10.0F);
    GL11.glTranslatef(1.0F, 0.5F, 1.0F);
    GL11.glScalef(1.0F * scale, 1.0F * scale, -1.0F);
    GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(0F + 1 * rotationAngle, 0.0F, 1.0F, 0.0F);
    rotationAngle = (rotationAngle + 1) % 360;

    int var10 = Item.itemsList[stack.itemID].getColorFromItemStack(stack, 0);
    float var16 = (float) (var10 >> 16 & 255) / 255.0F;
    float var12 = (float) (var10 >> 8 & 255) / 255.0F;
    float var13 = (float) (var10 & 255) / 255.0F;

    GL11.glColor4f(var16, var12, var13, 1.0F);

    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    renderBlocks.useInventoryTint = true;
    renderBlocks.renderBlockAsItem(block, stack.getItemDamage(), 1.0F);
    renderBlocks.useInventoryTint = true;
    GL11.glPopMatrix();
  }
  /** Sets the models various rotation angles then renders the model. */
  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_) {
    GL11.glPushMatrix();
    GL11.glScalef(2.0F, 2.0F, 2.0F);
    GL11.glTranslatef(0.0F, -0.5F, 0.0F);

    if (this.base != null) {
      this.base.render(p_78088_7_);
    }

    GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.8F + p_78088_4_, 0.0F);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    this.glass.render(p_78088_7_);
    float var8 = 0.875F;
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F);
    this.glass.render(p_78088_7_);
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F);
    this.cube.render(p_78088_7_);
    GL11.glPopMatrix();
  }
예제 #3
0
  // private void Render_with_MultiSurface_on()
  public void Render() {
    int mid;
    if (this.mesh_id >= 0) {
      if (this.IsEnabled()) {

        if (this.IsVisible()) {
          TF3D_Mesh mesh = F3D.Meshes.items.get(this.mesh_id);

          mesh.vbo.Bind();

          for (int i = 0; i < this.surfaces.size(); i++) {
            if (this.surfaces.get(i).isEnabled()) {
              mid = this.surfaces.get(i).id;

              if (mid >= 0) {
                F3D.Surfaces.ApplyMaterial(mid);
              }

              glPushMatrix();
              glMultMatrix(this.PhysicObject.transformMatrixBuffer);
              glScalef(this.GetScale().x, this.GetScale().y, this.GetScale().z);

              mesh.Render(i);

              glScalef(1, 1, 1);
              glPopMatrix();
            }
          }

          mesh.vbo.UnBind();
        }
      }
    }
  }
예제 #4
0
 public void renderBoat(EntityBoat entityboat, double d, double d1, double d2, float f, float f1) {
   GL11.glPushMatrix();
   GL11.glTranslatef((float) d, (float) d1, (float) d2);
   GL11.glRotatef(180F - f, 0.0F, 1.0F, 0.0F);
   float f2 = (float) entityboat.func_41018_h() - f1;
   float f3 = (float) entityboat.func_41020_g() - f1;
   if (f3 < 0.0F) {
     f3 = 0.0F;
   }
   if (f2 > 0.0F) {
     GL11.glRotatef(
         ((MathHelper.sin(f2) * f2 * f3) / 10F) * (float) entityboat.func_41016_i(),
         1.0F,
         0.0F,
         0.0F);
   }
   loadTexture("/terrain.png");
   float f4 = 0.75F;
   GL11.glScalef(f4, f4, f4);
   GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4);
   loadTexture("/item/boat.png");
   GL11.glScalef(-1F, -1F, 1.0F);
   modelBoat.render(entityboat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
   GL11.glPopMatrix();
 }
예제 #5
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_);
    }
  }
예제 #6
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();
  }
 @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);
 }
예제 #8
0
  public void transform(ItemRenderType type) {
    final EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;

    if (type == ItemRenderType.EQUIPPED) {
      GL11.glRotatef(70, 1.0F, 0, 0);
      GL11.glRotatef(-10, 0.0F, 1, 0);
      GL11.glRotatef(50, 0.0F, 1, 1);
      GL11.glScalef(3.8F, 4.1F, 3.8F);
      GL11.glTranslatef(0.25F, 1.2F, 0F);
    }

    if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
      GL11.glTranslatef(0.0F, -0.9F, 0.0F);
      GL11.glRotatef(0, 0, 0, 1);
      GL11.glRotatef(45, 0, 1, 0);
      GL11.glRotatef(90, 1, 0, 0);
      GL11.glTranslatef(5.5F, 7.0F, -8.5F);
      GL11.glScalef(6.2F, 8.2F, 6.2F);
    }

    GL11.glScalef(-0.4F, -0.4F, 0.4F);

    if (type == ItemRenderType.INVENTORY || type == ItemRenderType.ENTITY) {
      if (type == ItemRenderType.INVENTORY) {
        GL11.glTranslatef(0, -1.9F, 0);
        GL11.glScalef(0.7F, 0.6F, 0.7F);
        GL11.glRotatef(225F, 0F, 1F, 0F);
      } else {
        GL11.glTranslatef(0, -3.9F, 0);
      }

      GL11.glScalef(1.3F, 1.3F, 1.3F);
    }
  }
예제 #9
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);
    }
  }
예제 #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);
    }
  }
  /** 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);
    }
  }
예제 #12
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);
 }
예제 #13
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
    }
  }
예제 #14
0
  private void draw() {

    // Clear the screen and depth buffer
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();

    // set up GameContext.getCamera()
    GL11.glPushMatrix();

    GL11.glScalef(scale, scale, scale);
    GL11.glTranslatef(
        -GameContext.getCamera().getPosition().getx(),
        -GameContext.getCamera().getPosition().gety(),
        0);
    GL11.glTranslatef(4f, 3f, 0);

    map.draw();

    if (editorMode) {
      Quad q = new Quad(editorTag.getPosition(), map.getLookupTile(currentEditorTile).getTexture());
      GameContext.getPipe().addDrawable(q);
    }

    for (Entity ae : entities) {
      ae.draw();
    }

    GameContext.getPipe().renderContent();

    GL11.glPopMatrix();

    // overlay console text

    GL11.glPushMatrix();
    GL11.glScalef(2f, 2f, 2f);

    if (console.isEnabled()) {
      gtest.drawing.util.drawString(new Coord(0, 0), "> " + console.getText());
    }

    if (GameContext.isDebugMode()) {
      gtest.drawing.util.drawString(
          new Coord(0, 285), "tiles drawn " + GameContext.getFromLog("tilesLastDrawn"));
      gtest.drawing.util.drawString(
          new Coord(0, 275), "textures bound " + GameContext.getFromLog("textureBinds"));
      gtest.drawing.util.drawString(new Coord(0, 265), "FPS " + GameContext.getFromLog("fps"));
    }

    GL11.glPopMatrix();

    Display.update();

    // clean up

    GameContext.getPipe().clear();
    GameContext.addToLog("tilesLastDrawn", "0");
    GameContext.addToLog("textureBinds", "0");
  }
예제 #15
0
  public static boolean renderEntityItem(
      EntityItem entity,
      ItemStack item,
      float bobing,
      float rotation,
      Random random,
      TextureManager engine,
      RenderBlocks renderBlocks) {
    IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY);
    if (customRenderer == null) {
      return false;
    }

    if (customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_ROTATION)) {
      GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
    }
    if (!customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_BOBBING)) {
      GL11.glTranslatef(0.0F, -bobing, 0.0F);
    }
    boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);

    engine.func_110577_a(
        item.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
    Block block = (item.itemID < Block.blocksList.length ? Block.blocksList[item.itemID] : null);
    if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))) {
      int renderType = (block != null ? block.getRenderType() : 1);
      float scale =
          (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2
              ? 0.5F
              : 0.25F);

      if (RenderItem.renderInFrame) {
        GL11.glScalef(1.25F, 1.25F, 1.25F);
        GL11.glTranslatef(0.0F, 0.05F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
      }

      GL11.glScalef(scale, scale, scale);

      int size = item.stackSize;
      int count = (size > 40 ? 5 : (size > 20 ? 4 : (size > 5 ? 3 : (size > 1 ? 2 : 1))));

      for (int j = 0; j < count; j++) {
        GL11.glPushMatrix();
        if (j > 0) {
          GL11.glTranslatef(
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale,
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale,
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale);
        }
        customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
        GL11.glPopMatrix();
      }
    } else {
      GL11.glScalef(0.5F, 0.5F, 0.5F);
      customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
    }
    return true;
  }
 protected void moveRendering(float size, double posX, double posY, double posz) {
   GL11.glTranslated(0, 0, posz);
   GL11.glScalef(
       scale, scale, -0.0001f); // We flatten the rendering and scale it to the right size
   GL11.glTranslated(
       posX, posY, 0); // Finally, we translate the icon itself to the correct position
   GL11.glScalef(size, size, 1.0f);
 }
예제 #17
0
  @Override
  public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTick) {

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);

    int side = -1;
    if (tile != null && tile instanceof TileInjector) side = ((TileInjector) tile).side;
    switch (side) {
      case 2:
        GL11.glRotatef(270, 0F, 1F, 0F);
        break;
      case 3:
        GL11.glRotatef(90, 0F, 1F, 0F);
        break;
      case 4:
        break;
      case 5:
        GL11.glRotatef(180, 0F, 1F, 0F);
        break;
      case -1:
        break;
      default:
        break;
    }

    renderLiquids(tile);
    renderItems(tile);

    Minecraft.getMinecraft().renderEngine.bindTexture(this.textureFrame);
    this.modelFrame.renderAll();

    GL11.glPushMatrix();
    GL11.glTranslatef((float) +0.3F, (float) -0.15F, (float) 0);
    EntityItem itemEntity2 =
        new EntityItem(tile.getWorldObj(), 0, 0, 0, new ItemStack(ModItems.itemFluidModule));
    itemEntity2.hoverStart = 0.0F;
    GL11.glScalef(0.9F, 0.9F, 0.9F);
    RenderItem.renderInFrame = true;
    RenderManager.instance.renderEntityWithPosYaw(itemEntity2, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
    RenderItem.renderInFrame = false;
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDepthMask(false);
    GL11.glScalef(1.01F, 1.01F, 1.01F);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1F, 1F, 1F, 0.5F);
    Minecraft.getMinecraft().renderEngine.bindTexture(this.textureGlass);
    this.modelGlass.renderAll();
    GL11.glColor4f(1F, 1F, 1F, 1F);
    GL11.glDepthMask(true);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();

    GL11.glPopMatrix();
  }
  /** Render quiver on skeletons if possible */
  @SubscribeEvent
  public void renderLiving(RenderLivingEvent.Post event) {

    if (BattlegearConfig.enableSkeletonQuiver
        && event.entity instanceof EntitySkeleton
        && event.renderer instanceof RenderSkeleton) {

      GL11.glPushMatrix();
      GL11.glDisable(GL11.GL_CULL_FACE);

      GL11.glColor3f(1, 1, 1);
      Minecraft.getMinecraft().getTextureManager().bindTexture(quiverDetails);

      GL11.glTranslatef((float) event.x, (float) event.y, (float) event.z);

      GL11.glScalef(1, -1, 1);

      float f2 =
          interpolateRotation(event.entity.prevRenderYawOffset, event.entity.renderYawOffset, 0);

      GL11.glRotatef(180.0F - f2, 0.0F, 1.0F, 0.0F);

      if (event.entity.deathTime > 0) {
        float f3 =
            ((float) event.entity.deathTime + BattlegearClientTickHandeler.getPartialTick() - 1.0F)
                / 20.0F
                * 1.6F;
        f3 = MathHelper.sqrt_float(f3);

        if (f3 > 1.0F) {
          f3 = 1.0F;
        }

        GL11.glRotatef(-f3 * 90, 0.0F, 0.0F, 1.0F);
      }

      GL11.glTranslatef(0, -1.5F, 0);

      GL11.glRotatef(event.entity.rotationPitch, 0, 1, 0);

      if (event.entity.getEquipmentInSlot(3) != null) { // chest armor
        GL11.glTranslatef(0, 0, BattlegearRenderHelper.RENDER_UNIT);
      }
      ((ModelBiped) event.renderer.mainModel)
          .bipedBody.postRender(BattlegearRenderHelper.RENDER_UNIT);
      GL11.glScalef(1.05F, 1.05F, 1.05F);
      quiverModel.render(SKELETON_ARROW, BattlegearRenderHelper.RENDER_UNIT);

      Minecraft.getMinecraft().getTextureManager().bindTexture(quiverBase);
      GL11.glColor3f(0.10F, 0.10F, 0.10F);
      quiverModel.render(0, BattlegearRenderHelper.RENDER_UNIT);
      GL11.glColor3f(1, 1, 1);

      GL11.glEnable(GL11.GL_CULL_FACE);
      GL11.glPopMatrix();
    }
  }
예제 #19
0
  public static boolean renderInventoryItem(
      RenderBlocks renderBlocks,
      TextureManager engine,
      ItemStack item,
      boolean inColor,
      float zLevel,
      float x,
      float y) {
    IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, INVENTORY);
    if (customRenderer == null) {
      return false;
    }

    engine.func_110577_a(
        item.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
    if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK)) {
      GL11.glPushMatrix();
      GL11.glTranslatef(x - 2, y + 3, -3.0F + zLevel);
      GL11.glScalef(10F, 10F, 10F);
      GL11.glTranslatef(1.0F, 0.5F, 1.0F);
      GL11.glScalef(1.0F, 1.0F, -1F);
      GL11.glRotatef(210F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);

      if (inColor) {
        int color = Item.itemsList[item.itemID].getColorFromItemStack(item, 0);
        float r = (float) (color >> 16 & 0xff) / 255F;
        float g = (float) (color >> 8 & 0xff) / 255F;
        float b = (float) (color & 0xff) / 255F;
        GL11.glColor4f(r, g, b, 1.0F);
      }

      GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
      renderBlocks.useInventoryTint = inColor;
      customRenderer.renderItem(INVENTORY, item, renderBlocks);
      renderBlocks.useInventoryTint = true;
      GL11.glPopMatrix();
    } else {
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glPushMatrix();
      GL11.glTranslatef(x, y, -3.0F + zLevel);

      if (inColor) {
        int color = Item.itemsList[item.itemID].getColorFromItemStack(item, 0);
        float r = (float) (color >> 16 & 255) / 255.0F;
        float g = (float) (color >> 8 & 255) / 255.0F;
        float b = (float) (color & 255) / 255.0F;
        GL11.glColor4f(r, g, b, 1.0F);
      }

      customRenderer.renderItem(INVENTORY, item, renderBlocks);
      GL11.glPopMatrix();
      GL11.glEnable(GL11.GL_LIGHTING);
    }

    return true;
  }
예제 #20
0
 protected void func_77041_b(EntityWither p_82415_1_, float p_82415_2_) {
   int var3 = p_82415_1_.func_82212_n();
   if (var3 > 0) {
     float var4 = 2.0F - ((float) var3 - p_82415_2_) / 220.0F * 0.5F;
     GL11.glScalef(var4, var4, var4);
   } else {
     GL11.glScalef(2.0F, 2.0F, 2.0F);
   }
 }
  @SuppressWarnings("deprecation")
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    RenderBlocks renderer = (RenderBlocks) data[0];

    BlockFactoryGlassPane pane =
        (BlockFactoryGlassPane) Block.blocksList[((ItemBlock) item.getItem()).getBlockID()];

    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);

    if (type == ItemRenderType.INVENTORY) {
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glScalef(16f, 16f, 16f);
      GL11.glTranslatef(0.5f, 0.5f, 0.5f);

      RenderingRegistry.instance()
          .renderInventoryBlock(
              renderer,
              pane,
              item.getItemDamage(),
              MineFactoryReloadedCore.renderIdFactoryGlassPane);

      GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
      GL11.glScalef(1 / 16f, 1 / 16f, 1 / 16f);
      GL11.glEnable(GL11.GL_LIGHTING);
    } else {
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);

      switch (type) {
        case EQUIPPED_FIRST_PERSON:
        case EQUIPPED:
          GL11.glTranslatef(10 / 16f, 7 / 16f, 0f);
          break;
        case ENTITY:
          GL11.glScalef(0.75f, 0.75f, 0.75f);
          GL11.glTranslatef(0f, 4 / 16f, 0f);
          break;
        default:
      }

      RenderingRegistry.instance()
          .renderInventoryBlock(
              renderer,
              pane,
              item.getItemDamage(),
              MineFactoryReloadedCore.renderIdFactoryGlassPane);

      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }

    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glPopMatrix();
  }
예제 #22
0
  protected void renderEquippedItems(EntityLiving var1, float var2) {
    super.renderEquippedItems(var1, var2);
    ItemStack var3 = var1.getHeldItem();

    if (var3 != null) {
      GL11.glPushMatrix();
      this.modelBipedMain.bipedRightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
      IItemRenderer var5 =
          MinecraftForgeClient.getItemRenderer(var3, IItemRenderer.ItemRenderType.EQUIPPED);
      boolean var6 =
          var5 != null
              && var5.shouldUseRenderHelper(
                  IItemRenderer.ItemRenderType.EQUIPPED,
                  var3,
                  IItemRenderer.ItemRendererHelper.BLOCK_3D);
      float var4;

      if (var3.getItem() instanceof ItemBlock
          && (var6 || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))) {
        var4 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        var4 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(var4, -var4, var4);
      } else if (Item.itemsList[var3.itemID].isFull3D()) {
        var4 = 0.625F;
        GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
        GL11.glScalef(var4, -var4, var4);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        var4 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(var4, var4, var4);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
      }

      this.renderManager.itemRenderer.renderItem(var1, var3, 0);

      if (var3.getItem().requiresMultipleRenderPasses()) {
        for (int var7 = 1; var7 < var3.getItem().getRenderPasses(var3.getItemDamage()); ++var7) {
          this.renderManager.itemRenderer.renderItem(var1, var3, var7);
        }
      }

      GL11.glPopMatrix();
    }
  }
예제 #23
0
 private void drawFlagButton(int mouseX, int mouseY) {
   GL11.glPushMatrix();
   GL11.glTranslatef(
       this.buttonFlag_xPosition + 2.9F,
       this.buttonFlag_yPosition + this.buttonFlag_height + 1 - 4,
       0);
   GL11.glScalef(49.0F, 47.5F, 1F);
   GL11.glTranslatef(0.0F, 0.0F, 1.0F);
   GL11.glScalef(1.0F, 1.0F, -1F);
   this.dummyFlag.flagData = this.spaceRaceData.getFlagData();
   this.dummyModel.renderFlag(this.dummyFlag, 0.0625F, this.ticksPassed);
   GL11.glColor3f(1, 1, 1);
   GL11.glPopMatrix();
 }
  private void drawIcon(ForgeDirection direction, float scale, ItemStack content) {
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glScalef(1.0F, 1.0F, -1.0F); // stops the item appearing inside out
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); // rotates the item so it's not upside down

    translator.rotateTessellator(ForgeDirection.NORTH, direction, true);

    GL11.glScalef(scale, scale, scale); // shrinks the block down to the correct size
    GL11.glScalef(1.0F, 1.0F, 0.01F); // flattens the object by scaling Z to nothing

    DiscreteRenderHelper.renderItemFlatInWorld(content);
    GL11.glEnable(GL11.GL_LIGHTING);
  }
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    switch (type) {
      case EQUIPPED:
        {
          GL11.glPushMatrix();

          Minecraft.getMinecraft()
              .renderEngine
              .bindTexture(new ResourceLocation("kk", "textures/entities/LunarEclipse.png"));

          GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);

          GL11.glTranslatef(-0.6F, -1.2F, 0.0F);

          GL11.glScalef(0.9F, 0.9F, 0.9F);

          modelLunarEclipse.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

          GL11.glPopMatrix();
        }
      case EQUIPPED_FIRST_PERSON:
        {
          GL11.glPushMatrix();

          Minecraft.getMinecraft()
              .renderEngine
              .bindTexture(new ResourceLocation("kk", "textures/entities/LunarEclipse.png"));

          GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);

          GL11.glTranslatef(-0.6F, -1.2F, 0.0F);

          GL11.glScalef(0.9F, 0.9F, 0.9F);

          modelLunarEclipse.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

          GL11.glPopMatrix();
        }
      default:
        break;
    }
  }
  protected void func_48423_a(EntityOcelot par1EntityOcelot, float par2) {
    super.preRenderCallback(par1EntityOcelot, par2);

    if (par1EntityOcelot.isTamed()) {
      GL11.glScalef(0.8F, 0.8F, 0.8F);
    }
  }
  @Override
  public Pair<IBakedModel, Matrix4f> handlePerspective(
      ItemCameraTransforms.TransformType cameraTransformType) {
    // gui renders as 2D sprite; this is apparently also what renders when the item is dropped
    if (cameraTransformType == ItemCameraTransforms.TransformType.GUI) {
      RenderItem.applyVanillaTransform(baseModel.getItemCameraTransforms().gui);
      return Pair.of(baseModel, null);
    }

    GlStateManager.pushMatrix();
    GL11.glScalef(0.1F, 0.1F, 0.1F);
    switch (cameraTransformType) {
      case FIRST_PERSON:
        GlStateManager.translate(0.5F, 0.5F, 0.5F);
        GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(-40.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(-0.75F, 1.5F, 0.5F);
        break;
      case THIRD_PERSON:
        GlStateManager.rotate(100.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(90.0F, 0F, 1.0F, 0.0F);
        GlStateManager.translate(0.3F, -0.3F, 0.2F);
        GlStateManager.scale(0.5F, 0.5F, 0.5F);
        break;
      default:
        break;
    }
    Minecraft.getMinecraft().getTextureManager().bindTexture(getTexture1());
    // first Entity parameter not used for anything in ModelLegendsSword, so null is safe
    swordModel.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0475F);
    GlStateManager.popMatrix();
    // return empty model to render nothing - bomb model already rendered
    return Pair.of(emptyModel, null);
  }
 public static void renderItemStack(
     World world, ItemStack ghostStack, double x, double y, double z) {
   if (RenderManager.instance.renderEngine == null) {
     return; // rendering engine is still not initized!
   }
   if (ItemTessallator.customItemRenderer == null) {
     ItemTessallator.customItemRenderer = new CustomItemRenderer();
   }
   if (ghostStack != null) {
     if (world == null) {
       world = Minecraft.getMinecraft().theWorld;
     }
     EntityItem ghostEntityItem = new EntityItem(world, x, y, z);
     ghostEntityItem.hoverStart = 0.0F;
     ghostEntityItem.setEntityItemStack(ghostStack);
     float scale = 1.0f;
     if (ghostStack.getItem() instanceof ItemBlock) {
       scale = 0.9f;
     } else {
       scale = 0.6f;
     }
     GL11.glScalef(scale, scale, scale);
     ItemTessallator.renderEntityItem(ghostEntityItem);
   }
 }
  @Override
  public void drawScreen(int var1, int var2, float var3) {
    this.drawDefaultBackground();
    this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215);

    this.drawCenteredString(
        this.fontRendererObj,
        "Width: " + this.xzSize,
        this.width / 2,
        this.height / 4 + 40,
        16777215);
    this.drawCenteredString(
        this.fontRendererObj,
        "Height: " + this.ySize,
        this.width / 2,
        this.height / 4 + 80,
        16777215);

    GL11.glPushMatrix();
    GL11.glTranslatef((float) (this.width / 2), 0.0F, 50.0F);
    float var4 = 93.75F;
    GL11.glScalef(-var4, -var4, -var4);
    GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);

    GL11.glPopMatrix();
    super.drawScreen(var1, var2, var3);
  }
예제 #30
0
  @Optional.Method(modid = Mods.OpenComputers)
  public void render(ItemStack stack, MountPoint mountPoint, Robot robot, float pt) {
    if (!isUpgrade(stack)) {
      return;
    }

    Minecraft mc = Minecraft.getMinecraft();
    TextureManager tm = mc.getTextureManager();

    switch (stack.getItemDamage()) {
      case 1:
        {
          tm.bindTexture(upgradeChatBox);
          drawSimpleBlock(mountPoint, 0, true);
          break;
        }
      case 2:
        {
          if (mountPoint.name.equals(MountPointName.TopLeft)
              || mountPoint.name.equals(MountPointName.TopRight)) {
            float degrees =
                robot.shouldAnimate()
                    ? ((robot.world().getTotalWorldTime() + (robot.hashCode() ^ 0xFF)) % 160 + pt)
                        / 160F
                        * 360F
                    : 0F;
            if (mountPoint.name.equals(MountPointName.TopRight)) {
              degrees = 360 - degrees;
            }
            GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
            tm.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.glPopAttrib();
          } else {
            tm.bindTexture(upgradeRadar);
            drawSimpleBlock(mountPoint, 0, true);
          }
          break;
        }
      case 5:
        {
          tm.bindTexture(beepCard);
          drawSimpleBlock(mountPoint, 0, true);
          break;
        }
    }
  }