From 0427ab89f1753a44b30cbc35ce021cbbdc845109 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Thu, 10 Aug 2017 18:52:45 +0300 Subject: fix missing source folder --- src/main/java/ihl/explosion/ExplosionEntityFX.java | 177 +++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 src/main/java/ihl/explosion/ExplosionEntityFX.java (limited to 'src/main/java/ihl/explosion/ExplosionEntityFX.java') diff --git a/src/main/java/ihl/explosion/ExplosionEntityFX.java b/src/main/java/ihl/explosion/ExplosionEntityFX.java new file mode 100644 index 0000000..ffa91fa --- /dev/null +++ b/src/main/java/ihl/explosion/ExplosionEntityFX.java @@ -0,0 +1,177 @@ +package ihl.explosion; + +import java.util.Random; + +import ihl.utils.IHLMathUtils; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class ExplosionEntityFX extends EntityFX { + + private float radius; + private static final Random random = new Random(); + private final int[] particlesMaxAge; + private final int[] particlesTextureIndexX; + private final int[] particlesTextureIndexY; + private final double[][] startPos; + private final double[][] pos; + private final double[][] prevPos; + private final float[][] motion; + private final int[] center; + + public ExplosionEntityFX(World world, double x, double y, double z) + { + super(world, x, y, z); + this.renderDistanceWeight = 5.0D; + int numParticles = 1; + particlesMaxAge = new int[numParticles]; + particlesTextureIndexX = new int[numParticles]; + particlesTextureIndexY= new int[numParticles]; + startPos = new double[numParticles][3]; + pos = new double[numParticles][3]; + prevPos = new double[numParticles][3]; + motion = new float[numParticles][3]; + center = new int[3]; + } + + public ExplosionEntityFX(World par1World, int centerX1, int centerY1, int centerZ1, float radius1) + { + super(par1World, centerX1, centerY1, centerZ1, 0.0D, 0.0D, 0.0D); + this.particleMaxAge = 100; + this.center = new int[3]; + this.lastTickPosX=this.posX=this.prevPosX=this.center[0]=centerX1; + this.lastTickPosY=this.posY=this.prevPosY=this.center[1]=centerY1; + this.lastTickPosZ=this.posZ=this.prevPosZ=this.center[2]=centerZ1; + this.radius=radius1; + float r2 = radius*radius; + int numParticles = Math.min((int)(r2*radius/32)+64,512); + this.startPos = new double[numParticles][3]; + this.pos = new double[numParticles][3]; + this.prevPos = new double[numParticles][3]; + this.particleScale *= 40f; + this.particlesMaxAge = new int[numParticles]; + this.particlesTextureIndexX = new int[numParticles]; + this.particlesTextureIndexY= new int[numParticles]; + this.motion = new float[numParticles][3]; + for(int i=0;i= this.particleMaxAge) + { + this.setDead(); + } + for(int i=0;i