Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //particle usage, from entity tornado file
- //required class declarations
- public List funnelEffects; //list of your particles to update motion on
- public EffectRenderer effR; //reference
- //code run on init
- this.effR = ModLoader.getMinecraftInstance().effectRenderer;
- this.funnelEffects = new ArrayList();
- float f = 2.0F;
- float f1 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * f;
- //float f2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * f;
- f1 = 0.0F;
- float f3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * f;
- //double d3 = 1.0D;
- double d4 = 1.8D;
- double d5 = 0.050000000000000003D;
- double d = this.prevPosX + (this.posX - this.prevPosX) * (double)f;
- double d1 = 10D + (this.prevPosY + (this.posY - this.prevPosY) * (double)f + 1.6200000000000001D) - (double)this.yOffset;
- double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)f;
- //Vec3D vec3d = Vec3D.createVector(d, d1, d2);
- float f4 = MathHelper.cos(-f3 * 0.01745329F - 3.141593F);
- float f5 = MathHelper.sin(-f3 * 0.01745329F - 3.141593F);
- float f6 = -MathHelper.cos(-f1 * 0.01745329F - 0.7853982F);
- float f7 = MathHelper.sin(-f1 * 0.01745329F - 0.7853982F);
- float f8 = f5 * f6;
- float f9 = f7;
- float f10 = f4 * f6;
- double d6 = (double)f8 * d5;
- double d7 = (double)f9 * d5;
- double d8 = (double)f10 * d5;
- //code run in onUpdate - particle spawning
- EntityWindFX var31;
- 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);
- this.effR.addEffect(var31);
- this.funnelEffects.add(var31);
- mod_EntMover.particleCount++;
- var31.renderDistanceWeight = 10.0D;
- var31.noClip = true;
- var31.setSize(1.25F, 1.25F);
- var31.posY = var6 + 0D;
- var31.setPosition(tryX2, this.posY, tryZ2);
- //particle moving - remove mod_ references, spin() is where the particles get moved (tornado code)
- if(this.funnelEffects.size() > 0) {
- for(int var9 = 0; var9 < this.funnelEffects.size(); ++var9) {
- EntityFX var30 = (EntityFX)this.funnelEffects.get(var9);
- if(var30.isDead) {
- this.funnelEffects.remove(var30);
- mod_EntMover.particleCount--;
- } else {
- mod_EntMover.spin(this, var30);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement