Advertisement
p1rx

Untitled

Nov 24th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1.     @Override
  2.     public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
  3.         Tessellator tessellator = Tessellator.instance;
  4.         IIcon icon = block.getIcon(0, 0);
  5.         tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);
  6.  
  7.         for (GroupObject groupObject : model.groupObjects) {
  8.             for (Face face : groupObject.faces) {
  9.                 int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
  10.                 tessellator.setBrightness(brightness);
  11.                 tessellator.setColorOpaque_F(1F, 1F, 1F);
  12.                 for (int i = 0; i < face.vertices.length; ++i) {
  13.                     tessellator.addVertexWithUV(face.vertices[i].x, face.vertices[i].y, face.vertices[i].z,
  14.                             icon.getInterpolatedU(face.textureCoordinates[i].u * 16),
  15.                             icon.getInterpolatedV(face.textureCoordinates[i].v * 16));
  16.                 }
  17.             }
  18.         }
  19.         tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F);
  20.         return true;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement