@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);
 }
Exemplo n.º 2
0
  public void renderCloud(
      EntityCloudParachute var1, double var2, double var4, double var6, float var8, float var9) {
    GL11.glPushMatrix();

    if (var1.getRidingHandler().isBeingRidden()) {
      EntityLiving var10 = var1.getRidingHandler().getRider();
      var2 = var10.lastTickPosX + (var10.posX - var10.lastTickPosX) * (double) var9;
      var4 = var10.lastTickPosY - 1.68D + (var10.posY - var10.lastTickPosY) * (double) var9;
      var6 = var10.lastTickPosZ + (var10.posZ - var10.lastTickPosZ) * (double) var9;
      var2 -= RenderManager.renderPosX;
      var4 -= RenderManager.renderPosY;
      var6 -= RenderManager.renderPosZ;
      var8 =
          (float)
              ((double) var10.prevRotationYaw
                  + (double) (var10.rotationYaw - var10.prevRotationYaw) * var2);
    }

    GL11.glTranslatef((float) var2, (float) var4, (float) var6);
    GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F);
    this.loadTexture("/net/aetherteam/aether/client/sprites/aetherBlocks.png");
    GL11.glEnable(GL11.GL_LIGHTING);
    renderBlocks.renderBlockAsItem(
        AetherBlocks.Aercloud, var1.getColor() ? 2 : 0, var1.getBrightness(var9));
    GL11.glPopMatrix();
  }
  @Override
  public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_FOG);

    int age = var1.ticksExisted * 5;

    float size = 0.5F; // - (age * 0.03F);

    if (size < 0) size = 0;

    GL11.glTranslatef((float) var2, (float) var4, (float) var6);
    this.loadTexture("/terrain.png");
    World var11 = var1.worldObj;
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glRotatef((float) (age * 0.1F * 180.0D / 12.566370964050293D - 0.0D), 1.0F, 0.0F, 0.0F);
    GL11.glRotatef((float) (age * 0.1F * 180.0D / (Math.PI * 2D) - 0.0D), 0.0F, 1.0F, 0.0F);
    GL11.glRotatef((float) (age * 0.1F * 180.0D / (Math.PI * 2D) - 0.0D), 0.0F, 0.0F, 1.0F);
    RenderBlocks rb = new RenderBlocks(var1.worldObj);
    GL11.glScalef(size, size, size);
    // Tessellator tess = Tessellator.instance;
    // tess.setBrightness(255);
    // tess.setColorOpaque_F(255, 255, 255);
    // renderBlock = Block.netherrack;
    rb.setRenderBoundsFromBlock(renderBlock);
    rb.renderBlockAsItem(renderBlock, 0, 0.8F);

    GL11.glEnable(GL11.GL_FOG);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
  }
  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();
  }
Exemplo n.º 5
0
 public void renderToInventory(ItemStack item, RenderBlocks renderBlocks) {
   Block block = PainterUtil.getSourceBlock(item);
   if (block != null) {
     renderBlocks.setOverrideBlockTexture(
         renderBlocks.getBlockIconFromSideAndMetadata(block, 2, item.getItemDamage()));
   }
   renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0f);
   renderBlocks.clearOverrideBlockTexture();
 }
Exemplo n.º 6
0
  public void renderObsidianTNT(
      EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float f, float f1) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glScalef(0.8F, 0.8F, 0.8F);

    if ((entityobsidiantnt.fuse - f1) + 1.0F < 10F) {
      float scale = 1.0F - ((entityobsidiantnt.fuse - f1) + 1.0F) / 10F;

      if (scale < 0.0F) {
        scale = 0.0F;
      }

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

      scale *= scale;
      scale *= scale;
      float renderScale = 1.0F + scale * 0.3F;
      GL11.glScalef(renderScale, renderScale, renderScale);
    }

    float f3 = (1.0F - ((entityobsidiantnt.fuse - f1) + 1.0F) / 100F) * 0.8F;
    func_110777_b(entityobsidiantnt);
    blockRenderer.renderBlockAsItem(Mekanism.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1));

    if (entityobsidiantnt.fuse / 5 % 2 == 0) {
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);
      blockRenderer.renderBlockAsItem(Mekanism.ObsidianTNT, 0, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glDisable(GL11.GL_BLEND);
      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
    }

    GL11.glPopMatrix();
  }
Exemplo n.º 7
0
  public void renderEquipped(ItemStack item, RenderBlocks renderBlocks) {
    Block block = PainterUtil.getSourceBlock(item);
    if (block != null) {
      renderBlocks.setOverrideBlockTexture(
          renderBlocks.getBlockIconFromSideAndMetadata(block, 2, item.getItemDamage()));
    }

    GL11.glPushMatrix();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0f);
    GL11.glPopMatrix();
    renderBlocks.clearOverrideBlockTexture();
  }
  @Override
  protected void renderBlock(RenderBlocks renderer) {
    FMLClientHandler.instance()
        .getClient()
        .renderEngine
        .bindTexture(TextureMap.locationBlocksTexture);

    OpenGLHelper.pushMatrix();
    OpenGLHelper.scale(0.75 * 0.75, 0.75 * 0.75, 0.75 * 0.75);
    OpenGLHelper.rotate(270, 0, 1, 0);
    OpenGLHelper.translate(0.0F, 6 / 16.0F, 0.0F);
    renderer.renderBlockAsItem(Blocks.furnace, 0, 1);
    OpenGLHelper.colour(1.0F, 1.0F, 1.0F, 1.0F);
    OpenGLHelper.popMatrix();
  }
Exemplo n.º 9
0
 protected void doRenderMachine(double x, double y, HandbookEntry he) {
   HandbookRegistry h = (HandbookRegistry) he;
   MachineRegistry m = h.getMachine();
   if (m == null) return;
   MaterialRegistry[] mats = MaterialRegistry.values();
   TileEntity te = m.createTEInstanceForRender(0);
   int timeStep = (int) ((System.nanoTime() / SECOND) % mats.length);
   int r = (int) (System.nanoTime() / 20000000) % 360;
   float variable = 0;
   if (h.isEngine() && h != HandbookRegistry.SOLAR) {
     // ((TileEntityEngine)te).type = EngineType.engineList[h.getOffset()];
     // variable = -1000F*(h.getOffset()+1);
     EngineType type = EngineType.engineList[h.getOffset()];
     te = type.getTEInstanceForRender();
     ((TileEntityEngine) te).setType(type.getCraftedProduct());
   }
   if (h == HandbookRegistry.SHAFT) {
     variable = -1000F * (timeStep + 1);
   }
   if (h == HandbookRegistry.FLYWHEEL) {
     int tick = (int) ((System.nanoTime() / SECOND) % RotaryNames.getNumberFlywheelTypes());
     variable = 500 - 1000F * (tick + 1);
   }
   if (h == HandbookRegistry.GEARBOX) {
     variable = -1000F * (timeStep + 1);
   }
   if (h == HandbookRegistry.WORM) {
     variable = -1000F;
   }
   if (h == HandbookRegistry.CVT) {
     variable = -2000F;
   }
   if (h == HandbookRegistry.COIL) {
     int tick = (int) ((System.nanoTime() / SECOND) % 2);
     if (tick == 1) ((TileEntityAdvancedGear) te).setBedrock(true);
     variable = -3000F;
   }
   double sc = 48;
   GL11.glPushMatrix();
   if (m.hasModel() && !m.isPipe()) {
     double dx = x;
     double dy = y + 21;
     double dz = 0;
     GL11.glTranslated(dx, dy, dz);
     GL11.glScaled(sc, -sc, sc);
     GL11.glRotatef(renderq, 1, 0, 0);
     GL11.glRotatef(r, 0, 1, 0);
     TileEntityRendererDispatcher.instance.renderTileEntityAt(te, -0.5, 0, -0.5, variable);
   } else {
     double dx = x;
     double dy = y;
     double dz = 0;
     GL11.glTranslated(dx, dy, dz);
     GL11.glScaled(sc, -sc, sc);
     GL11.glRotatef(renderq, 1, 0, 0);
     GL11.glRotatef(r, 0, 1, 0);
     ReikaTextureHelper.bindTerrainTexture();
     rb.renderBlockAsItem(m.getBlock(), m.getBlockMetadata(), 1);
   }
   GL11.glPopMatrix();
 }