summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/particle
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/jp/plusplus/fbs/particle')
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.classbin0 -> 2300 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.java85
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.classbin0 -> 3504 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.java99
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.classbin0 -> 3321 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.java88
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.classbin0 -> 2568 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.java81
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.classbin0 -> 4630 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.java153
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.classbin0 -> 2474 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.java75
12 files changed, 581 insertions, 0 deletions
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.class b/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.class
new file mode 100644
index 0000000..170deb0
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.java b/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.java
new file mode 100644
index 0000000..2094520
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityGlowFX.java
@@ -0,0 +1,85 @@
+package jp.plusplus.fbs.particle;
+
+import cpw.mods.fml.client.FMLClientHandler;
+import net.minecraft.client.multiplayer.WorldClient;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.particle.EntityReddustFX;
+import net.minecraft.client.renderer.RenderGlobal;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.world.World;
+
+import java.util.Random;
+
+/**
+ * Createdby pluslus_Fon 2015/06/06.
+ */
+public class EntityGlowFX extends EntityFX {
+ public EntityGlowFX(World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_) {
+ super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_);
+ Random r=p_i1218_1_.rand;
+
+ particleAge = 0;
+ particleMaxAge = (int) (8.0D / (Math.random() * 0.8D + 0.2D));
+ particleScale *= 0.75F;
+ noClip = false;
+
+ particleRed = 0.8f + r.nextFloat() * 0.2f;
+ particleGreen = 0;
+ particleBlue = 0.8f + r.nextFloat() * 0.2f;
+
+ motionX = (r.nextFloat()-r.nextFloat()) * 0.02f;
+ motionY = (r.nextFloat()-r.nextFloat()) * 0.02f;
+ motionZ = (r.nextFloat()-r.nextFloat()) * 0.02f;
+ }
+
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+
+ this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+
+ if (this.posY == this.prevPosY) {
+ this.motionX *= 1.1D;
+ this.motionZ *= 1.1D;
+ }
+
+ this.motionX *= 0.9599999785423279D;
+ this.motionY *= 0.9599999785423279D;
+ this.motionZ *= 0.9599999785423279D;
+
+ if (this.onGround){
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ }
+ }
+
+ @Override
+ public int getFXLayer() {
+ return 0;
+ }
+ @Override
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_){
+ float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F;
+
+ if (f6 < 0.0F) f6 = 0.0F;
+ if (f6 > 1.0F) f6 = 1.0F;
+
+ this.particleScale *= f6;
+ super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
+ }
+
+ /*
+ public static void SpawnParticle(World world, double x, double y, double z){
+ EntityGlowFX e=new EntityGlowFX(world, x,y,z);
+ FMLClientHandler.instance().getClient().effectRenderer.addEffect(e);
+ }
+ */
+}
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.class b/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.class
new file mode 100644
index 0000000..c666370
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.java b/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.java
new file mode 100644
index 0000000..1fbd56b
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntitySpellCircleFX.java
@@ -0,0 +1,99 @@
+package jp.plusplus.fbs.particle;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+
+/**
+ * Created by plusplus_F on 2016/03/20.
+ */
+public class EntitySpellCircleFX extends EntityFX{
+ private double firstX;
+ private double firstY;
+ private double firstZ;
+
+ private double radius;
+ private float angle;
+ private float rps;
+
+ public EntitySpellCircleFX(World world, double x, double y, double z, double radius, float angle) {
+ super(world, x, y, z, 0,0,0);
+ this.firstX = this.posX = x;
+ this.firstY = this.posY = y;
+ this.firstZ = this.posZ = z;
+ this.radius=radius;
+ this.angle=angle;
+ this.particleScale = this.rand.nextFloat() * 0.4F + 0.4F;
+ this.particleAlpha=this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ this.particleMaxAge = (int) (Math.random() * 20.0D) + 60;
+ this.noClip = true;
+ this.setParticleTextureIndex(rand.nextInt(26));
+
+ posX=firstX-radius* MathHelper.sin((float)angle);
+ posZ=firstZ+radius*MathHelper.cos((float)angle);
+
+ rps=(float)(2*Math.PI/40.0f);
+ }
+
+ @Override
+ public int getBrightnessForRender(float p_70070_1_) {
+ return 0xffffff;
+ }
+
+ @Override
+ public float getBrightness(float p_70013_1_) {
+ return 1.f;
+ }
+
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ //螺旋運動
+ posX=firstX-radius*MathHelper.sin((float)angle);
+ posY+=2.2f/particleMaxAge;
+ posZ=firstZ+radius*MathHelper.cos((float)angle);
+
+ angle+=rps;
+ radius*=0.98f;
+
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+ }
+
+ @Override
+ public int getFXLayer() {
+ return 2;
+ }
+
+ @Override
+ public void setParticleTextureIndex(int p_70536_1_) {
+ this.particleTextureIndexX = p_70536_1_ % 16;
+ this.particleTextureIndexY = p_70536_1_ / 16;
+ }
+
+ @Override
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
+ float f10 = 0.1F * this.particleScale;
+ float f6=particleIcon.getMinU()+(2*particleTextureIndexX)/128.f;
+ float f7=f6+2f/128.0f;
+ float f8=particleIcon.getMinV()+(2*particleTextureIndexY)/128.f;
+ float f9=f8+2f/128.0f;
+
+ float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX);
+ float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY);
+ float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ);
+ p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
+ p_70539_1_.addVertexWithUV((double) (f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double) (f12 - p_70539_4_ * f10), (double) (f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double) f7, (double) f9);
+ p_70539_1_.addVertexWithUV((double) (f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double) (f12 + p_70539_4_ * f10), (double) (f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double) f7, (double) f8);
+ p_70539_1_.addVertexWithUV((double) (f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double) (f12 + p_70539_4_ * f10), (double) (f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double) f6, (double) f8);
+ p_70539_1_.addVertexWithUV((double) (f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double) (f12 - p_70539_4_ * f10), (double) (f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double) f6, (double) f9);
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.class b/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.class
new file mode 100644
index 0000000..c2ff2dd
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.java b/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.java
new file mode 100644
index 0000000..9bffd37
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntitySpellFX.java
@@ -0,0 +1,88 @@
+package jp.plusplus.fbs.particle;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+/**
+ * Created by plusplus_F on 2015/09/27.
+ */
+public class EntitySpellFX extends EntityFX {
+ private double firstX;
+ private double firstY;
+ private double firstZ;
+
+ public EntitySpellFX(World world, double x, double y, double z, double mX, double mY, double mZ) {
+ super(world, x, y, z, mX, mY, mZ);
+ this.motionX = mX;
+ this.motionY = mY;
+ this.motionZ = mZ;
+ this.firstX = this.posX = x;
+ this.firstY = this.posY = y;
+ this.firstZ = this.posZ = z;
+ this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F;
+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
+ this.particleMaxAge = (int) (Math.random() * 10.0D) + 30;
+ this.noClip = true;
+ this.setParticleTextureIndex(rand.nextInt(26));
+ }
+
+ @Override
+ public int getBrightnessForRender(float p_70070_1_) {
+ return 0xffffff;
+ }
+
+ @Override
+ public float getBrightness(float p_70013_1_) {
+ return 1.f;
+ }
+
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ float f = (float) this.particleAge / (float) this.particleMaxAge;
+ f = 1.0F - f;
+
+ this.posX = this.firstX + this.motionX * (double) f;
+ this.posY = this.firstY + this.motionY * (double) f;
+ this.posZ = this.firstZ + this.motionZ * (double) f;
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+ }
+
+ @Override
+ public int getFXLayer() {
+ return 2;
+ }
+
+ @Override
+ public void setParticleTextureIndex(int p_70536_1_) {
+ this.particleTextureIndexX = p_70536_1_ % 16;
+ this.particleTextureIndexY = p_70536_1_ / 16;
+ }
+
+ @Override
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
+ float f10 = 0.1F * this.particleScale;
+ float f6=particleIcon.getMinU()+(2*particleTextureIndexX)/128.f;
+ float f7=f6+2f/128.0f;
+ float f8=particleIcon.getMinV()+(2*particleTextureIndexY)/128.f;
+ float f9=f8+2f/128.0f;
+
+ float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX);
+ float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY);
+ float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ);
+ p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
+ p_70539_1_.addVertexWithUV((double) (f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double) (f12 - p_70539_4_ * f10), (double) (f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double) f7, (double) f9);
+ p_70539_1_.addVertexWithUV((double) (f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double) (f12 + p_70539_4_ * f10), (double) (f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double) f7, (double) f8);
+ p_70539_1_.addVertexWithUV((double) (f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double) (f12 + p_70539_4_ * f10), (double) (f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double) f6, (double) f8);
+ p_70539_1_.addVertexWithUV((double) (f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double) (f12 - p_70539_4_ * f10), (double) (f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double) f6, (double) f9);
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.class b/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.class
new file mode 100644
index 0000000..1a3cd96
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.java b/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.java
new file mode 100644
index 0000000..9c9b047
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityTracksFX.java
@@ -0,0 +1,81 @@
+package jp.plusplus.fbs.particle;
+
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.world.World;
+
+/**
+ * Created by plusplus_F on 2015/10/15.
+ */
+public class EntityTracksFX extends EntityFX {
+ protected float initialParticleScale;
+
+ public EntityTracksFX(World world, double x, double y, double z, double mx, double my, double mz, float red, float green, float blue) {
+ this(world, x, y, z, mx, my, mz, 1.0F, red, green, blue);
+ }
+
+ public EntityTracksFX(World world, double x, double y, double z, double mx, double my, double mz, float red, float green, float blue, float scale) {
+ super(world, x, y, z, 0.0D, 0.0D, 0.0D);
+ this.motionX *= 0.10000000149011612D;
+ this.motionY *= 0.10000000149011612D;
+ this.motionZ *= 0.10000000149011612D;
+ this.motionX += mx * 0.4D;
+ this.motionY += my * 0.4D;
+ this.motionZ += mz * 0.4D;
+ this.particleRed = this.particleGreen = this.particleBlue = (float) (Math.random() * 0.30000001192092896D + 0.6000000238418579D);
+ this.particleScale *= 0.75F;
+ this.particleScale *= scale;
+ this.initialParticleScale = this.particleScale;
+ this.particleMaxAge = (int) (6.0D / (Math.random() * 0.8D + 0.6D));
+ this.particleMaxAge = (int) ((float) this.particleMaxAge * scale);
+ this.noClip = false;
+
+ particleRed = red;
+ particleGreen = green;
+ particleBlue = blue;
+
+ this.setParticleTextureIndex(65);
+ this.onUpdate();
+ }
+
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
+ float f6 = ((float) this.particleAge + p_70539_2_) / (float) this.particleMaxAge * 32.0F;
+
+ if (f6 < 0.0F) {
+ f6 = 0.0F;
+ }
+
+ if (f6 > 1.0F) {
+ f6 = 1.0F;
+ }
+
+ this.particleScale = this.initialParticleScale * f6;
+ super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ //this.particleGreen = (float) ((double) this.particleGreen * 0.96D);
+ //this.particleBlue = (float) ((double) this.particleBlue * 0.9D);
+ this.motionX *= 0.699999988079071D;
+ this.motionY *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ this.motionY -= 0.019999999552965164D;
+
+ if (this.onGround) {
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.class b/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.class
new file mode 100644
index 0000000..9836a0b
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.java b/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.java
new file mode 100644
index 0000000..2e098f0
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityTrajectoryFX.java
@@ -0,0 +1,153 @@
+package jp.plusplus.fbs.particle;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by nori on 2016/03/11.
+ */
+public class EntityTrajectoryFX extends EntityFX {
+ public double[][] plane=new double[4][3];
+
+ public EntityTrajectoryFX(World world, double x, double y, double z, double mX, double mY, double mZ) {
+ super(world, x, y, z, mX, mY, mZ);
+ this.motionX = mX;
+ this.motionY = mY;
+ this.motionZ = mZ;
+ this.prevPosX=this.posX = x;
+ this.prevPosY=this.posY = y;
+ this.prevPosZ=this.posZ = z;
+ this.particleScale = 0.2F;
+ this.particleRed = this.particleGreen = this.particleBlue =this.particleAlpha= 1.0F;
+ this.particleMaxAge = 6;
+ this.noClip = true;
+
+ particleTextureIndexX=0;
+ particleTextureIndexY=2;
+
+ //FBS.logger.info("spawn");
+
+ double mmsize=Math.sqrt(motionX*motionX+motionY*motionY+motionZ*motionZ);
+
+ float rotYaw=(float)Math.atan2(motionX, motionZ)+(float)Math.PI/2.f;
+ float rotPitch=(float)Math.asin(-motionY / mmsize);
+
+ float r=2.25f;
+ float minx=-r, maxx=r, miny=-r, maxy=r;
+ double[][] t=new double[][]{
+ {0,miny,minx},
+ {0,maxy,minx},
+ {0,maxy,maxx},
+ {0,miny,maxx}
+ };
+ double[][] t2=new double[4][3];
+
+ double cx=MathHelper.cos(rotYaw), sx=MathHelper.sin(rotYaw);
+ double cy=MathHelper.cos(rotPitch), sy=MathHelper.sin(rotPitch);
+
+ for(int i=0;i<4;i++){
+ t2[i][0]=cy*t[i][0]-sy*t[i][1];
+ t2[i][1]=sy*t[i][0]+cy*t[i][1];
+ t2[i][2]=t[i][2];
+ }
+ for(int i=0;i<4;i++){
+ plane[i][0]=cx*t2[i][0]+sx*t2[i][2];
+ plane[i][1]=t2[i][1];
+ plane[i][2]=-sx*t2[i][0]+cx*t2[i][2];
+ }
+
+
+ //this.setParticleTextureIndex(rand.nextInt(26));
+ }
+
+ @Override
+ public int getBrightnessForRender(float p_70070_1_) {
+ return 0xffffff;
+ }
+
+ @Override
+ public float getBrightness(float p_70013_1_) {
+
+ /*
+ float f1 = super.getBrightness(p_70013_1_);
+ float f2 = (float) this.particleAge / (float) this.particleMaxAge;
+ f2 *= f2;
+ f2 *= f2;
+ return f1 * (1.0F - f2) + f2;
+ */
+ return 1.f;
+ }
+
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ particleScale=0.2f+1.8f*particleAge/particleMaxAge;
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+ }
+
+ @Override
+ public int getFXLayer() {
+ return 2;
+ }
+
+ @Override
+ public void setParticleTextureIndex(int p_70536_1_) {
+ this.particleTextureIndexX = p_70536_1_ % 16;
+ this.particleTextureIndexY = p_70536_1_ / 16;
+ }
+
+ @Override
+ public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
+ float f10 = 0.2F * this.particleScale;
+ float f6 = particleIcon.getMinU() + (particleTextureIndexX) / 128.f;
+ float f7 = f6 + 4f / 128.0f;
+ float f8 = particleIcon.getMinV() + (2 * particleTextureIndexY) / 128.f;
+ float f9 = f8 + 4f / 128.0f;
+
+ float f11 = (float) (this.prevPosX - interpPosX);
+ float f12 = (float) (this.prevPosY - interpPosY);
+ float f13 = (float) (this.prevPosZ - interpPosZ);
+
+ tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
+ tessellator.addVertexWithUV(f11 + f10 * plane[0][0], f12 + f10 * plane[0][1], f13 + f10 * plane[0][2], f7, f9);
+ tessellator.addVertexWithUV(f11 + f10 * plane[1][0], f12 + f10 * plane[1][1], f13 + f10 * plane[1][2], f7, f8);
+ tessellator.addVertexWithUV(f11 + f10 * plane[2][0], f12 + f10 * plane[2][1], f13 + f10 * plane[2][2], f6, f8);
+ tessellator.addVertexWithUV(f11 + f10 * plane[3][0], f12 + f10 * plane[3][1], f13 + f10 * plane[3][2], f6, f9);
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.addVertexWithUV(f11 + f10 * plane[3][0], f12 + f10 * plane[3][1], f13 + f10 * plane[3][2], f6, f9);
+ tessellator.addVertexWithUV(f11 + f10 * plane[2][0], f12 + f10 * plane[2][1], f13 + f10 * plane[2][2], f6, f8);
+ tessellator.addVertexWithUV(f11 + f10 * plane[1][0], f12 + f10 * plane[1][1], f13 + f10 * plane[1][2], f7, f8);
+ tessellator.addVertexWithUV(f11 + f10 * plane[0][0], f12 + f10 * plane[0][1], f13 + f10 * plane[0][2], f7, f9);
+ }
+
+ @Override
+ protected void fall(float p_70069_1_) {}
+
+ @Override
+ public boolean isWet() {
+ return false;
+ }
+
+ @Override
+ public boolean isInWater()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean handleWaterMovement() {
+ return false;
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.class b/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.class
new file mode 100644
index 0000000..2358d1d
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.java b/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.java
new file mode 100644
index 0000000..95e85ae
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/particle/EntityVortexFX.java
@@ -0,0 +1,75 @@
+package jp.plusplus.fbs.particle;
+
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+/**
+ * Created by plusplus_F on 2015/10/18.
+ */
+public class EntityVortexFX extends EntityFX{
+ public static final double spd=0.4;
+
+ protected int delay;
+ protected float spinPitch;
+ protected float spinYaw;
+ protected float radius;
+ protected double firstX, firstY, firstZ;
+
+ public EntityVortexFX(World w, double x, double y, double z, int d, double r, float red, float green, float blue, float scale) {
+ super(w, x, y, z);
+ firstX=x;
+ firstY=y;
+ firstZ=z;
+ rotationPitch=2*(float)Math.PI*rand.nextFloat();
+ rotationYaw=2*(float)Math.PI*rand.nextFloat();
+
+ float a=2*(float)Math.PI*rand.nextFloat();
+ spinPitch=2*(float)Math.PI/9.f* MathHelper.cos(a);
+ spinYaw=2*(float)Math.PI/9.f* MathHelper.sin(a);
+
+ delay=d;
+ radius=0;
+ particleRed=red;
+ particleGreen=green;
+ particleBlue=blue;
+ particleAlpha=0.f;
+ particleScale=scale;
+ particleMaxAge=MathHelper.floor_double(r/spd)+delay;
+ this.noClip = false;
+
+ this.setParticleTextureIndex(65);
+ this.onUpdate();
+ }
+
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ if (this.particleAge++ >= this.particleMaxAge) {
+ this.setDead();
+ }
+
+ if(particleAge>=delay){
+ //座標の決定
+ posX=firstX-radius*MathHelper.cos(-rotationPitch)*MathHelper.sin(-rotationYaw);
+ posY=firstY+radius*MathHelper.sin(-rotationPitch);
+ posZ=firstZ-radius*MathHelper.cos(-rotationPitch)*MathHelper.cos(-rotationYaw);
+
+ rotationPitch+=spinPitch;
+ rotationYaw+=spinYaw;
+ radius+=spd;
+
+ particleAlpha=1.f;
+ }
+ }
+
+ @Override
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
+ if(particleAge<delay) return;
+ super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
+ }
+}