Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. private static final ResourceLocation TEX = new ResourceLocation(Knowledge.MODID+":"+"textures/models/ThaumTank_model.png");
  2.  
  3. private ModelThaumTank model;
  4.  
  5. public ThaumTankRenderer() {
  6. this.model = new ModelThaumTank();
  7. }
  8.  
  9.  
  10. private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {
  11. int meta = world.getBlockMetadata(x, y, z);
  12. GL11.glPushMatrix();
  13. GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
  14. GL11.glPopMatrix();
  15. }
  16.  
  17.  
  18.  
  19. @Override
  20. public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
  21.  
  22. GL11.glPushMatrix();
  23. GL11.glTranslatef((float)x+0.5F, (float)y+1.5F, (float)z+0.5F);
  24. Minecraft.getMinecraft().renderEngine.bindTexture(TEX);
  25. GL11.glPushMatrix();
  26. GL11.glRotatef(180, 0F, 0F, 1F);
  27. this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
  28. GL11.glPopMatrix();
  29. GL11.glPopMatrix();
  30.  
  31. }
  32.  
  33. private void adjustLightFixture(World world, int i, int j, int k, Block block) {
  34. Tessellator tess = Tessellator.instance;
  35. //float brightness = block.getBlockBrightness(world, i, j, k);
  36. //As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue():
  37. float brightness = block.getLightValue(world, i, j, k);
  38. int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
  39. int modulousModifier = skyLight % 65536;
  40. int divModifier = skyLight / 65536;
  41. tess.setColorOpaque_F(brightness, brightness, brightness);
  42. OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement