summaryrefslogtreecommitdiff
path: root/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-02-21 21:31:16 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-02-21 21:31:16 +0000
commit420faddca46e70e3a70def168fb4e452ef193b0d (patch)
tree247e334012e4bf9e4fa6d42718bf601ce6bd42d9 /java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
parent3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (diff)
Added just a butt ton of stuff, also thanks to pau101 for helping me with the Hand Pedestal animation :)
Diffstat (limited to 'java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java')
-rw-r--r--java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java67
1 files changed, 38 insertions, 29 deletions
diff --git a/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java b/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
index 923947e..70e47b0 100644
--- a/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
+++ b/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
@@ -1,53 +1,60 @@
package darkknight.jewelrycraft.particles;
-import java.util.Iterator;
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.projectile.EntityThrowable;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-
import org.lwjgl.opengl.GL11;
public class EntityFlatShadowFX extends EntityFX
{
float moteParticleScale;
+ ResourceLocation texture;
- public EntityFlatShadowFX(World world, double x, double y, double z, float size, float maxAge)
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param size
+ * @param maxAge
+ * @param texture
+ */
+ public EntityFlatShadowFX(World world, double x, double y, double z, float size, float maxAge, ResourceLocation texture)
{
- super(world, x, y, z, 0D, 0D, 0D);
- particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ super(world, x, y, z, 0D, 0D, 0D);
+ particleMaxAge = (int)(28D / (Math.random() * 0.3D + 0.7D) * maxAge);
particleGravity = 0F;
motionX = motionY = motionZ = 0;
particleScale = size;
noClip = true;
+ this.texture = texture;
setSize(0.1F, 0.1F);
}
+ /**
+ * @param tessellator
+ * @param partialTicks
+ * @param minX
+ * @param minY
+ * @param minZ
+ * @param maxX
+ * @param maxZ
+ */
@Override
public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ)
{
tessellator.draw();
- ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png");
- Minecraft.getMinecraft().renderEngine.bindTexture(particle);
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
tessellator.startDrawingQuads();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthMask(false);
float scale = 1F * particleScale;
- float x = (float) (posX - interpPosX);
- float y = (float) (posX - interpPosY);
- float z = (float) (posZ - interpPosZ);
+ float x = (float)(posX - interpPosX);
+ float y = (float)(posX - interpPosY);
+ float z = (float)(posZ - interpPosZ);
tessellator.setColorRGBA_F(0F, 0F, 0F, 1F);
tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y + minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
@@ -60,23 +67,25 @@ public class EntityFlatShadowFX extends EntityFX
tessellator.startDrawingQuads();
}
+ /**
+ *
+ */
@Override
public void onUpdate()
{
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
+ prevPosX = posX;
+ prevPosY = posY;
+ prevPosZ = posZ;
motionX = motionY = motionZ = 0;
-
- if (this.particleAge++ >= this.particleMaxAge)
- {
- this.setDead();
- }
+ if (particleAge++ >= particleMaxAge) setDead();
}
+ /**
+ * @return
+ */
+ @Override
public int getFXLayer()
{
return 0;
}
-
}