use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method CLUSTER_DRAPE.
public static void CLUSTER_DRAPE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(200);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.3f, 0.3f));
glitter.enableMotionCalculation();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setScale(RandUtil.nextFloat());
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(-0.01, 0.01)));
glitter.setLifetime(RandUtil.nextInt(30, 60));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method EFFECT_NULL_GRAV.
public static void EFFECT_NULL_GRAV(World world, @Nonnull Vec3d pos, @Nullable EntityLivingBase caster, Color color) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(20, 30));
glitter.setColor(color == null ? Color.WHITE : color);
glitter.setAlphaFunction(new InterpFloatInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(5, 10), RandUtil.nextInt(0, 30), (aFloat, particleBuilder) -> {
glitter.setScale((float) RandUtil.nextDouble(0.3, 0.8));
glitter.setRender(new ResourceLocation(Wizardry.MODID, NBTConstants.MISC.SPARKLE_BLURRED));
if (RandUtil.nextBoolean())
glitter.setPositionFunction(new InterpHelix(new Vec3d(0, caster == null ? 1 / 2 : caster.height / 2, 0), new Vec3d(0, caster == null ? -1 : -caster.height, 0), 1f, 0f, 1f, RandUtil.nextFloat()));
else
glitter.setPositionFunction(new InterpHelix(new Vec3d(0, caster == null ? 1 / 2 : caster.height / 2, 0), new Vec3d(0, caster == null ? 1.5 : caster.height + 0.5, 0), 1f, 0f, 1f, RandUtil.nextFloat()));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method AIR_THROTTLE.
public static void AIR_THROTTLE(World world, Vec3d pos, Vec3d normal, Color color1, Color color2, double scatter) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(30, 50));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.1f, 0.3f));
glitter.enableMotionCalculation();
glitter.setCollision(true);
glitter.setAcceleration(new Vec3d(0, -0.01, 0));
glitter.setScaleFunction(new InterpScale(1, 0));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(40, 50), 1, (i, build) -> {
glitter.setMotion(new Vec3d(normal.x + RandUtil.nextDouble(-0.01, 0.01), normal.y + RandUtil.nextDouble(-0.01, 0.01), normal.z + RandUtil.nextDouble(-0.01, 0.01)));
if (RandUtil.nextBoolean())
glitter.setColor(color1);
else
glitter.setColor(color2);
if (scatter > 0) {
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = scatter * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(-scatter, scatter), z));
}
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method FIZZING_AMBIENT.
public static void FIZZING_AMBIENT(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setScale(0.3f);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pos.x + RandUtil.nextDouble(-0.5, 0.5), pos.y + RandUtil.nextDouble(-0.5, 0.5), pos.z + RandUtil.nextDouble(-0.5, 0.5))), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setLifetime(RandUtil.nextInt(20, 30));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.05, 0.05), RandUtil.nextDouble(0.05, 0.1), RandUtil.nextDouble(-0.05, 0.05)));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method STRUCTURE_BOUNDS.
public static void STRUCTURE_BOUNDS(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(10));
glitter.setScale(RandUtil.nextFloat());
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, NBTConstants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.9F, 0.9F));
glitter.setScale(2);
glitter.setLifetime(40);
glitter.setColor(color);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1);
}
Aggregations