Skip to content

Commit

Permalink
cone of cold particles
Browse files Browse the repository at this point in the history
  • Loading branch information
iron431 committed Jul 17, 2024
1 parent db73bec commit 293eef7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions LATEST_CHANGES.MD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Apprentice Spell Book now gives +50 Max Mana
- Tweaked Alchemist Cauldron Texture
- Removed strict hold-to-cast mechanics from scrolls and casting implements
- Adjust Cone of Cold particles

### Fixes
- Fixed JEI Scroll Upgrade recipes showing one additional level past max level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public void spawnParticles() {
double y = pos.y + owner.getEyeHeight() * .9f;
double z = pos.z;

double speed = random.nextDouble() * .4 + .45;
for (int i = 0; i < 10; i++) {
double speed = random.nextDouble() * .7 + .15;
double offset = .125;
double ox = Math.random() * 2 * offset - offset;
double oy = Math.random() * 2 * offset - offset;
Expand All @@ -50,10 +50,10 @@ public void spawnParticles() {
level.addParticle(Math.random() > .15 ? ParticleHelper.SNOW_DUST : ParticleHelper.SNOWFLAKE, x + ox, y + oy, z + oz, result.x, result.y, result.z);

}
if (tickCount % 12 == 0) {
var forward = rotation.scale(.5f);
level.addParticle(ParticleRegistry.RING_SMOKE_PARTICLE.get(), x, y, z, forward.x, forward.y, forward.z);
}
// if (tickCount % 12 == 0) {
// var forward = rotation.scale(.5f);
// level.addParticle(ParticleRegistry.RING_SMOKE_PARTICLE.get(), x, y, z, forward.x, forward.y, forward.z);
// }
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
package io.redspace.ironsspellbooks.particle;

import io.redspace.ironsspellbooks.api.util.Utils;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.particle.SpriteSet;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraft.util.Mth;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class SnowDustParticle extends SnowflakeParticle {
float maxSize, minSize;

public SnowDustParticle(ClientLevel level, double xCoord, double yCoord, double zCoord, SpriteSet spriteSet, double xd, double yd, double zd) {
super(level, xCoord, yCoord, zCoord, spriteSet, xd, yd, zd);
this.minSize = this.quadSize;
this.maxSize = Utils.random.nextFloat() * .4f + .7f;
}

@Override
public void tick() {
super.tick();
this.quadSize = Mth.clampedLerp(minSize, maxSize, this.age / (float) this.lifetime);
}

public ParticleRenderType getRenderType() {
Expand Down

0 comments on commit 293eef7

Please sign in to comment.