Search in sources :

Example 6 with InterpHelix

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()));
    });
}
Also used : InterpHelix(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix) InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

InterpHelix (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix)6 ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)6 InterpFadeInOut (com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut)6 ResourceLocation (net.minecraft.util.ResourceLocation)6 Vec3d (net.minecraft.util.math.Vec3d)6 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)3 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)1 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)1 Wizardry (com.teamwizardry.wizardry.Wizardry)1 Constants (com.teamwizardry.wizardry.api.Constants)1 IBlockSelectable (com.teamwizardry.wizardry.api.spell.IBlockSelectable)1 SpellData (com.teamwizardry.wizardry.api.spell.SpellData)1 FACE_HIT (com.teamwizardry.wizardry.api.spell.SpellData.DefaultKeys.FACE_HIT)1 SpellRing (com.teamwizardry.wizardry.api.spell.SpellRing)1 AttributeRegistry (com.teamwizardry.wizardry.api.spell.attribute.AttributeRegistry)1 ModuleEffect (com.teamwizardry.wizardry.api.spell.module.ModuleEffect)1 ModuleModifier (com.teamwizardry.wizardry.api.spell.module.ModuleModifier)1 RegisterModule (com.teamwizardry.wizardry.api.spell.module.RegisterModule)1