Advertisement
Corosus

Untitled

Mar 5th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.53 KB | None | 0 0
  1. public static void renderPFLines(EntityLiving entityliving, double d, double d1, double d2,
  2.             float f, float f1) {
  3.        
  4.         if (renderLine) {
  5.             entityliving.ignoreFrustumCheck = true;
  6.         } else {
  7.             entityliving.ignoreFrustumCheck = false;
  8.         }
  9.        
  10.         if (renderLine && entityliving instanceof EntityTropicraftPlayerProxy) {
  11.             EntityTropicraftPlayerProxy koa = ((EntityTropicraftPlayerProxy)entityliving);
  12.             if (koa.pathToEntity != null && koa.pathToEntity.points != null) {
  13.                 if (koa.pathToEntity.points.length > 1) {
  14.                     int ii = koa.pathToEntity.pathIndex - 1;
  15.                     if (ii < 0) ii = 0;
  16.                     for (int i = ii; i < koa.pathToEntity.points.length-1; i++) {
  17.                         PathPointEx ppx = koa.pathToEntity.points[i];
  18.                         PathPointEx ppx2 = koa.pathToEntity.points[i+1];
  19.    
  20.                         if(ppx == null || ppx2 == null)
  21.                             return;
  22.                
  23.                         if (renderLine) {
  24.                             entityliving.ignoreFrustumCheck = true;
  25.                             renderLine(ppx, ppx2, d, d1, d2, f, f1);
  26.                         } else {
  27.                             entityliving.ignoreFrustumCheck = false;
  28.                         }
  29.                     }
  30.                    
  31.                 }
  32.             }
  33.         }
  34.        
  35.     }
  36.  
  37.     public static void renderLine(PathPointEx ppx, PathPointEx ppx2, double d, double d1, double d2, float f, float f1) {
  38.         Tessellator tessellator = Tessellator.instance;
  39.         RenderManager rm = RenderManager.instance;
  40.        
  41.         float castProgress = 1.0F;
  42.    
  43.         float f10 = 0F;//((entitypirate.prevRenderYawOffset + (entitypirate.renderYawOffset - entitypirate.prevRenderYawOffset) * f1) * 3.141593F) / 180F;
  44.         double d4 = MathHelper.sin(f10);
  45.         double d6 = MathHelper.cos(f10);
  46.    
  47.         double pirateX = ppx.xCoord + 0.5;//(entitypirate.prevPosX + (entitypirate.posX - entitypirate.prevPosX) * f1) - d6 * 0.35D - d4 * 0.85D;
  48.         double pirateY = ppx.yCoord + 0.5;//(entitypirate.prevPosY + (entitypirate.posY - entitypirate.prevPosY) * f1) +yoffset;
  49.         double pirateZ = ppx.zCoord + 0.5;//((entitypirate.prevPosZ + (entitypirate.posZ - entitypirate.prevPosZ) * f1) - d4 * 0.35D) + d6 * 0.85D;
  50.         double entX = ppx2.xCoord + 0.5;//(entity.boundingBox.minX + (entity.boundingBox.maxX - entity.boundingBox.minX) / 2D);
  51.         double entY = ppx2.yCoord + 0.5;//(entity.boundingBox.minY + (entity.boundingBox.maxY - entity.boundingBox.minY) / 2D);
  52.         double entZ = ppx2.zCoord + 0.5;//(entity.boundingBox.minZ + (entity.boundingBox.maxZ - entity.boundingBox.minZ) / 2D);
  53.    
  54.         double fishX = castProgress*(entX - pirateX);
  55.         double fishY = castProgress*(entY - pirateY);
  56.         double fishZ = castProgress*(entZ - pirateZ);
  57.         GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
  58.         GL11.glDisable(2896 /*GL_LIGHTING*/);
  59.         tessellator.startDrawing(3);
  60.         int stringColor = 0x888888;
  61.        /* if (((EntityNode)entitypirate).render) {
  62.             stringColor = 0x880000;
  63.         } else {*/
  64.             stringColor = 0xEF4034;
  65.         //}
  66.         tessellator.setColorOpaque_I(stringColor);
  67.         int steps = 16;
  68.    
  69.         for (int i = 0; i < steps; ++i) {
  70.             float f4 = i/(float)steps;
  71.             tessellator.addVertex(
  72.                 pirateX - rm.renderPosX + fishX * f4,//(f4 * f4 + f4) * 0.5D + 0.25D,
  73.                 pirateY - rm.renderPosY + fishY * f4,//(f4 * f4 + f4) * 0.5D + 0.25D,
  74.                 pirateZ - rm.renderPosZ + fishZ * f4);
  75.         }
  76.        
  77.         tessellator.draw();
  78.         GL11.glEnable(2896 /*GL_LIGHTING*/);
  79.         GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
  80.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement