Advertisement
Guest User

dragon death

a guest
Oct 7th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.71 KB | None | 0 0
  1.     @Override
  2.     protected void preRenderCallback(EntityLivingBase entityLivingBase, float partialTickTime) {
  3.         float rot = (float)(720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
  4.  
  5.         GlStateManager.pushMatrix();
  6.         GlStateManager.rotate(180, 0F, 0F, 1F);
  7.         GlStateManager.pushMatrix();
  8.         GlStateManager.rotate(rot, 0.0F, 0.5F, 0.0F);
  9.         GlStateManager.rotate(rot / 2, 0.0F, 0.0F, 0.5F);
  10.         renderDragonDeath(180, 0.0F, 0.0F, 0.0F);
  11.         GlStateManager.popMatrix();
  12.         GlStateManager.popMatrix();
  13.     }
  14.  
  15.     private void renderDragonDeath(float density, float x, float y, float z) {
  16.         Tessellator tessellator = Tessellator.getInstance();
  17.         WorldRenderer worldrenderer = tessellator.getWorldRenderer();
  18.         RenderHelper.disableStandardItemLighting();
  19.         float f7 = density / 200.0F;
  20.         float f8 = 0.0F;
  21.  
  22.         if (f7 > 0.8F) f8 = (f7 - 0.8F) / 0.2F;
  23.  
  24.         Random random = new Random(432L);
  25.         GlStateManager.disableTexture2D();
  26.         GlStateManager.shadeModel(7425);
  27.         GlStateManager.enableBlend();
  28.         GlStateManager.blendFunc(770, 1);
  29.         GlStateManager.disableAlpha();
  30.         GlStateManager.enableCull();
  31.         GlStateManager.depthMask(false);
  32.         GlStateManager.pushMatrix();
  33.         GlStateManager.translate(x, y, z);
  34.  
  35.         for (int i = 0;
  36.         (float) i < (f7 + f7 * f7) / 2.0F * 60.0F; ++i) {
  37.             GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
  38.             GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
  39.             GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
  40.             GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
  41.             GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
  42.             GlStateManager.rotate(random.nextFloat() * 360.0F + f7 * 90.0F, 0.0F, 0.0F, 1.0F);
  43.             worldrenderer.startDrawing(6);
  44.             float f9 = random.nextFloat() * 20.0F + 5.0F + f8 * 10.0F;
  45.             float f10 = random.nextFloat() * 2.0F + 1.0F + f8 * 2.0F;
  46.             worldrenderer.setColorRGBA_I(16760576, (int)(255.0F * (1.0F - f8)));
  47.  
  48.             worldrenderer.addVertex(0.0D, 0.0D, 0.0D);
  49.             worldrenderer.setColorRGBA_I(16711680, 0);
  50.             worldrenderer.addVertex(-0.866D * (double) f10, (double) f9, (double)(-0.5F * f10));
  51.             worldrenderer.addVertex(0.866D * (double) f10, (double) f9, (double)(-0.5F * f10));
  52.             worldrenderer.addVertex(0.0D, (double) f9, (double)(1.0F * f10));
  53.             worldrenderer.addVertex(-0.866D * (double) f10, (double) f9, (double)(-0.5F * f10));
  54.             tessellator.draw();
  55.         }
  56.  
  57.         GlStateManager.popMatrix();
  58.         GlStateManager.depthMask(true);
  59.         GlStateManager.disableCull();
  60.         GlStateManager.disableBlend();
  61.         GlStateManager.shadeModel(7424);
  62.         GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  63.         GlStateManager.enableTexture2D();
  64.         GlStateManager.enableAlpha();
  65.         RenderHelper.enableStandardItemLighting();
  66.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement