Exemplo n.º 1
0
 private void RenderMissileInInv(RenderBlocks renderer, Block block, int metadata) {
   Tessellator tesselator = Tessellator.instance;
   int sideTex = 0;
   int topTex = 0;
   for (int i = 0; i < 6; i++) {
     // Get bounds for each rectangle
     if (i == 0) block.setBlockBounds(0.4F, 0.95F, 0.4F, 0.6F, 1.0F, 0.6F);
     else if (i == 1) block.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.95F, 0.7F);
     else if (i == 2) block.setBlockBounds(0.4F, 0F, 0.1F, 0.6F, 0.4F, 0.3F);
     else if (i == 3) block.setBlockBounds(0.4F, 0F, 0.7F, 0.6F, 0.4F, 0.9F);
     else if (i == 4) block.setBlockBounds(0.1F, 0F, 0.4F, 0.3F, 0.4F, 0.6F);
     else if (i == 5) block.setBlockBounds(0.7F, 0F, 0.4F, 0.9F, 0.4F, 0.6F);
     // Get textures
     if (i == 0 && metadata != 0 && metadata != 15) {
       topTex = 15;
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (i == 0) {
       topTex = 18;
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (i == 1 && metadata != 0 && metadata != 15) {
       sideTex = block.getBlockTextureFromSideAndMetadata(1, 1);
       topTex = block.getBlockTextureFromSideAndMetadata(1, 1);
     } else if (i == 1) {
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
       topTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (metadata != 0 && metadata != 15) {
       sideTex = topTex = 15;
     } else {
       sideTex = topTex = 18;
     }
     GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, -1.0F, 0.0F);
     renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 1.0F, 0.0F);
     renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, topTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 0.0F, -1.0F);
     renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 0.0F, 1.0F);
     renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(-1.0F, 0.0F, 0.0F);
     renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(1.0F, 0.0F, 0.0F);
     renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   }
   block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
 }
Exemplo n.º 2
0
 private void RenderMachineInInv(RenderBlocks renderer, Block block, int metadata) {
   Tessellator tesselator = Tessellator.instance;
   block.setBlockBounds(0, 0, 0, 1, 1, 1);
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderBottomFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderTopFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderEastFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderWestFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderNorthFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderSouthFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata));
   tesselator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }