use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method STRUCTURE_BEACON.
public static void STRUCTURE_BEACON(World world, Vec3d pos, Color color) {
ParticleBuilder beacon = new ParticleBuilder(10);
beacon.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
beacon.setScale(2);
beacon.setLifetime(40);
beacon.setAlphaFunction(new InterpFadeInOut(0F, 0.9F));
beacon.setColor(color);
ParticleSpawner.spawn(beacon, world, new StaticInterp<>(pos), 10, 0, (aFloat, particleBuilder) -> {
if (RandUtil.nextBoolean()) {
beacon.setMotion(new Vec3d(0, 0.2, 0));
} else {
beacon.setMotion(new Vec3d(0, -0.2, 0));
}
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method FIZZING_ITEM.
public static void FIZZING_ITEM(World world, Vec3d pos) {
ParticleBuilder fizz = new ParticleBuilder(10);
fizz.setScale(0.3f);
fizz.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
fizz.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(fizz, world, new StaticInterp<>(pos.addVector(0, 0.5, 0)), 10, 0, (aFloat, particleBuilder) -> {
fizz.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
fizz.setLifetime(RandUtil.nextInt(20, 30));
fizz.setPositionOffset(new Vec3d(RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1)));
fizz.setMotion(new Vec3d(RandUtil.nextDouble(-0.005, 0.005), RandUtil.nextDouble(0.04, 0.08), RandUtil.nextDouble(-0.005, 0.005)));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method DEVIL_DUST_SMALL_CRACKLES.
public static void DEVIL_DUST_SMALL_CRACKLES(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setColor(new Color(RandUtil.nextFloat(), 0, 0).darker());
glitter.setScale((float) RandUtil.nextDouble(0, 0.5));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 5, 0, (i, builder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 30));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.03, 0.03), RandUtil.nextDouble(0.07, 0.2), RandUtil.nextDouble(-0.03, 0.03)));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method EFFECT_REGENERATE.
public static void EFFECT_REGENERATE(World world, @Nonnull Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setColor(ColorUtils.changeColorAlpha(color, RandUtil.nextInt(200, 255)));
glitter.setScale(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.disableRandom();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 20, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 40));
glitter.setScale(RandUtil.nextFloat());
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
double radius = 1;
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
Vec3d dest = new Vec3d(x, RandUtil.nextDouble(-1, 1), z);
glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, dest, dest.scale(2), new Vec3d(dest.x, RandUtil.nextDouble(-2, 2), dest.z)));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method CRAFTING_ALTAR_HELIX.
public static void CRAFTING_ALTAR_HELIX(World world, Vec3d pos) {
ParticleBuilder beam = new ParticleBuilder(200);
beam.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
beam.setAlphaFunction(new InterpFadeInOut(1f, 1f));
pos = pos.addVector(0, 0.75, 0);
ParticleSpawner.spawn(beam, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
beam.setScale(RandUtil.nextFloat());
beam.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
beam.setMotion(new Vec3d(0, RandUtil.nextDouble(0.1, 0.8), 0));
beam.setLifetime(RandUtil.nextInt(0, 40));
});
ParticleBuilder helix = new ParticleBuilder(200);
helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
helix.setAlphaFunction(new InterpFadeInOut(1f, 1f));
ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
helix.setScale(RandUtil.nextFloat());
helix.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(200, 255)));
helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(0.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
helix.setLifetime(RandUtil.nextInt(0, 100));
});
}
Aggregations