clean up particles

This commit is contained in:
Sen 2025-07-08 22:15:03 +02:00
parent 874e118d9d
commit baa3f501b6
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
22 changed files with 75 additions and 154 deletions

View file

@ -1526,7 +1526,7 @@ public class ClientPlayer implements IClientPlayer
if (entity instanceof EntityLiving living)
{
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.hasParticles())
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier())
.setRemaining(packetIn.getRemaining());
living.addEffect(potioneffect);
}

View file

@ -60,8 +60,7 @@ public class EffectRenderer
private void registerVanillaParticles()
{
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.SPLASH, new EntitySplashFX.Factory());
this.register(ParticleType.WATER_DROP, new EntityDownfallFX.RainFactory());
this.register(ParticleType.DEPTH, new EntityAuraFX.SuspendFactory());
this.register(ParticleType.CRIT, new EntityCritFX.Factory());

View file

@ -1,56 +0,0 @@
package client.renderer.particle;
import common.block.Material;
import common.util.BlockPos;
import common.world.World;
public class EntityBubbleFX extends EntityFX
{
protected EntityBubbleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
{
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.setParticleTextureIndex(32);
this.setSize(0.02F, 0.02F);
this.particleScale *= this.rand.floatv() * 0.6F + 0.2F;
this.motionX = xSpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D;
this.motionY = ySpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D;
this.motionZ = zSpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D;
this.particleMaxAge = (int)(8.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.motionY += 0.002D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.8500000238418579D;
this.motionY *= 0.8500000238418579D;
this.motionZ *= 0.8500000238418579D;
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 EntityBubbleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
}
}
}

View file

@ -648,7 +648,7 @@ public class WorldClient extends AWorldClient
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.isUnlimited(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, ItemRegistry.getId(Items.potion));
}
ParticleType enumparticletypes = ParticleType.WATER_SPLASH;
ParticleType enumparticletypes = ParticleType.SPLASH;
float f = 1.0F;
float f1 = 1.0F;
float f2 = 1.0F;
@ -672,7 +672,7 @@ public class WorldClient extends AWorldClient
if (entityfx != null)
{
if(enumparticletypes != ParticleType.WATER_SPLASH) {
if(enumparticletypes != ParticleType.SPLASH) {
float f3 = 0.75F + this.rand.floatv() * 0.25F;
entityfx.setRBGColorF(f * f3, f1 * f3, f2 * f3);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before After
Before After