Search in sources :

Example 6 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method CLUSTER_DRAPE.

public static void CLUSTER_DRAPE(World world, Vec3d pos) {
    ParticleBuilder glitter = new ParticleBuilder(200);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(0.3f, 0.3f));
    glitter.enableMotionCalculation();
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
        glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
        glitter.setScale(RandUtil.nextFloat());
        glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(-0.01, 0.01)));
        glitter.setLifetime(RandUtil.nextInt(30, 60));
    });
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 7 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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, NBTConstants.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()));
    });
}
Also used : InterpHelix(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix) InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 8 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method AIR_THROTTLE.

public static void AIR_THROTTLE(World world, Vec3d pos, Vec3d normal, Color color1, Color color2, double scatter) {
    ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(30, 50));
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(0.1f, 0.3f));
    glitter.enableMotionCalculation();
    glitter.setCollision(true);
    glitter.setAcceleration(new Vec3d(0, -0.01, 0));
    glitter.setScaleFunction(new InterpScale(1, 0));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), RandUtil.nextInt(40, 50), 1, (i, build) -> {
        glitter.setMotion(new Vec3d(normal.x + RandUtil.nextDouble(-0.01, 0.01), normal.y + RandUtil.nextDouble(-0.01, 0.01), normal.z + RandUtil.nextDouble(-0.01, 0.01)));
        if (RandUtil.nextBoolean())
            glitter.setColor(color1);
        else
            glitter.setColor(color2);
        if (scatter > 0) {
            double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
            double r = scatter * RandUtil.nextFloat();
            double x = r * MathHelper.cos((float) theta);
            double z = r * MathHelper.sin((float) theta);
            glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(-scatter, scatter), z));
        }
    });
}
Also used : InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 9 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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)));
    });
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 10 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method STRUCTURE_BOUNDS.

public static void STRUCTURE_BOUNDS(World world, Vec3d pos, Color color) {
    ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(10));
    glitter.setScale(RandUtil.nextFloat());
    glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, NBTConstants.MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(0.9F, 0.9F));
    glitter.setScale(2);
    glitter.setLifetime(40);
    glitter.setColor(color);
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1);
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder)

Aggregations

InterpFloatInOut (com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut)65 ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)65 ResourceLocation (net.minecraft.util.ResourceLocation)65 Vec3d (net.minecraft.util.math.Vec3d)62 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)32 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)30 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)21 Entity (net.minecraft.entity.Entity)15 ClientRunnable (com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable)13 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)11 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)11 Wizardry (com.teamwizardry.wizardry.Wizardry)11 NBTConstants (com.teamwizardry.wizardry.api.NBTConstants)11 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)11 Side (net.minecraftforge.fml.relauncher.Side)11 java.awt (java.awt)10 World (net.minecraft.world.World)10 MathHelper (net.minecraft.util.math.MathHelper)9 EntityLivingBase (net.minecraft.entity.EntityLivingBase)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)8