Advertisement
Guest User

Untitled

a guest
Feb 4th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public void RenderBlockModel(IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) {
  2. GL11.glPushMatrix();
  3.  
  4. float xTrans = x % 16;
  5. float zTrans = z % 16;
  6. if (xTrans < 0) {
  7. xTrans = 16 + xTrans;
  8. }
  9. if (zTrans < 0) {
  10. zTrans = 16 + zTrans;
  11. }
  12.  
  13. GL11.glTranslatef(xTrans, y % 16, zTrans); // move to current block
  14. GL11.glTranslatef(0.5f, 1.5f, 0.5f); // move to center of block
  15. GL11.glScalef(1.0F, -1F, -1.0F); // (normal, flip upright, flip z for culling purposes)
  16. GL11.glScalef(.0625f, .0625f, .0625f); // scale to block size
  17.  
  18. int var15 = block.getMixedBrightnessForBlock(iblockaccess, x, y, z);
  19. int var8 = var15 % 65536;
  20. int var9 = var15 / 65536;
  21. OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) var8 / 1.0F, (float) var9 / 1.0F);
  22.  
  23. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  24.  
  25. renderModel(model, iblockaccess, x, y, z);
  26.  
  27. GL11.glPopMatrix();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement