use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder 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 InterpFadeInOut(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, Constants.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.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method FAIRY_HEAD.
public static void FAIRY_HEAD(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(3);
glitter.setColor(color);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
glitter.setScale(3.5f);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 2);
ParticleBuilder glitter2 = new ParticleBuilder(5);
glitter2.setColor(color);
glitter2.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter2.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
glitter2.setScale(1);
ParticleSpawner.spawn(glitter2, world, new StaticInterp<>(pos), 3);
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method BOOK_LARGE_EXPLOSION.
public static void BOOK_LARGE_EXPLOSION(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(1000);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1000, 0, (i, build) -> {
double radius = 1.0;
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.setPositionOffset(new Vec3d(0, RandUtil.nextDouble(0, 255.0), 0));
glitter.setMotion(new Vec3d(x, 0, z));
glitter.setJitter(10, new Vec3d(RandUtil.nextDouble(-0.05, 0.05), RandUtil.nextDouble(-0.05, -0.01), RandUtil.nextDouble(-0.05, 0.05)));
glitter.enableMotionCalculation();
glitter.setColor(new Color(255, 255, 255, RandUtil.nextInt(70, 170)));
glitter.setScale((float) RandUtil.nextDouble(0.3, 0.5));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method BOOK_BEAM_HELIX.
public static void BOOK_BEAM_HELIX(World world, Vec3d pos) {
ParticleBuilder helix = new ParticleBuilder(200);
helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
helix.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 30, 0, (aFloat, particleBuilder) -> {
helix.setColor(new Color(255, 255, 255, RandUtil.nextInt(0, 255)));
helix.setScale(RandUtil.nextFloat());
helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(1.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
helix.setLifetime(RandUtil.nextInt(0, 200));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder 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 InterpFadeInOut(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)));
});
}
Aggregations