Advertisement
Guest User

Untitled

a guest
Dec 28th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. package hu.laci200270.energymod.client.tesrs;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.client.renderer.GlStateManager;
  5. import net.minecraft.client.renderer.Tessellator;
  6. import net.minecraft.client.renderer.texture.TextureManager;
  7. import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
  8. import net.minecraft.tileentity.TileEntity;
  9. import net.minecraft.util.ResourceLocation;
  10. import org.lwjgl.opengl.GL11;
  11.  
  12.  
  13. /**
  14.  * Created by Laci on 2015. 12. 27..
  15.  */
  16. public class TesrEnergyCell extends TileEntitySpecialRenderer {
  17.  
  18.  
  19.  
  20.  
  21.     @Override
  22.     public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {
  23.         GL11.glPushMatrix();
  24.  
  25.  
  26.  
  27.  
  28.  
  29.         Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("miencraft:diamond_block"));
  30.        Tessellator.getInstance().getWorldRenderer().startDrawing(GL11.GL_TRIANGLE_FAN);
  31.         GL11.glTranslated(te.getPos().getX()+1, te.getPos().getY()+1, te.getPos().getZ()+1);
  32.         int NUM_PIZZA_SLICES=2000;
  33.         for(int i = 0; i <= NUM_PIZZA_SLICES; i++){ //NUM_PIZZA_SLICES decides how round the circle looks.
  34.             double SUBDIVISIONS=180;
  35.             double angle = Math.PI * 2 * i / SUBDIVISIONS;
  36.             //GL11.glVertex2f((float) Math.cos(angle), (float) Math.sin(angle));
  37.             Tessellator.getInstance().getWorldRenderer().addVertex((float) Math.cos(angle),(float) Math.sin(angle),z);
  38.         }
  39.  
  40.         Tessellator.getInstance().draw();
  41.         GlStateManager.popMatrix();
  42.  
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement