Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void RenderBlockModel(IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) {
- GL11.glPushMatrix();
- float xTrans = x % 16;
- float zTrans = z % 16;
- if (xTrans < 0) {
- xTrans = 16 + xTrans;
- }
- if (zTrans < 0) {
- zTrans = 16 + zTrans;
- }
- GL11.glTranslatef(xTrans, y % 16, zTrans); // move to current block
- GL11.glTranslatef(0.5f, 1.5f, 0.5f); // move to center of block
- GL11.glScalef(1.0F, -1F, -1.0F); // (normal, flip upright, flip z for culling purposes)
- GL11.glScalef(.0625f, .0625f, .0625f); // scale to block size
- int var15 = block.getMixedBrightnessForBlock(iblockaccess, x, y, z);
- int var8 = var15 % 65536;
- int var9 = var15 / 65536;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) var8 / 1.0F, (float) var9 / 1.0F);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- renderModel(model, iblockaccess, x, y, z);
- GL11.glPopMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement