remove old particles

This commit is contained in:
Sen 2025-07-08 18:08:51 +02:00
parent eca1f242c4
commit 874e118d9d
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
63 changed files with 154 additions and 1585 deletions

View file

@ -21,7 +21,6 @@ import client.gui.container.GuiMerchant;
import client.gui.container.GuiRepair;
import client.gui.ingame.GuiSign;
import client.gui.ingame.GuiForm;
import client.renderer.particle.EntityPickupFX;
import client.renderer.texture.EntityTexManager;
import client.util.PlayerController;
import client.world.ChunkClient;
@ -801,7 +800,6 @@ public class ClientPlayer implements IClientPlayer
this.world.playSoundAtEntity(entity, SoundEvent.POP, 0.2F);
}
this.gm.effectRenderer.addEffect(new EntityPickupFX(this.world, entity, entitylivingbase, 0.5F));
this.world.removeEntityFromWorld(packetIn.getCollectedItemEntityID());
}
}
@ -898,7 +896,8 @@ public class ClientPlayer implements IClientPlayer
}
else if (packetIn.getAnimationType() == 5)
{
this.gm.effectRenderer.emitParticleAtEntity(entity, ParticleType.CRIT_MAGIC);
this.gm.effectRenderer.emitParticleAtEntity(entity, ParticleType.CRIT);
this.gm.effectRenderer.emitParticleAtEntity(entity, ParticleType.CRIT);
}
}
}

View file

@ -1134,7 +1134,7 @@ public class EntityRenderer {
}
}
if(temp < 194.0f || this.random.chance(8))
this.gm.world.spawnParticle(temp >= 194.0f && this.random.chance(20) ? ParticleType.LAVA : ParticleType.SMOKE_NORMAL, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D);
this.gm.world.spawnParticle(temp >= 194.0f && this.random.chance(20) ? ParticleType.LAVA : ParticleType.SMOKE, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D);
}
else if (block != Blocks.air)
{

View file

@ -62,41 +62,22 @@ public class EffectRenderer
this.register(ParticleType.EXPLOSION_NORMAL, new EntityExplodeFX.Factory());
this.register(ParticleType.WATER_BUBBLE, new EntityBubbleFX.Factory());
this.register(ParticleType.WATER_SPLASH, new EntitySplashFX.Factory());
this.register(ParticleType.WATER_WAKE, new EntityFishWakeFX.Factory());
this.register(ParticleType.WATER_DROP, new EntityDownfallFX.RainFactory());
this.register(ParticleType.SUSPENDED, new EntitySuspendFX.Factory());
this.register(ParticleType.SUSPENDED_DEPTH, new EntityAuraFX.SuspendFactory());
this.register(ParticleType.CRIT, new EntityCrit2FX.Factory());
this.register(ParticleType.CRIT_MAGIC, new EntityCrit2FX.MagicFactory());
this.register(ParticleType.SMOKE_NORMAL, new EntitySmokeFX.Factory());
this.register(ParticleType.SMOKE_LARGE, new EntityCritFX.Factory());
this.register(ParticleType.SPELL, new EntitySpellParticleFX.Factory());
this.register(ParticleType.SPELL_INSTANT, new EntitySpellParticleFX.InstantFactory());
this.register(ParticleType.SPELL_MOB, new EntitySpellParticleFX.MobFactory());
this.register(ParticleType.SPELL_MOB_AMBIENT, new EntitySpellParticleFX.AmbientMobFactory());
this.register(ParticleType.SPELL_WITCH, new EntitySpellParticleFX.WitchFactory());
this.register(ParticleType.DRIP_WATER, new EntityDropParticleFX.WaterFactory());
this.register(ParticleType.DRIP_LAVA, new EntityDropParticleFX.LavaFactory());
this.register(ParticleType.DEPTH, new EntityAuraFX.SuspendFactory());
this.register(ParticleType.CRIT, new EntityCritFX.Factory());
this.register(ParticleType.SMOKE, new EntitySmokeFX.Factory());
this.register(ParticleType.POTION, new EntitySpellParticleFX.Factory());
this.register(ParticleType.GROW, new EntityAuraFX.GrowFactory());
this.register(ParticleType.TOWN_AURA, new EntityAuraFX.Factory());
this.register(ParticleType.NOTE, new EntityNoteFX.Factory());
this.register(ParticleType.PORTAL, new EntityPortalFX.Factory());
this.register(ParticleType.ENCHANTMENT_TABLE, new EntityEnchantmentTableParticleFX.EnchantmentTable());
this.register(ParticleType.SPORE, new EntityAuraFX.Factory());
this.register(ParticleType.TELEPORT, new EntityPortalFX.Factory());
this.register(ParticleType.FLAME, new EntityFlameFX.Factory());
this.register(ParticleType.LAVA, new EntityLavaFX.Factory());
this.register(ParticleType.FOOTSTEP, new EntityFootStepFX.Factory());
this.register(ParticleType.CLOUD, new EntityCloudFX.Factory());
this.register(ParticleType.REDSTONE, new EntityReddustFX.Factory());
this.register(ParticleType.SNOWBALL, new EntityBreakingFX.SnowballFactory());
this.register(ParticleType.SNOW_SHOVEL, new EntitySnowShovelFX.Factory());
this.register(ParticleType.SLIME, new EntityBreakingFX.SlimeFactory());
this.register(ParticleType.DUST, new EntityReddustFX.Factory());
this.register(ParticleType.HEART, new EntityHeartFX.Factory());
this.register(ParticleType.ITEM_CRACK, new EntityBreakingFX.Factory());
this.register(ParticleType.BLOCK_CRACK, new EntityDiggingFX.Factory());
this.register(ParticleType.BLOCK_DUST, new EntityBlockDustFX.Factory());
this.register(ParticleType.EXPLOSION_HUGE, new EntityHugeExplodeFX.Factory());
this.register(ParticleType.EXPLOSION_LARGE, new EntityLargeExplodeFX.Factory());
this.register(ParticleType.FIREWORKS_SPARK, new EntityFirework.Factory());
this.register(ParticleType.HAIL_CORN, new EntityDownfallFX.HailFactory());
}

View file

@ -1,25 +0,0 @@
package client.renderer.particle;
import common.init.BlockRegistry;
import common.world.State;
import common.world.World;
public class EntityBlockDustFX extends EntityDiggingFX
{
protected EntityBlockDustFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, State state)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state);
this.motionX = xSpeedIn;
this.motionY = ySpeedIn;
this.motionZ = zSpeedIn;
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
State iblockstate = BlockRegistry.byId(data);
return iblockstate == null || iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
}
}
}

View file

@ -4,7 +4,6 @@ import client.Client;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.world.World;
@ -74,20 +73,4 @@ public class EntityBreakingFX extends EntityFX
return item == null ? null : new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, item);
}
}
public static class SlimeFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.slime_ball);
}
}
public static class SnowballFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.snowball);
}
}
}

View file

@ -1,85 +0,0 @@
package client.renderer.particle;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.util.ExtMath;
import common.world.World;
public class EntityCloudFX extends EntityFX
{
float field_70569_a;
protected EntityCloudFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1221_8_, double p_i1221_10_, double p_i1221_12_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
float f = 2.5F;
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += p_i1221_8_;
this.motionY += p_i1221_10_;
this.motionZ += p_i1221_12_;
this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D);
this.particleScale *= 0.75F;
this.particleScale *= f;
this.field_70569_a = this.particleScale;
this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D));
this.particleMaxAge = (int)((float)this.particleMaxAge * f);
this.noClip = false;
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
f = ExtMath.clampf(f, 0.0F, 1.0F);
this.particleScale = this.field_70569_a * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = 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);
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
EntityNPC entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D);
if (entityplayer != null && this.posY > entityplayer.getEntityBoundingBox().minY)
{
this.posY += (entityplayer.getEntityBoundingBox().minY - this.posY) * 0.2D;
this.motionY += (entityplayer.motionY - this.motionY) * 0.2D;
this.setPosition(this.posX, this.posY, this.posZ);
}
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityCloudFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -1,95 +0,0 @@
package client.renderer.particle;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.util.ExtMath;
import common.world.World;
public class EntityCrit2FX extends EntityFX
{
float field_174839_a;
protected EntityCrit2FX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46284_8_, double p_i46284_10_, double p_i46284_12_)
{
this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46284_8_, p_i46284_10_, p_i46284_12_, 1.0F);
}
protected EntityCrit2FX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46285_8_, double p_i46285_10_, double p_i46285_12_, float p_i46285_14_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += p_i46285_8_ * 0.4D;
this.motionY += p_i46285_10_ * 0.4D;
this.motionZ += p_i46285_12_ * 0.4D;
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D);
this.particleScale *= 0.75F;
this.particleScale *= p_i46285_14_;
this.field_174839_a = this.particleScale;
this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D));
this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46285_14_);
this.noClip = false;
this.setParticleTextureIndex(65);
this.onUpdate();
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
f = ExtMath.clampf(f, 0.0F, 1.0F);
this.particleScale = this.field_174839_a * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = 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;
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
public static class MagicFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFX entityfx = new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setRBGColorF(entityfx.getRedColorF() * 0.3F, entityfx.getGreenColorF() * 0.8F, entityfx.getBlueColorF());
entityfx.nextTextureIndexX();
return entityfx;
}
}
}

View file

@ -1,12 +1,78 @@
package client.renderer.particle;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.util.ExtMath;
import common.world.World;
public class EntityCritFX extends EntitySmokeFX
public class EntityCritFX extends EntityFX
{
protected EntityCritFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1201_8_, double p_i1201_10_, double p_i1201_12_)
float field_174839_a;
protected EntityCritFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46284_8_, double p_i46284_10_, double p_i46284_12_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i1201_8_, p_i1201_10_, p_i1201_12_, 2.5F);
this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46284_8_, p_i46284_10_, p_i46284_12_, 1.0F);
}
protected EntityCritFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46285_8_, double p_i46285_10_, double p_i46285_12_, float p_i46285_14_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += p_i46285_8_ * 0.4D;
this.motionY += p_i46285_10_ * 0.4D;
this.motionZ += p_i46285_12_ * 0.4D;
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D);
this.particleScale *= 0.75F;
this.particleScale *= p_i46285_14_;
this.field_174839_a = this.particleScale;
this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D));
this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46285_14_);
this.noClip = false;
this.setParticleTextureIndex(66);
this.onUpdate();
this.setRBGColorF(this.getRedColorF() * 0.3F, this.getGreenColorF() * 0.8F, this.getBlueColorF());
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
f = ExtMath.clampf(f, 0.0F, 1.0F);
this.particleScale = this.field_174839_a * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = 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;
}
}
public static class Factory implements IParticleFactory

View file

@ -1,158 +0,0 @@
package client.renderer.particle;
import common.block.Material;
import common.block.liquid.BlockLiquid;
import common.model.ParticleType;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.State;
import common.world.World;
public class EntityDropParticleFX extends EntityFX
{
/** the material type for dropped items/blocks */
private Material materialType;
/** The height of the current bob */
private int bobTimer;
protected EntityDropParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, Material p_i1203_8_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX = this.motionY = this.motionZ = 0.0D;
if (p_i1203_8_ == Material.WATER)
{
this.particleRed = 0.0F;
this.particleGreen = 0.0F;
this.particleBlue = 1.0F;
}
else
{
this.particleRed = 1.0F;
this.particleGreen = 0.0F;
this.particleBlue = 0.0F;
}
this.setParticleTextureIndex(113);
this.setSize(0.01F, 0.01F);
this.particleGravity = 0.06F;
this.materialType = p_i1203_8_;
this.bobTimer = 40;
this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D));
this.motionX = this.motionY = this.motionZ = 0.0D;
}
public int getBrightnessForRender(float partialTicks)
{
return this.materialType == Material.WATER ? super.getBrightnessForRender(partialTicks) : 257;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float partialTicks)
{
return this.materialType == Material.WATER ? super.getBrightness(partialTicks) : 1.0F;
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
if (this.materialType == Material.WATER)
{
this.particleRed = 0.2F;
this.particleGreen = 0.3F;
this.particleBlue = 1.0F;
}
else
{
this.particleRed = 1.0F;
this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16);
this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8);
}
this.motionY -= (double)this.particleGravity;
if (this.bobTimer-- > 0)
{
this.motionX *= 0.02D;
this.motionY *= 0.02D;
this.motionZ *= 0.02D;
this.setParticleTextureIndex(113);
}
else
{
this.setParticleTextureIndex(112);
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
if (this.particleMaxAge-- <= 0)
{
this.setDead();
}
if (this.onGround)
{
if (this.materialType == Material.WATER)
{
this.setDead();
this.worldObj.spawnParticle(ParticleType.WATER_SPLASH, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
}
else
{
this.setParticleTextureIndex(114);
}
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
BlockPos blockpos = new BlockPos(this);
State iblockstate = this.worldObj.getState(blockpos);
Material material = iblockstate.getBlock().getMaterial();
if (material.isLiquid() || material.isSolid())
{
double d0 = 0.0D;
if (iblockstate.getBlock() instanceof BlockLiquid)
{
d0 = (double)BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue());
}
double d1 = (double)(ExtMath.floord(this.posY) + 1) - d0;
if (this.posY < d1)
{
this.setDead();
}
}
}
public static class LavaFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.LAVA);
}
}
public static class WaterFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.WATER);
}
}
}

View file

@ -1,94 +0,0 @@
package client.renderer.particle;
import common.world.World;
public class EntityEnchantmentTableParticleFX extends EntityFX
{
private float field_70565_a;
private double coordX;
private double coordY;
private double coordZ;
protected EntityEnchantmentTableParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.motionX = xSpeedIn;
this.motionY = ySpeedIn;
this.motionZ = zSpeedIn;
this.coordX = xCoordIn;
this.coordY = yCoordIn;
this.coordZ = zCoordIn;
this.posX = this.prevX = xCoordIn + xSpeedIn;
this.posY = this.prevY = yCoordIn + ySpeedIn;
this.posZ = this.prevZ = zCoordIn + zSpeedIn;
float f = this.rand.floatv() * 0.6F + 0.4F;
this.field_70565_a = this.particleScale = this.rand.floatv() * 0.5F + 0.2F;
this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f;
this.particleGreen *= 0.9F;
this.particleRed *= 0.9F;
this.particleMaxAge = (int)(Math.random() * 10.0D) + 30;
this.noClip = true;
this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D));
}
public int getBrightnessForRender(float partialTicks)
{
int i = super.getBrightnessForRender(partialTicks);
float f = (float)this.particleAge / (float)this.particleMaxAge;
f = f * f;
f = f * f;
int j = i & 255;
int k = i >> 16 & 255;
k = k + (int)(f * 15.0F * 16.0F);
if (k > 240)
{
k = 240;
}
return j | k << 16;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float partialTicks)
{
float f = super.getBrightness(partialTicks);
float f1 = (float)this.particleAge / (float)this.particleMaxAge;
f1 = f1 * f1;
f1 = f1 * f1;
return f * (1.0F - f1) + f1;
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
float f = (float)this.particleAge / (float)this.particleMaxAge;
f = 1.0F - f;
float f1 = 1.0F - f;
f1 = f1 * f1;
f1 = f1 * f1;
this.posX = this.coordX + this.motionX * (double)f;
this.posY = this.coordY + this.motionY * (double)f - (double)(f1 * 1.2F);
this.posZ = this.coordZ + this.motionZ * (double)f;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
}
public static class EnchantmentTable implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityEnchantmentTableParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -1,158 +0,0 @@
package client.renderer.particle;
import client.Client;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.util.BoundingBox;
import common.util.ExtMath;
import common.world.World;
public class EntityFirework
{
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, Client.CLIENT.effectRenderer);
entityfirework$sparkfx.setAlphaF(0.99F);
return entityfirework$sparkfx;
}
}
public static class OverlayFX extends EntityFX
{
protected OverlayFX(World p_i46466_1_, double p_i46466_2_, double p_i46466_4_, double p_i46466_6_)
{
super(p_i46466_1_, p_i46466_2_, p_i46466_4_, p_i46466_6_);
this.particleMaxAge = 4;
}
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = 0.25F;
float f1 = 0.5F;
float f2 = 0.125F;
float f3 = 0.375F;
float f4 = 7.1F * ExtMath.sin(((float)this.particleAge + partialTicks - 1.0F) * 0.25F * (float)Math.PI);
this.particleAlpha = 0.6F - ((float)this.particleAge + partialTicks - 1.0F) * 0.25F * 0.5F;
float f5 = (float)(this.prevX + (this.posX - this.prevX) * (double)partialTicks - interpPosX);
float f6 = (float)(this.prevY + (this.posY - this.prevY) * (double)partialTicks - interpPosY);
float f7 = (float)(this.prevZ + (this.posZ - this.prevZ) * (double)partialTicks - interpPosZ);
int i = this.getBrightnessForRender(partialTicks);
int j = i >> 16 & 65535;
int k = i & 65535;
worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex(0.5D, 0.375D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex(0.5D, 0.125D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex(0.25D, 0.125D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex(0.25D, 0.375D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
}
}
public static class SparkFX extends EntityFX
{
private int baseTextureIndex = 160;
private boolean trail;
private boolean twinkle;
private final EffectRenderer field_92047_az;
private float fadeColourRed;
private float fadeColourGreen;
private float fadeColourBlue;
private boolean hasFadeColour;
public SparkFX(World p_i46465_1_, double p_i46465_2_, double p_i46465_4_, double p_i46465_6_, double p_i46465_8_, double p_i46465_10_, double p_i46465_12_, EffectRenderer p_i46465_14_)
{
super(p_i46465_1_, p_i46465_2_, p_i46465_4_, p_i46465_6_);
this.motionX = p_i46465_8_;
this.motionY = p_i46465_10_;
this.motionZ = p_i46465_12_;
this.field_92047_az = p_i46465_14_;
this.particleScale *= 0.75F;
this.particleMaxAge = 48 + this.rand.zrange(12);
this.noClip = false;
}
public BoundingBox getCollisionBoundingBox()
{
return null;
}
public boolean canBePushed()
{
return false;
}
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
if (!this.twinkle || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
{
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
}
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
if (this.particleAge > this.particleMaxAge / 2)
{
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
if (this.hasFadeColour)
{
this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F;
this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F;
this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F;
}
}
this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge));
this.motionY -= 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9100000262260437D;
this.motionY *= 0.9100000262260437D;
this.motionZ *= 0.9100000262260437D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
if (this.trail && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
{
EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az);
entityfirework$sparkfx.setAlphaF(0.99F);
entityfirework$sparkfx.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue);
entityfirework$sparkfx.particleAge = entityfirework$sparkfx.particleMaxAge / 2;
if (this.hasFadeColour)
{
entityfirework$sparkfx.hasFadeColour = true;
entityfirework$sparkfx.fadeColourRed = this.fadeColourRed;
entityfirework$sparkfx.fadeColourGreen = this.fadeColourGreen;
entityfirework$sparkfx.fadeColourBlue = this.fadeColourBlue;
}
entityfirework$sparkfx.twinkle = this.twinkle;
this.field_92047_az.addEffect(entityfirework$sparkfx);
}
}
public int getBrightnessForRender(float partialTicks)
{
return 15728880;
}
public float getBrightness(float partialTicks)
{
return 1.0F;
}
}
}

View file

@ -1,56 +0,0 @@
package client.renderer.particle;
import common.world.World;
public class EntityFishWakeFX extends EntityFX
{
protected EntityFishWakeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i45073_8_, double p_i45073_10_, double p_i45073_12_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.30000001192092896D;
this.motionY = Math.random() * 0.20000000298023224D + 0.10000000149011612D;
this.motionZ *= 0.30000001192092896D;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.setParticleTextureIndex(19);
this.setSize(0.01F, 0.01F);
this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
this.particleGravity = 0.0F;
this.motionX = p_i45073_8_;
this.motionY = p_i45073_10_;
this.motionZ = p_i45073_12_;
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
this.motionY -= (double)this.particleGravity;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
int i = 60 - this.particleMaxAge;
float f = (float)i * 0.001F;
this.setSize(f, f);
this.setParticleTextureIndex(19 + i % 4);
if (this.particleMaxAge-- <= 0)
{
this.setDead();
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityFishWakeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -1,94 +0,0 @@
package client.renderer.particle;
import org.lwjgl.opengl.GL11;
import client.Client;
import client.renderer.DefaultVertexFormats;
import client.renderer.GlState;
import client.renderer.RenderBuffer;
import client.renderer.Tessellator;
import client.renderer.texture.TextureManager;
import common.entity.Entity;
import common.util.BlockPos;
import common.world.World;
public class EntityFootStepFX extends EntityFX
{
private int footstepAge;
private int footstepMaxAge;
private TextureManager currentFootSteps;
protected EntityFootStepFX(TextureManager currentFootStepsIn, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.currentFootSteps = currentFootStepsIn;
this.motionX = this.motionY = this.motionZ = 0.0D;
this.footstepMaxAge = 200;
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
double u = 2.0F / 16.0F;
double u1 = u + 0.0624375F;
double u2 = 6.0F / 16.0F;
double u3 = u2 + 0.0624375F;
float f = ((float)this.footstepAge + partialTicks) / (float)this.footstepMaxAge;
f = f * f;
float f1 = 2.0F - f * 2.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 = f1 * 0.2F;
GlState.disableLighting();
float f2 = 0.125F;
float f3 = (float)(this.posX - interpPosX);
float f4 = (float)(this.posY - interpPosY);
float f5 = (float)(this.posZ - interpPosZ);
float f6 = this.worldObj.getLightBrightness(new BlockPos(this));
this.currentFootSteps.bindTexture(EffectRenderer.particleTextures);
GlState.enableBlend();
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(u1, u3).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(u1, u2).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(u, u2).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(u, u3).color(f6, f6, f6, f1).endVertex();
// Tessellator.getInstance();
Tessellator.draw();
GlState.disableBlend();
GlState.enableLighting();
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
++this.footstepAge;
if (this.footstepAge == this.footstepMaxAge)
{
this.setDead();
}
}
public int getFXLayer()
{
return 3;
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityFootStepFX(Client.CLIENT.getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn);
}
}
}

View file

@ -71,7 +71,7 @@ public class EntityLavaFX extends EntityFX
if (this.rand.floatv() > f)
{
this.worldObj.spawnParticle(ParticleType.SMOKE_NORMAL, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ);
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ);
}
this.motionY -= 0.03D;

View file

@ -1,86 +0,0 @@
package client.renderer.particle;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.util.ExtMath;
import common.world.World;
public class EntityNoteFX extends EntityFX
{
float noteParticleScale;
protected EntityNoteFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46353_8_, double p_i46353_10_, double p_i46353_12_)
{
this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46353_8_, p_i46353_10_, p_i46353_12_, 2.0F);
}
protected EntityNoteFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1217_8_, double p_i1217_10_, double p_i1217_12_, float p_i1217_14_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.009999999776482582D;
this.motionY *= 0.009999999776482582D;
this.motionZ *= 0.009999999776482582D;
this.motionY += 0.2D;
this.particleRed = ExtMath.sin(((float)p_i1217_8_ + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
this.particleGreen = ExtMath.sin(((float)p_i1217_8_ + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
this.particleBlue = ExtMath.sin(((float)p_i1217_8_ + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
this.particleScale *= 0.75F;
this.particleScale *= p_i1217_14_;
this.noteParticleScale = this.particleScale;
this.particleMaxAge = 6;
this.noClip = false;
this.setParticleTextureIndex(64);
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
f = ExtMath.clampf(f, 0.0F, 1.0F);
this.particleScale = this.noteParticleScale * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.6600000262260437D;
this.motionY *= 0.6600000262260437D;
this.motionZ *= 0.6600000262260437D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntityNoteFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -1,74 +0,0 @@
package client.renderer.particle;
import org.lwjgl.opengl.GL13;
import client.Client;
import client.renderer.GlState;
import client.renderer.RenderBuffer;
import client.renderer.entity.RenderManager;
import common.entity.Entity;
import common.world.World;
public class EntityPickupFX extends EntityFX
{
private Entity field_174840_a;
private Entity field_174843_ax;
private int age;
private int maxAge;
private float field_174841_aA;
private RenderManager field_174842_aB = Client.CLIENT.getRenderManager();
public EntityPickupFX(World worldIn, Entity p_i1233_2_, Entity p_i1233_3_, float p_i1233_4_)
{
super(worldIn, p_i1233_2_.posX, p_i1233_2_.posY, p_i1233_2_.posZ, p_i1233_2_.motionX, p_i1233_2_.motionY, p_i1233_2_.motionZ);
this.field_174840_a = p_i1233_2_;
this.field_174843_ax = p_i1233_3_;
this.maxAge = 3;
this.field_174841_aA = p_i1233_4_;
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.age + partialTicks) / (float)this.maxAge;
f = f * f;
double d0 = this.field_174840_a.posX;
double d1 = this.field_174840_a.posY;
double d2 = this.field_174840_a.posZ;
double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks;
double d6 = d0 + (d3 - d0) * (double)f;
double d7 = d1 + (d4 - d1) * (double)f;
double d8 = d2 + (d5 - d2) * (double)f;
int i = this.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)j / 1.0F, (float)k / 1.0F);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
d6 = d6 - interpPosX;
d7 = d7 - interpPosY;
d8 = d8 - interpPosZ;
this.field_174842_aB.renderEntity(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), partialTicks);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
++this.age;
if (this.age == this.maxAge)
{
this.setDead();
}
}
public int getFXLayer()
{
return 3;
}
}

View file

@ -1,81 +0,0 @@
package client.renderer.particle;
import client.renderer.RenderBuffer;
import common.entity.Entity;
import common.util.ExtMath;
import common.world.World;
public class EntitySnowShovelFX extends EntityFX
{
float snowDigParticleScale;
protected EntitySnowShovelFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
{
this(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, 1.0F);
}
protected EntitySnowShovelFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, float p_i1228_14_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += xSpeedIn;
this.motionY += ySpeedIn;
this.motionZ += zSpeedIn;
this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D);
this.particleScale *= 0.75F;
this.particleScale *= p_i1228_14_;
this.snowDigParticleScale = this.particleScale;
this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1228_14_);
this.noClip = false;
}
/**
* Renders the particle
*/
public void renderParticle(RenderBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
f = ExtMath.clampf(f, 0.0F, 1.0F);
this.particleScale = this.snowDigParticleScale * f;
super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
this.motionY -= 0.03D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9900000095367432D;
this.motionY *= 0.9900000095367432D;
this.motionZ *= 0.9900000095367432D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntitySnowShovelFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -10,9 +10,6 @@ public class EntitySpellParticleFX extends EntityFX
{
private static final Random RANDOM = new Random();
/** Base spell texture index */
private int baseSpellTextureIndex = 128;
protected EntitySpellParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.5D - RANDOM.doublev(), p_i1229_10_, 0.5D - RANDOM.doublev());
@ -53,7 +50,7 @@ public class EntitySpellParticleFX extends EntityFX
this.setDead();
}
this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge));
this.setParticleTextureIndex(144 + (7 - this.particleAge * 8 / this.particleMaxAge));
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
@ -74,25 +71,6 @@ public class EntitySpellParticleFX extends EntityFX
}
}
/**
* Sets the base spell texture index
*/
public void setBaseSpellTextureIndex(int baseSpellTextureIndexIn)
{
this.baseSpellTextureIndex = baseSpellTextureIndexIn;
}
public static class AmbientMobFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setAlphaF(0.15F);
entityfx.setRBGColorF((float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn);
return entityfx;
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
@ -100,36 +78,4 @@ public class EntitySpellParticleFX extends EntityFX
return new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
public static class InstantFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);
return entityfx;
}
}
public static class MobFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
entityfx.setRBGColorF((float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn);
return entityfx;
}
}
public static class WitchFactory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);
float f = worldIn.rand.floatv() * 0.5F + 0.35F;
entityfx.setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
return entityfx;
}
}
}

View file

@ -1,52 +0,0 @@
package client.renderer.particle;
import common.block.Material;
import common.util.BlockPos;
import common.world.World;
public class EntitySuspendFX extends EntityFX
{
protected EntitySuspendFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
{
super(worldIn, xCoordIn, yCoordIn - 0.125D, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.particleRed = 0.4F;
this.particleGreen = 0.4F;
this.particleBlue = 0.7F;
this.setParticleTextureIndex(0);
this.setSize(0.01F, 0.01F);
this.particleScale *= this.rand.floatv() * 0.6F + 0.2F;
this.motionX = xSpeedIn * 0.0D;
this.motionY = ySpeedIn * 0.0D;
this.motionZ = zSpeedIn * 0.0D;
this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D));
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevX = this.posX;
this.prevY = this.posY;
this.prevZ = this.posZ;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.worldObj.getState(new BlockPos(this)).getBlock().getMaterial() != Material.WATER)
{
this.setDead();
}
if (this.particleMaxAge-- <= 0)
{
this.setDead();
}
}
public static class Factory implements IParticleFactory
{
public EntityFX getEntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int data)
{
return new EntitySuspendFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -299,7 +299,7 @@ public class WorldClient extends AWorldClient
float x = ((float)posX) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
float y = -64.0f + rand.floatv() * 65.0f; // * 68.0f;
float z = ((float)posZ) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
this.spawnParticle(ParticleType.SUSPENDED_DEPTH, (double)x, (double)y, (double)z, 0.0D, 0.0D, 0.0D);
this.spawnParticle(ParticleType.DEPTH, (double)x, (double)y, (double)z, 0.0D, 0.0D, 0.0D);
}
// }
}
@ -622,7 +622,7 @@ public class WorldClient extends AWorldClient
double d8 = (double)l * d20 + this.rand.gaussian() * 0.01D;
double d10 = -0.03D + this.rand.gaussian() * 0.01D;
double d12 = (double)i * d20 + this.rand.gaussian() * 0.01D;
this.spawnEntityFX(ParticleType.SMOKE_NORMAL, ParticleType.SMOKE_NORMAL.isUnlimited(), d21, d4, d6, d8, d10, d12, 0);
this.spawnEntityFX(ParticleType.SMOKE, ParticleType.SMOKE.isUnlimited(), d21, d4, d6, d8, d10, d12, 0);
}
return;
@ -658,12 +658,7 @@ public class WorldClient extends AWorldClient
f = (float)(j1 >> 16 & 255) / 255.0F;
f1 = (float)(j1 >> 8 & 255) / 255.0F;
f2 = (float)(j1 >> 0 & 255) / 255.0F;
enumparticletypes = ParticleType.SPELL;
if (potion.isEffectInstant())
{
enumparticletypes = ParticleType.SPELL_INSTANT;
}
enumparticletypes = ParticleType.POTION;
}
for (int l1 = 0; l1 < 100; ++l1)