wasliebob

BlockSideRotation

Apr 23rd, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. public void renderTileEntityAt(TileEntity tile, double x, double y,
  2. double z, float var8){
  3. Minecraft mc = Minecraft.getMinecraft();
  4. World world = mc.theWorld;
  5.  
  6. Block bl = world.getBlock(tile.xCoord, tile.yCoord, tile.zCoord);
  7.  
  8. if(bl != null && tile != null && tile instanceof TileEntityEssentiaBarrel){
  9. TileEntityEssentiaBarrel barrel = (TileEntityEssentiaBarrel)tile;
  10.  
  11. if(barrel != null && barrel.getAspect() != null){
  12. OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
  13. GL11.glDisable(GL11.GL_TEXTURE_2D);
  14. OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
  15. GL11.glEnable(GL11.GL_TEXTURE_2D);
  16.  
  17. Minecraft.getMinecraft().getTextureManager().bindTexture(getAspectIcon(barrel.getAspect()));
  18. Tessellator tessellator = Tessellator.instance;
  19.  
  20. GL11.glPushMatrix();
  21. GL11.glTranslated(x, y +1, z);
  22. // GL11.glRotate(90D, 0D, 1D, 1D);
  23.  
  24. tessellator.startDrawingQuads();
  25. double d1 = 0.0001D;
  26. Color color = new Color(barrel.getAspect().getColor());
  27. tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
  28.  
  29. /** South */
  30. tessellator.addVertexWithUV((double)x, (double)y + 1.0D, (double)z - d1, 0.0D, 0.0D);
  31. tessellator.addVertexWithUV((double)x + 1.0D, (double)y + 1.0D, (double)z - d1, 1.0D, 0.0D);
  32. tessellator.addVertexWithUV((double)x + 1.0D, (double)y + 0.0D, (double)z - d1, 1.0D, 1.0D);
  33. tessellator.addVertexWithUV((double)x, (double)y + 0.05D, (double)z - d1, 0.0D, 1.0D);
  34.  
  35. tessellator.draw();
  36.  
  37. GL11.glPopMatrix();
  38.  
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment