Skip to content

Commit

Permalink
Misc particle work
Browse files Browse the repository at this point in the history
  • Loading branch information
Andromander committed May 13, 2021
1 parent 8670152 commit 9dce709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class PurifierFireParticle extends SpriteTexturedParticle {
public class PurifierFireParticle extends DeceleratingParticle {

public PurifierFireParticle(ClientWorld worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.xd = this.xd * 0.009999999776482582D + xSpeedIn;
this.yd = this.yd * 0.009999999776482582D + ySpeedIn;
this.zd = this.zd * 0.009999999776482582D + zSpeedIn;
this.x += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.y += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.z += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.rCol = 1.0F;
this.gCol = 1.0F;
this.bCol = 1.0F;
this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4;
}

@Override
Expand Down Expand Up @@ -50,27 +40,6 @@ public int getLightColor(float partialTick) {
return j | k << 16;
}

@Override
public void tick() {
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;

if (this.age++ >= this.lifetime) {
this.remove();
}

this.move(this.xd, this.yd, this.zd);
this.xd *= 0.9599999785423279D;
this.yd *= 0.9599999785423279D;
this.zd *= 0.9599999785423279D;

if (this.onGround) {
this.xd *= 0.699999988079071D;
this.zd *= 0.699999988079071D;
}
}

@OnlyIn(Dist.CLIENT)
public static class Factory implements IParticleFactory<BasicParticleType> {
private final IAnimatedSprite spriteSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,13 @@
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class RestructurerFireParticle extends SpriteTexturedParticle {
public class RestructurerFireParticle extends DeceleratingParticle {

public RestructurerFireParticle(ClientWorld worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
this.xd = this.xd * 0.009999999776482582D + xSpeedIn;
this.yd = this.yd * 0.009999999776482582D + ySpeedIn;
this.zd = this.zd * 0.009999999776482582D + zSpeedIn;
this.x += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.y += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.z += (double)((this.random.nextFloat() - this.random.nextFloat()) * 0.05F);
this.rCol = 1.0F;
this.gCol = 1.0F;
this.bCol = 1.0F;
this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4;
}

@Override
Expand Down Expand Up @@ -51,26 +40,6 @@ public int getLightColor(float partialTick) {
return j | k << 16;
}

public void onUpdate() {
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;

if (this.age++ >= this.lifetime) {
this.remove();
}

this.move(this.xd, this.yd, this.zd);
this.xd *= 0.9599999785423279D;
this.yd *= 0.9599999785423279D;
this.zd *= 0.9599999785423279D;

if (this.onGround) {
this.xd *= 0.699999988079071D;
this.zd *= 0.699999988079071D;
}
}

@OnlyIn(Dist.CLIENT)
public static class Factory implements IParticleFactory<BasicParticleType> {
private final IAnimatedSprite spriteSet;
Expand Down

0 comments on commit 9dce709

Please sign in to comment.