use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method SPIRIT_WIGHT_FLAME_FAR.
public static void SPIRIT_WIGHT_FLAME_FAR(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 5, 0, (i, build) -> {
double radius = 0.15;
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.setColorFunction(new InterpColorHSV(Color.RED, 50, 20.0F));
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.5), z));
glitter.addMotion(new Vec3d(0, RandUtil.nextDouble(0, 0.02), 0));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method BLOCK_HIGHLIGHT.
public static void BLOCK_HIGHLIGHT(World world, BlockPos pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
glitter.setColor(color);
glitter.disableRandom();
glitter.disableMotionCalculation();
glitter.setScale(2f);
glitter.setLifetime(200);
double indent = 0.75;
Vec3d bottom = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5 - indent, pos.getZ() + 0.5);
Vec3d top = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5 + indent, pos.getZ() + 0.5);
Vec3d front = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 + indent);
Vec3d back = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 - indent);
Vec3d left = new Vec3d(pos.getX() + 0.5 + indent, pos.getY() + 0.5, pos.getZ() + 0.5);
Vec3d right = new Vec3d(pos.getX() + 0.5 - indent, pos.getY() + 0.5, pos.getZ() + 0.5);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(bottom), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(top), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(left), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(right), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(front), 1);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(back), 1);
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method FIZZING_EXPLOSION.
public static void FIZZING_EXPLOSION(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setScale(0.3f);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 300, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(20, 30));
glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5)));
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method MAGIC_DOT.
public static void MAGIC_DOT(World world, Vec3d pos, float scale) {
ParticleBuilder glitter = new ParticleBuilder(3);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.enableMotionCalculation();
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColor(new Color(RandUtil.nextInt(0, 100), RandUtil.nextInt(0, 100), RandUtil.nextInt(50, 255)));
if (scale == -1)
glitter.setScale(RandUtil.nextFloat());
else {
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0.3), 0));
glitter.setLifetime(RandUtil.nextInt(30));
glitter.setScale(scale);
}
});
}
use of com.teamwizardry.librarianlib.features.particle.ParticleBuilder in project Wizardry by TeamWizardry.
the class LibParticles method DEVIL_DUST_BIG_CRACKLES.
public static void DEVIL_DUST_BIG_CRACKLES(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setScale(RandUtil.nextFloat());
glitter.setColor(new Color(RandUtil.nextFloat(), 0, 0));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, builder) -> {
Vec3d offset = new Vec3d(RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5));
glitter.setPositionOffset(offset);
glitter.setLifetime(RandUtil.nextInt(30, 50));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(0.04, 0.06), RandUtil.nextDouble(-0.01, 0.01)));
});
}
Aggregations