-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 61 additions & 60 deletions
121
src/client/java/org/ladysnake/effective/core/particle/MistParticle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,61 @@ | ||
//package org.ladysnake.effective.core.particle; | ||
// | ||
//import net.fabricmc.api.EnvType; | ||
//import net.fabricmc.api.Environment; | ||
//import net.minecraft.client.particle.*; | ||
//import net.minecraft.client.world.ClientWorld; | ||
//import net.minecraft.particle.SimpleParticleType; | ||
//import org.ladysnake.effective.core.Effective; | ||
// | ||
//public class MistParticle extends SpriteBillboardParticle { | ||
// public MistParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
// super(world, x, y, z, velocityX, velocityY, velocityZ); | ||
// | ||
// this.velocityX = velocityX; | ||
// this.velocityY = velocityY; | ||
// this.velocityZ = velocityZ; | ||
// | ||
// this.setSpriteForAge(spriteProvider); | ||
// | ||
// this.scale = 10f + world.random.nextFloat() * 5f; | ||
// this.maxAge = 0; | ||
// this.alpha = 0.01f; | ||
// | ||
//// WorldParticleBuilder.create(Effective.MIST) | ||
//// .enableForcedSpawn() | ||
//// .setSpinData(SpinParticleData.create((world.random.nextFloat() - world.random.nextFloat()) / 20f).build()) | ||
//// .setScaleData(GenericParticleData.create(10f + world.random.nextFloat() * 5f).build()) | ||
//// .setTransparencyData( | ||
//// GenericParticleData.create(0.001f, 0.1f, 0f) | ||
//// .setEasing(Easing.EXPO_OUT, Easing.SINE_OUT) | ||
//// .build() | ||
//// ) | ||
//// .setLifetime(300) | ||
//// .enableNoClip() | ||
//// .setNaturalLighting() | ||
//// .setRenderType(LodestoneWorldParticleRenderType.TRANSPARENT.withDepthFade()) | ||
//// .setColorData(ColorParticleData.create(waterfall.mistColor(), waterfall.mistColor()).build()) | ||
//// .setMotion(world.getRandom().nextFloat() / 15f * Math.signum(offsetX), world.getRandom().nextGaussian() / 25f, world.getRandom().nextFloat() / 15f * Math.signum(offsetZ)) | ||
//// .spawn(world, blockPos.getX() + .5f, blockPos.getY() + .5f, blockPos.getZ() + .5f); | ||
// } | ||
// | ||
// @Override | ||
// public ParticleTextureSheet getType() { | ||
// return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; | ||
// } | ||
// | ||
// @Environment(EnvType.CLIENT) | ||
// public static class Factory implements ParticleFactory<SimpleParticleType> { | ||
// private final SpriteProvider spriteProvider; | ||
// | ||
// public Factory(SpriteProvider spriteProvider) { | ||
// this.spriteProvider = spriteProvider; | ||
// } | ||
// | ||
// @Override | ||
// public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
// return new MistParticle(world, x, y, z, velocityX, velocityY, velocityZ, this.spriteProvider); | ||
// } | ||
// } | ||
//} | ||
package org.ladysnake.effective.core.particle; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.particle.*; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particle.SimpleParticleType; | ||
import org.ladysnake.effective.core.Effective; | ||
import org.ladysnake.effective.core.render.particle.SoftParticleRenderType; | ||
|
||
public class MistParticle extends SpriteBillboardParticle { | ||
public MistParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
super(world, x, y, z, velocityX, velocityY, velocityZ); | ||
|
||
this.velocityX = velocityX; | ||
this.velocityY = velocityY; | ||
this.velocityZ = velocityZ; | ||
|
||
this.setSpriteForAge(spriteProvider); | ||
|
||
this.scale = 10f + world.random.nextFloat() * 5f; | ||
this.maxAge = 100; | ||
this.alpha = 0.1f; | ||
|
||
// WorldParticleBuilder.create(Effective.MIST) | ||
// .enableForcedSpawn() | ||
// .setSpinData(SpinParticleData.create((world.random.nextFloat() - world.random.nextFloat()) / 20f).build()) | ||
// .setScaleData(GenericParticleData.create(10f + world.random.nextFloat() * 5f).build()) | ||
// .setTransparencyData( | ||
// GenericParticleData.create(0.001f, 0.1f, 0f) | ||
// .setEasing(Easing.EXPO_OUT, Easing.SINE_OUT) | ||
// .build() | ||
// ) | ||
// .setLifetime(300) | ||
// .enableNoClip() | ||
// .setNaturalLighting() | ||
// .setRenderType(LodestoneWorldParticleRenderType.TRANSPARENT.withDepthFade()) | ||
// .setColorData(ColorParticleData.create(waterfall.mistColor(), waterfall.mistColor()).build()) | ||
// .setMotion(world.getRandom().nextFloat() / 15f * Math.signum(offsetX), world.getRandom().nextGaussian() / 25f, world.getRandom().nextFloat() / 15f * Math.signum(offsetZ)) | ||
// .spawn(world, blockPos.getX() + .5f, blockPos.getY() + .5f, blockPos.getZ() + .5f); | ||
} | ||
|
||
@Override | ||
public ParticleTextureSheet getType() { | ||
return SoftParticleRenderType.SOFT_PARTICLE; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public static class Factory implements ParticleFactory<SimpleParticleType> { | ||
private final SpriteProvider spriteProvider; | ||
|
||
public Factory(SpriteProvider spriteProvider) { | ||
this.spriteProvider = spriteProvider; | ||
} | ||
|
||
@Override | ||
public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
return new MistParticle(world, x, y, z, velocityX, velocityY, velocityZ, this.spriteProvider); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters