Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hdr.entity;
- import hdr.MainData;
- import cpw.mods.fml.client.FMLClientHandler;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.particle.EntityFX;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.World;
- public class EntityLorienLeaveFallFX extends EntityFX {
- public EntityLorienLeaveFallFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10)
- {
- this(par1World, par2, par4, par6, 1.0F, par8, par9, par10);
- }
- public EntityLorienLeaveFallFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float par11)
- {
- super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
- this.motionX = par9;//initial motion value X
- this.motionY = par10;//initial motion value Y
- this.motionZ = par11;//initial motion value Z
- if (par9 == 0.0F)
- {
- par9 = 1.0F;
- }
- float var12 = (float)Math.random() * 0.4F + 0.6F;
- this.particleTextureIndexX = 0; //
- this.particleTextureIndexY = 1;
- this.particleRed = 1.0F;//RGB of your particle
- this.particleGreen = 1.0F;
- this.particleBlue = 1.0F;
- this.particleScale *= 3.4F;
- this.particleScale *= par8;
- this.particleMaxAge = 80;//how soon the particle dies. You can use randomizer for this
- this.noClip = true;//does your particle collide with blocks?
- }
- @Override
- public void onUpdate()
- {
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
- if (this.particleAge++ >= this.particleMaxAge)
- {
- this.setDead();
- }
- if (!this.onGround) { this.motionY -= 0.002D; }
- 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.isCollidedHorizontally)
- {
- this.motionX *= 0.0D;
- this.motionZ *= 0.0D;
- this.setDead();
- }
- }
- @Override
- @SideOnly(Side.CLIENT)
- public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
- {
- float f6 = 2 * ((float)this.particleTextureIndexX / 16.0F);
- float f7 = 2 * (f6 + 0.0624375F);
- float f8 = 2 * ((float)this.particleTextureIndexY / 16.0F);
- float f9 = 2 * (f8 + 0.0624375F);
- float f10 = 0.1F * this.particleScale;
- if (this.particleIcon != null)
- {
- f6 = this.particleIcon.getMinU();
- f7 = this.particleIcon.getMaxU();
- f8 = this.particleIcon.getMinV();
- f9 = this.particleIcon.getMaxV();
- }
- float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
- float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
- float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
- float f14 = 1.0F;
- par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha);
- par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
- par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
- par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
- par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
- par1Tessellator.draw();
- Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(MainData.modid + ":" + "textures/particle/particles.png"));
- par1Tessellator.startDrawingQuads();
- par1Tessellator.setBrightness(200);//make sure you have this!!
- par1Tessellator.draw();
- Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(MainData.modid + ":" + "textures/particle/particles.png"));
- par1Tessellator.startDrawingQuads();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement