Advertisement
RS_Darki

Untitled

Oct 25th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. package me.darki.util;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.client.renderer.Tessellator;
  6. import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
  7. import net.minecraft.tileentity.TileEntity;
  8. import net.minecraft.util.ResourceLocation;
  9.  
  10. public class TileEntityRenderPipe extends TileEntitySpecialRenderer {
  11.  
  12. ResourceLocation texture = new ResourceLocation(me.darki.Mixture.MODID, "textures/blocks/pPipe.png");
  13.  
  14. float pixel = 1F/16F;
  15. float tPixel = 1F/32F;
  16.  
  17. public void renderTileEntityAt(TileEntity tileentity, double translationX, double translationY, double translationZ, float f, int i) {
  18.  
  19. GL11.glTranslated(translationX, translationY, translationZ);
  20. GL11.glDisable(GL11.GL_LIGHTING);
  21. this.bindTexture(texture);
  22. drawCore(tileentity);
  23. GL11.glEnable(GL11.GL_LIGHTING);
  24. GL11.glTranslated(-translationX, -translationY, -translationZ);
  25.  
  26. }
  27.  
  28. public void drawCore(TileEntity tileentity){
  29.  
  30. Tessellator tessellator = Tessellator.->instance;
  31. tessellator.startDrawingQuads();
  32. {
  33. tessellator.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 5*tPixel, 5*tPixel);
  34. tessellator.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*tPixel, 0*tPixel);
  35. tessellator.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*tPixel, 0*tPixel);
  36. tessellator.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 0*tPixel, 5*tPixel);
  37.  
  38. }
  39. tessellator.draw();
  40.  
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement