Advertisement
Corosus

moooooo

Aug 28th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.69 KB | None | 0 0
  1. //particle usage, from entity tornado file
  2.  
  3. //required class declarations
  4. public List funnelEffects; //list of your particles to update motion on
  5. public EffectRenderer effR; //reference
  6.  
  7. //code run on init
  8. this.effR = ModLoader.getMinecraftInstance().effectRenderer;
  9. this.funnelEffects = new ArrayList();
  10.  
  11. float f = 2.0F;
  12.            float f1 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * f;
  13.            //float f2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * f;
  14.            f1 = 0.0F;
  15.            float f3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * f;
  16.            
  17.            //double d3 = 1.0D;
  18.            double d4 = 1.8D;
  19.            double d5 = 0.050000000000000003D;
  20.            double d = this.prevPosX + (this.posX - this.prevPosX) * (double)f;
  21.            double d1 = 10D + (this.prevPosY + (this.posY - this.prevPosY) * (double)f + 1.6200000000000001D) - (double)this.yOffset;
  22.            double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)f;
  23.            //Vec3D vec3d = Vec3D.createVector(d, d1, d2);
  24.            float f4 = MathHelper.cos(-f3 * 0.01745329F - 3.141593F);
  25.            float f5 = MathHelper.sin(-f3 * 0.01745329F - 3.141593F);
  26.            float f6 = -MathHelper.cos(-f1 * 0.01745329F - 0.7853982F);
  27.            float f7 = MathHelper.sin(-f1 * 0.01745329F - 0.7853982F);
  28.            float f8 = f5 * f6;
  29.            float f9 = f7;
  30.            float f10 = f4 * f6;
  31.            double d6 = (double)f8 * d5;
  32.            double d7 = (double)f9 * d5;
  33.            double d8 = (double)f10 * d5;
  34.  
  35. //code run in onUpdate - particle spawning
  36. EntityWindFX var31;
  37. var31 = new EntityWindFX(this.worldObj, d + (double)f8 * d4, d1 + (double)f9 * d4, d2 + (double)f10 * d4, d6 / 2D, d7 / 2D, d8 / 2D, 5.5D, colorID);
  38.                        this.effR.addEffect(var31);
  39.                        this.funnelEffects.add(var31);
  40.                        mod_EntMover.particleCount++;
  41.                        var31.renderDistanceWeight = 10.0D;
  42.                        var31.noClip = true;
  43.                        var31.setSize(1.25F, 1.25F);
  44.                        var31.posY = var6 + 0D;
  45.                        var31.setPosition(tryX2, this.posY, tryZ2);
  46.  
  47. //particle moving - remove mod_ references, spin() is where the particles get moved (tornado code)
  48. if(this.funnelEffects.size() > 0) {
  49.                  for(int var9 = 0; var9 < this.funnelEffects.size(); ++var9) {
  50.                     EntityFX var30 = (EntityFX)this.funnelEffects.get(var9);
  51.                     if(var30.isDead) {
  52.                        this.funnelEffects.remove(var30);
  53.                        mod_EntMover.particleCount--;
  54.                     } else {
  55.                        mod_EntMover.spin(this, var30);
  56.                     }
  57.                  }
  58.            }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement