예제 #1
0
  /**
   * Will render the specified entity at the specified partial tick time. Args: entity,
   * partialTickTime
   */
  public void renderEntity(Entity par1Entity, float par2) {
    if (par1Entity.ticksExisted == 0) {
      par1Entity.lastTickPosX = par1Entity.posX;
      par1Entity.lastTickPosY = par1Entity.posY;
      par1Entity.lastTickPosZ = par1Entity.posZ;
    }

    double d0 =
        par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double) par2;
    double d1 =
        par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double) par2;
    double d2 =
        par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double) par2;
    float f1 =
        par1Entity.prevRotationYaw + (par1Entity.rotationYaw - par1Entity.prevRotationYaw) * par2;
    int i = par1Entity.getBrightnessForRender(par2);

    if (par1Entity.isBurning()) {
      i = 15728880;
    }

    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.renderEntityWithPosYaw(
        par1Entity, d0 - renderPosX, d1 - renderPosY, d2 - renderPosZ, f1, par2);
  }
예제 #2
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;
    }
  }
  /** 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;
    }
  }
 @SideOnly(Side.CLIENT)
 @Override
 public int getColorFromItemStack(ItemStack stack, int renderPass) {
   OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 220f, 220f);
   // OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680f, 0f);
   return 16777215;
 }
예제 #5
0
    @Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      ItemStack output = getOutputStack();
      if (output != null) manager.gui.drawItemStack(output, startX + xPos, startY + yPos);
      // RenderHelper.disableStandardItemLighting();

      GL11.glDisable(GL11.GL_DEPTH_TEST);

      if (worktable.getMemory().isLocked(slotNumber)) {
        manager.gui.setZLevel(110f);
        Proxies.common.bindTexture(SpriteSheet.ITEMS);
        manager.gui.drawTexturedModelRectFromIcon(
            startX + xPos,
            startY + yPos,
            TextureManager.getInstance().getDefault("slots/locked"),
            16,
            16);
        manager.gui.setZLevel(0f);
      }

      GL11.glPopAttrib();
    }
예제 #6
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);
  }
  public void renderStabilizerSphere(TileParticleGenerator tile) {
    GL11.glPushMatrix();
    // GL11.glColor4f(0.5F, 0.0F, 0.0F, 1F);
    GL11.glColor4f(0.0F, 2.0F, 0.0F, 1F);
    GL11.glTranslated(0.5, 0, 0.5);
    GL11.glScalef(0.4F, 0.4F, 0.4F);
    if (!tile.stabalizerMode) {
      float red = (float) tile.beam_red / 255F;
      float green = (float) tile.beam_green / 255F;
      float blue = (float) tile.beam_blue / 255F;
      GL11.glColor4f(red, green, blue, 1F);
      GL11.glScalef(tile.beam_scale, tile.beam_scale, tile.beam_scale);
    }

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);

    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(modelTexture);

    GL11.glRotatef(tile.rotation, 0F, 1F, 0F);
    stabilizerSphereModel.renderAll();

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200);
    GL11.glRotatef(tile.rotation * 2, 0F, -1F, 0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDepthMask(false);
    GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F);
    if (!tile.stabalizerMode) {
      float red = (float) tile.beam_red / 255F;
      float green = (float) tile.beam_green / 255F;
      float blue = (float) tile.beam_blue / 255F;
      GL11.glColor4f(red, green, blue, 0.5F);
    }
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glScalef(1.3F, 1.3F, 1.3F);
    stabilizerSphereModel.renderAll();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);

    GL11.glPopMatrix();
  }
예제 #8
0
 private void adjustLightFixture(World w, int i, int j, int k, Block b) {
   Tessellator tess = Tessellator.instance;
   float brightness = b.getLightValue(w, i, j, k);
   int skyLight = w.getLightBrightnessForSkyBlocks(i, j, k, 0);
   int modulousModifier = skyLight % 65536;
   int divModifier = skyLight / 65536;
   tess.setColorOpaque_F(brightness, brightness, brightness);
   OpenGlHelper.setLightmapTextureCoords(
       OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);
 }
  @Override
  public void doRenderLayer(
      EntityAntiSpider entitylivingbaseIn,
      float p_177141_2_,
      float p_177141_3_,
      float partialTicks,
      float p_177141_5_,
      float p_177141_6_,
      float p_177141_7_,
      float scale) {
    spiderRenderer.bindTexture(SPIDER_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);

    if (entitylivingbaseIn.isInvisible()) GlStateManager.depthMask(false);
    else GlStateManager.depthMask(true);

    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    spiderRenderer
        .getMainModel()
        .render(
            entitylivingbaseIn,
            p_177141_2_,
            p_177141_3_,
            p_177141_5_,
            p_177141_6_,
            p_177141_7_,
            scale);
    i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
    j = i % 65536;
    k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
    spiderRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
  }
예제 #10
0
    @Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      manager.gui.drawItemStack(BOOK, startX + xPos, startY + yPos);

      GL11.glPopAttrib();
    }
  private void renderCupola(CupolaTE te) {
    if (te.isSlave()) return;
    final Tessellator instance = Tessellator.getInstance();

    final BlockPos pos = te.getPos();
    final World world = te.getWorld();

    // Lighting
    final float brightness = ModBlock.cupola.getMixedBrightnessForBlock(world, pos);
    final int skyLight = world.getLightBrightnessForSkyBlocks(pos, 0);
    final int skyLightLSB = skyLight % 65536;
    final int skyLightMSB = skyLight / 65536;

    final WorldRenderer worldRenderer = instance.getWorldRenderer();
    worldRenderer.setColorOpaque_F(brightness, brightness, brightness);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, skyLightLSB, skyLightMSB);

    // Open Render buffer
    GL11.glPushMatrix();

    // Inherent adjustments to model
    GL11.glScalef(SCALE.left, SCALE.middle, SCALE.right);
    GL11.glTranslatef(OFFSET.left, OFFSET.middle, OFFSET.right);

    // Orient the model to match the placement
    final IBlockState metadata = world.getBlockState(pos);
    final Orientation orientation = Orientation.getdecodedOrientation(metadata);

    GL11.glRotatef(getAngleFromOrientation(orientation), 0.0F, 1.0F, 0.0F);

    // Bind the texture
    if (te.isActive()) bindTexture(TEXTURE_ACTIVE);
    else bindTexture(TEXTURE);

    // Render
    model.render();

    // Close Render Buffer
    GL11.glPopMatrix();
  }
예제 #12
0
  /** Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. */
  protected int renderGlow(EntityDragonBoss par1entitydragonboss, int par2, float par3) {
    if (par2 == 1) GL11.glDepthFunc(GL11.GL_LEQUAL);

    if (par2 != 0) return -1;
    else {
      bindTexture(field_110845_h);
      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);
      GL11.glDepthFunc(GL11.GL_EQUAL);
      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;
    }
  }
예제 #13
0
 @Override
 public void doRender(Entity entity, double xPos, double yPos, double zPos, float f, float f1) {
   GL11.glPushMatrix();
   GL11.glTranslatef((float) xPos, (float) yPos, (float) zPos);
   this.bindEntityTexture(entity);
   int i = ((EntityCoin) entity).getTextureByCoin();
   float f2 = (float) (i % 4 * 16) / 64.0F;
   float f3 = (float) (i % 4 * 16 + 16) / 64.0F;
   float f4 = (float) (i / 4 * 16) / 64.0F;
   float f5 = (float) (i / 4 * 16 + 16) / 64.0F;
   float f6 = 1.0F;
   float f7 = 0.5F;
   float f8 = 0.25F;
   int j = entity.getBrightnessForRender(f1);
   int k = j % 65536;
   int l = j / 65536;
   OpenGlHelper.setLightmapTextureCoords(
       OpenGlHelper.lightmapTexUnit, (float) k / 1.0F, (float) l / 1.0F);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
   GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
   GL11.glScalef(0.3F, 0.3F, 0.3F);
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.setColorRGBA_I(0xFFFFFF, 128);
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   tessellator.addVertexWithUV(
       (double) (0.0F - f7), (double) (0.0F - f8), 0.0D, (double) f2, (double) f5);
   tessellator.addVertexWithUV(
       (double) (f6 - f7), (double) (0.0F - f8), 0.0D, (double) f3, (double) f5);
   tessellator.addVertexWithUV(
       (double) (f6 - f7), (double) (1.0F - f8), 0.0D, (double) f3, (double) f4);
   tessellator.addVertexWithUV(
       (double) (0.0F - f7), (double) (1.0F - f8), 0.0D, (double) f2, (double) f4);
   tessellator.draw();
   GL11.glDisable(GL11.GL_BLEND);
   GL11.glDisable(GL12.GL_RESCALE_NORMAL);
   GL11.glPopMatrix();
 }
  @Override
  public void renderTileEntityAt(
      TileEntity tile, double x, double y, double z, float timeSinceLastTick) {
    if (tile == null || !(tile instanceof TileEnergyStorageCore)) return;
    TileEnergyStorageCore core = (TileEnergyStorageCore) tile;
    if (!core.isOnline()) return;
    float scale = 0;
    float rotation = core.modelRotation + (timeSinceLastTick / 2F);

    switch (core.getTier()) {
      case 0:
        scale = 0.7F;
        break;
      case 1:
        scale = 1.2F;
        break;
      case 2:
        scale = 1.7F;
        break;
      case 3:
        scale = 2.5F;
        break;
      case 4:
        scale = 3.5F;
        break;
      case 5:
        scale = 4.5F;
        break;
      case 6:
        scale = 5.5F;
        break;
    }

    GL11.glPushMatrix();
    GL11.glColor4f(1F, 1F, 1F, 1F);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 150f, 150f);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture);

    double colour =
        (double) ((TileEnergyStorageCore) tile).getEnergyStored()
            / (double) ((TileEnergyStorageCore) tile).getMaxEnergyStored();
    float brightness = (float) Math.abs(Math.sin((float) Minecraft.getSystemTime() / 3000f) * 100f);

    colour = 1f - colour;
    GL11.glScalef(scale, scale, scale);
    GL11.glPushMatrix();
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    GL11.glColor4d(1F, colour * 0.3f, colour * 0.7f, 1F);
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, 80f + brightness, 80f + brightness);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glScalef(0.8F, 0.8F, 0.8F);
    GL11.glColor4d(1F, 1f, 0.2f, 1F);
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glScalef(0.9F, 0.9F, 0.9F);
    GL11.glColor4d(1F, 0f, 0.2f, 1F);
    GL11.glRotatef(rotation, 0F, 1F, 0.5F);
    iner_model.renderAll();
    GL11.glPopMatrix();

    GL11.glScalef(1.1F, 1.1F, 1.1F);
    GL11.glDepthMask(false);
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glRotatef(rotation * 0.5F, 0F, -1F, -0.5F);
    GL11.glColor4f(0.5F, 2F, 2F, 0.7F);
    iner_model.renderAll();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glPopMatrix();
  }
  @Override
  public void renderTileEntityAt(
      TileEntity tile, double screenX, double screenY, double screenZ, float partialTicks) {
    GL11.glPushMatrix();

    TileEntityDeconstructor d = (TileEntityDeconstructor) tile;

    GL11.glTranslated(screenX + 0.5D, screenY, screenZ + 0.5D);
    GL11.glScalef(0.4F, 0.4F, 0.4F);
    Minecraft.getMinecraft().renderEngine.bindTexture(frameIcon);
    model.renderPart("Cube_Cube.001");

    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    Minecraft.getMinecraft().renderEngine.bindTexture(glassIcon);
    model.renderPart("Plane");

    GL11.glEnable(GL11.GL_ALPHA_TEST);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
    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);

    if (d.hasAir) {
      Minecraft.getMinecraft().renderEngine.bindTexture(air);
      model.renderPart("Sphere");
    }

    if (d.hasFire) {
      Minecraft.getMinecraft().renderEngine.bindTexture(fire);
      model.renderPart("Sphere.001");
    }

    if (d.hasWater) {
      Minecraft.getMinecraft().renderEngine.bindTexture(water);
      model.renderPart("Sphere.002");
    }

    if (d.hasEarth) {
      Minecraft.getMinecraft().renderEngine.bindTexture(earth);
      model.renderPart("Sphere.003");
    }

    if (d.hasOrdo) {
      Minecraft.getMinecraft().renderEngine.bindTexture(ordo);
      model.renderPart("Sphere.004");
    }

    if (d.hasEntropy) {
      Minecraft.getMinecraft().renderEngine.bindTexture(entropy);
      model.renderPart("Sphere.005");
    }

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

    GL11.glPopMatrix();
  }
  public static void renderLaser(
      TileEntity host,
      double x,
      double y,
      double z,
      int length,
      ForgeDirection orientation,
      float partialTicks) {

    Tessellator tessellator = Tessellator.instance;
    GL11.glPushMatrix();

    double xStart = x;
    double yStart = y;
    double zStart = z;

    switch (orientation) {
      case DOWN:
        yStart -= length;
        break;
      case NORTH:
        GL11.glRotatef(270, 1, 0, 0);
        yStart = -z;
        zStart = y;
        break;
      case SOUTH:
        GL11.glRotatef(90, 1, 0, 0);
        yStart = z + 1;
        zStart = -y - 1;
        break;
      case EAST:
        GL11.glRotatef(270, 0, 0, 1);
        yStart = x + 1;
        xStart = -y - 1;
        break;
      case WEST:
        GL11.glRotatef(90, 0, 0, 1);
        yStart = -x;
        xStart = y;
        break;
      default:
        break;
    }
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
    RenderHelper.disableStandardItemLighting();
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    float ticks = (Minecraft.getMinecraft().ingameGUI.getUpdateCounter() + partialTicks);
    float f3 = -ticks * 0.2F - MathHelper.floor_float(-ticks * 0.1F);
    double d3 = ticks * 0.025D * (1.0D - 2.5D);
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA(r, g, b, 32);
    double d4 = 0.2D;
    double d5 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d4;
    double d6 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d4;
    double d7 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d4;
    double d8 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d4;
    double d9 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d4;
    double d10 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d4;
    double d11 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d4;
    double d12 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d4;
    double height = length;
    double uStart = 0.0D;
    double uEnd = 1.0D;
    double vStart = -1.0F + f3;
    double vEnd = (height * 4) + vStart;
    tessellator.addVertexWithUV(xStart + d5, yStart + height, zStart + d6, uEnd, vEnd);
    tessellator.addVertexWithUV(xStart + d5, yStart, zStart + d6, uEnd, vStart);
    tessellator.addVertexWithUV(xStart + d7, yStart, zStart + d8, uStart, vStart);
    tessellator.addVertexWithUV(xStart + d7, yStart + height, zStart + d8, uStart, vEnd);
    tessellator.addVertexWithUV(xStart + d11, yStart + height, zStart + d12, uEnd, vEnd);
    tessellator.addVertexWithUV(xStart + d11, yStart, zStart + d12, uEnd, vStart);
    tessellator.addVertexWithUV(xStart + d9, yStart, zStart + d10, uStart, vStart);
    tessellator.addVertexWithUV(xStart + d9, yStart + height, zStart + d10, uStart, vEnd);
    tessellator.addVertexWithUV(xStart + d7, yStart + height, zStart + d8, uEnd, vEnd);
    tessellator.addVertexWithUV(xStart + d7, yStart, zStart + d8, uEnd, vStart);
    tessellator.addVertexWithUV(xStart + d11, yStart, zStart + d12, uStart, vStart);
    tessellator.addVertexWithUV(xStart + d11, yStart + height, zStart + d12, uStart, vEnd);
    tessellator.addVertexWithUV(xStart + d9, yStart + height, zStart + d10, uEnd, vEnd);
    tessellator.addVertexWithUV(xStart + d9, yStart, zStart + d10, uEnd, vStart);
    tessellator.addVertexWithUV(xStart + d5, yStart, zStart + d6, uStart, vStart);
    tessellator.addVertexWithUV(xStart + d5, yStart + height, zStart + d6, uStart, vEnd);
    tessellator.draw();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDepthMask(false);
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA(255, 255, 255, 48);
    double d18 = 0.2D;
    double d19 = 0.2D;
    double d20 = 0.8D;
    double d21 = 0.2D;
    double d22 = 0.2D;
    double d23 = 0.8D;
    double d24 = 0.8D;
    double d25 = 0.8D;
    double d29 = -1.0F + f3;
    double d30 = (height * 2) + d29;
    tessellator.addVertexWithUV(xStart + d18, yStart + height, zStart + d19, uEnd, d30);
    tessellator.addVertexWithUV(xStart + d18, yStart, zStart + d19, uEnd, d29);
    tessellator.addVertexWithUV(xStart + d20, yStart, zStart + d21, uStart, d29);
    tessellator.addVertexWithUV(xStart + d20, yStart + height, zStart + d21, uStart, d30);
    tessellator.addVertexWithUV(xStart + d24, yStart + height, zStart + d25, uEnd, d30);
    tessellator.addVertexWithUV(xStart + d24, yStart, zStart + d25, uEnd, d29);
    tessellator.addVertexWithUV(xStart + d22, yStart, zStart + d23, uStart, d29);
    tessellator.addVertexWithUV(xStart + d22, yStart + height, zStart + d23, uStart, d30);
    tessellator.addVertexWithUV(xStart + d20, yStart + height, zStart + d21, uEnd, d30);
    tessellator.addVertexWithUV(xStart + d20, yStart, zStart + d21, uEnd, d29);
    tessellator.addVertexWithUV(xStart + d24, yStart, zStart + d25, uStart, d29);
    tessellator.addVertexWithUV(xStart + d24, yStart + height, zStart + d25, uStart, d30);
    tessellator.addVertexWithUV(xStart + d22, yStart + height, zStart + d23, uEnd, d30);
    tessellator.addVertexWithUV(xStart + d22, yStart, zStart + d23, uEnd, d29);
    tessellator.addVertexWithUV(xStart + d18, yStart, zStart + d19, uStart, d29);
    tessellator.addVertexWithUV(xStart + d18, yStart + height, zStart + d19, uStart, d30);

    tessellator.draw();
    setColor(0xFFFFFF);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }