use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method STRUCTURE_FLAIR.
public static void STRUCTURE_FLAIR(World world, Vec3d pos, Color color) {
ParticleBuilder glitter = new ParticleBuilder(10);
glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0F, 0.9F));
glitter.setColor(color);
glitter.setLifetime(40);
glitter.setScale(2);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
build.setScale(5);
});
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 10, 0, (i, build) -> {
build.setScale(2);
int x = RandUtil.nextInt(4);
switch(x) {
case 0:
glitter.setMotion(new Vec3d(0, 0, 0.2));
break;
case 1:
glitter.setMotion(new Vec3d(0, 0, -0.2));
break;
case 2:
glitter.setMotion(new Vec3d(0.2, 0, 0));
break;
case 3:
glitter.setMotion(new Vec3d(-0.2, 0, 0));
break;
}
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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, NBTConstants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(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 InterpFloatInOut(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.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.
the class LibParticles method SPIRIT_WIGHT_HURT.
public static void SPIRIT_WIGHT_HURT(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
glitter.setColorFunction(new InterpColorHSV(Color.BLUE, 50, 20.0F));
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFloatInOut(0.1f, 0.1f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(40, 100), 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.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.4), z));
glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0, 0.02), 0));
});
}
use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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)));
});
}
Aggregations