use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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, NBTConstants.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 InterpFloatInOut(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.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method COLORFUL_BATTERY_BEZIER.
public static void COLORFUL_BATTERY_BEZIER(World world, BlockPos pedestal, BlockPos center) {
ParticleBuilder glitter = new ParticleBuilder(200);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.5f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pedestal).add(0.5, 1, 0.5)), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
glitter.setScale(RandUtil.nextFloat());
glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, new Vec3d(center.subtract(pedestal)), new Vec3d(0, 3, 0), new Vec3d(0, 5, 0)));
glitter.setScaleFunction(new InterpScale(1, 0.4f));
glitter.setLifetime(RandUtil.nextInt(10, 30));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(1f, 1f));
pos = pos.add(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 InterpFloatInOut(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));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method SPIRIT_WIGHT_FLAME_CLOSE.
public static void SPIRIT_WIGHT_FLAME_CLOSE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 20, 0, (i, build) -> {
double radius = 0.2;
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);
glitter.setColor(Color.RED);
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.5), z));
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(0, 0.03), RandUtil.nextDouble(-0.02, 0.02)));
});
}
Aggregations