gt:             double minU = iconToUse.getMinU();
context: package com.bluepowermod.part.lamp;
  
  import java.util.List;
  
  import net.minecraft.client.Minecraft;
  import net.minecraft.client.renderer.Tessellator;
  import net.minecraft.client.renderer.texture.TextureMap;
  import net.minecraft.creativetab.CreativeTabs;
  import net.minecraft.item.ItemStack;
  import net.minecraft.util.AxisAlignedBB;
  import net.minecraft.util.IIcon;
  import net.minecraft.world.EnumSkyBlock;
  import net.minecraftforge.client.IItemRenderer.ItemRenderType;
  import net.minecraftforge.common.util.ForgeDirection;
  
  import org.lwjgl.opengl.GL11;
  
  import com.bluepowermod.api.helper.RedstoneHelper;
  import com.bluepowermod.api.part.BPPartFace;
  import com.bluepowermod.api.part.RedstoneConnection;
  import com.bluepowermod.api.vec.Vector3;
  import com.bluepowermod.api.vec.Vector3Cube;
  import com.bluepowermod.client.renderers.IconSupplier;
  import com.bluepowermod.client.renderers.RenderHelper;
  import com.bluepowermod.init.CustomTabs;
  
  /**
   * Base class for the lamps that are multiparts.
   * 
   * @author Koen Beckers (K4Unl)
   * 
   */
  public class PartLamp extends BPPartFace {
  
      protected String colorName;
      private int colorVal;
      protected boolean inverted;
  
      protected int power = 0;
  
      /**
       * @author amadornes
       * @param colorName
       * @param colorVal
       * @param inverted
       *            TODO
       */
      public PartLamp(String colorName, Integer colorVal, Boolean inverted) {
  
          this.colorName = colorName;
          this.colorVal = colorVal;
          this.inverted = inverted;
  
          for (int i = 0; i < 4; i++)
              connections[i] = new RedstoneConnection(this, i + "", true, false);
  
          for (RedstoneConnection c : connections) {
              c.enable();
              c.setInput();
          }
      }
  
      @Override
      public String getType() {
  
          return (inverted ? "inverted" : "") + "lamp" + colorName;
      }
  
      /**
       * @author amadornes
       */
      @Override
      public String getUnlocalizedName() {
  
          return (inverted ? "inverted" : "") + "lamp." + colorName;
      }
  
      /**
       * @author amadornes
       */
      @Override
      public void addCollisionBoxes(List<AxisAlignedBB> boxes) {
  
          addSelectionBoxes(boxes);
      }
  
      /**
       * @author Koen Beckers (K4Unl)
       */
  
      @Override
      public void addSelectionBoxes(List<AxisAlignedBB> boxes) {
  
          boxes.add(AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
      }
  
      /**
       * @author amadornes
       */
      @Override
      public void addOcclusionBoxes(List<AxisAlignedBB> boxes) {
  
          addSelectionBoxes(boxes);
      }
  
      /**
       * @author Koen Beckers (K4Unl)
       */
      @Override
      public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
  
          power = inverted ? 15 : 0;
  
          GL11.glPushMatrix();
          GL11.glTranslated(0.5, 0.5, 0.5);
          GL11.glRotated(180, 1, 0, 0);
          GL11.glTranslated(-0.5, -0.5, -0.5);
          Tessellator t = Tessellator.instance;
          Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
          GL11.glPushMatrix();
          t.startDrawingQuads();
          renderStatic(new Vector3(0, 0, 0), 0);
          t.draw();
          GL11.glPopMatrix();
          GL11.glPushMatrix();
          t.startDrawingQuads();
          renderStatic(new Vector3(0, 0, 0), 1);
          t.draw();
          GL11.glPopMatrix();
          Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
          GL11.glPopMatrix();
      }
  
      /**
       * @author Koen Beckers (K4Unl)
       */
      @Override
      public boolean renderStatic(Vector3 loc, int pass) {
  
          rotateAndTranslateDynamic(loc, pass, 0);
          Tessellator t = Tessellator.instance;
          t.setColorOpaque_F(1, 1, 1);
  
          // Render base
          renderBase(pass);
  
          // Color multiplier
          int redMask = 0xFF0000, greenMask = 0xFF00, blueMask = 0xFF;
          int r = (colorVal & redMask) >> 16;
          int g = (colorVal & greenMask) >> 8;
          int b = (colorVal & blueMask);
  
          t.setColorOpaque(r, g, b);
          // Render lamp itself here
          renderLamp(pass, r, g, b);
  
          return true;
      }
  
      @Override
      public boolean shouldRenderStaticOnPass(int pass) {
  
          return true;
      }
  
      /**
       * Code to render the base portion of the lamp. Will not be colored
       * 
       * @author Koen Beckers (K4Unl)
       * @param pass
       *            The pass that is rendered now. Pass 1 for solids. Pass 2 for transparents
       */
      public void renderBase(int pass) {
  
      }
  
      /**
       * Code to render the actual lamp portion of the lamp. Will be colored
       * 
       * @author Koen Beckers (K4Unl)
       * @param pass
       *            The pass that is rendered now. Pass 1 for solids. Pass 2 for transparents
       * @param r
       *            The ammount of red in the lamp
       * @param g
       *            The ammount of green in the lamp
       * @param b
       *            The ammount of blue in the lamp
       */
      public void renderLamp(int pass, int r, int g, int b) {
  
          Vector3Cube vector = new Vector3Cube(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  
          if (pass == 0) {
              Tessellator t = Tessellator.instance;
              IIcon iconToUse;
              if (power == 0) {
                  iconToUse = IconSupplier.lampOff;
              } else {
                  iconToUse = IconSupplier.lampOn;
  
                  /*
                   * t.setColorRGBA(r, g, b, 20); RenderHelper.drawTesselatedCube(new Vector3Cube(pixel * 4.5, pixel * 2, pixel * 4.5, 1.0 -
                   * (pixel*4.5), 1.0 - (pixel * 4.5), 1.0 - pixel * 4.5)); t.setColorRGBA(r, g, b, 255);
                   */
              }
  
  