Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.darki.util;
- import org.lwjgl.opengl.GL11;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- public class TileEntityRenderPipe extends TileEntitySpecialRenderer {
- ResourceLocation texture = new ResourceLocation(me.darki.Mixture.MODID, "textures/blocks/pPipe.png");
- float pixel = 1F/16F;
- float tPixel = 1F/32F;
- public void renderTileEntityAt(TileEntity tileentity, double translationX, double translationY, double translationZ, float f, int i) {
- GL11.glTranslated(translationX, translationY, translationZ);
- GL11.glDisable(GL11.GL_LIGHTING);
- this.bindTexture(texture);
- drawCore(tileentity);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glTranslated(-translationX, -translationY, -translationZ);
- }
- public void drawCore(TileEntity tileentity){
- Tessellator tessellator = Tessellator.->instance;
- tessellator.startDrawingQuads();
- {
- tessellator.addVertexWithUV(1-11*pixel/2, 11*pixel/2, 11*pixel/2, 5*tPixel, 5*tPixel);
- tessellator.addVertexWithUV(1-11*pixel/2, 1-11*pixel/2, 11*pixel/2, 5*tPixel, 0*tPixel);
- tessellator.addVertexWithUV(11*pixel/2, 1-11*pixel/2, 11*pixel/2, 0*tPixel, 0*tPixel);
- tessellator.addVertexWithUV(11*pixel/2, 11*pixel/2, 11*pixel/2, 0*tPixel, 5*tPixel);
- }
- tessellator.draw();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement