use of com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix in project Wizardry by TeamWizardry.
the class ModuleEffectAntiGravityWell method render.
@Override
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
Vec3d position = spell.getData(ORIGIN);
if (position == null)
return;
if (RandUtil.nextInt(10) != 0)
return;
ParticleBuilder glitter = new ParticleBuilder(0);
glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
ParticleSpawner.spawn(glitter, spell.world, new StaticInterp<>(position), 5, 0, (aFloat, particleBuilder) -> {
glitter.setScale((float) RandUtil.nextDouble(0.3, 1));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, (float) RandUtil.nextDouble(0.6, 1)));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setLifetime(RandUtil.nextInt(20, 40));
glitter.setScaleFunction(new InterpScale(1, 0));
if (RandUtil.nextBoolean())
glitter.setPositionFunction(new InterpHelix(new Vec3d(0, 0, 0), new Vec3d(0, 2, 0), 0.5f, 0, 1, RandUtil.nextFloat()));
else
glitter.setPositionFunction(new InterpHelix(new Vec3d(0, 0, 0), new Vec3d(0, -2, 0), 0.5f, 0, 1, RandUtil.nextFloat()));
});
}
Aggregations