Search in sources :

Example 6 with InterpColorHSV

use of com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV in project Wizardry by TeamWizardry.

the class LibParticles method EXPLODE.

public static void EXPLODE(World world, Vec3d pos, Color color1, Color color2, double strengthUpwards, double strengthSideways, int amount, int lifeTime, int lifeTimeRange, boolean bounce) {
    ParticleBuilder glitter = new ParticleBuilder(10);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setCollision(true);
    glitter.enableMotionCalculation();
    glitter.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(color1, RandUtil.nextInt(50, 150)), ColorUtils.changeColorAlpha(color2, RandUtil.nextInt(50, 150))));
    glitter.setAcceleration(new Vec3d(0, RandUtil.nextDouble(-0.03, -0.04), 0));
    glitter.setCanBounce(true);
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), amount, 0, (i, build) -> {
        double radius = RandUtil.nextDouble(1, 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);
        Vec3d normalize = new Vec3d(x, 0, z).normalize();
        glitter.setMotion(new Vec3d(normalize.x * RandUtil.nextDouble(-strengthSideways, strengthSideways), RandUtil.nextDouble(-strengthUpwards, strengthUpwards), normalize.z * RandUtil.nextDouble(-strengthSideways, strengthSideways)));
        glitter.setAlphaFunction(new InterpFadeInOut(0.0f, RandUtil.nextFloat()));
        glitter.setLifetime(RandUtil.nextInt(lifeTime - lifeTimeRange, lifeTime + lifeTimeRange));
        glitter.setScale(RandUtil.nextFloat());
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) 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)

Example 7 with InterpColorHSV

use of com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV in project Wizardry by TeamWizardry.

the class LibParticles method COLORFUL_BATTERY_BEZIER.

public static void COLORFUL_BATTERY_BEZIER(World world, BlockPos pedestal, BlockPos center) {
    ParticleBuilder glitter = new ParticleBuilder(200);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFadeInOut(0.5f, 0.3f));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pedestal).addVector(0.5, 1, 0.5)), 1, 0, (aFloat, particleBuilder) -> {
        glitter.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
        glitter.setScale(RandUtil.nextFloat());
        glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, new Vec3d(center.subtract(pedestal)), new Vec3d(0, 3, 0), new Vec3d(0, 5, 0)));
        glitter.setScaleFunction(new InterpScale(1, 0.4f));
        glitter.setLifetime(RandUtil.nextInt(10, 30));
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) InterpBezier3D(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpBezier3D) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 8 with InterpColorHSV

use of com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV in project Wizardry by TeamWizardry.

the class LibParticles method CRAFTING_ALTAR_CLUSTER_SUCTION.

public static void CRAFTING_ALTAR_CLUSTER_SUCTION(World world, Vec3d pos, InterpFunction<Vec3d> bezier3D) {
    ParticleBuilder helix = new ParticleBuilder(200);
    helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    helix.setAlphaFunction(new InterpFadeInOut(0.5f, 0.3f));
    ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
        helix.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
        helix.setScale(RandUtil.nextFloat());
        helix.setPositionFunction(bezier3D);
        helix.setScaleFunction(new InterpScale(1, 0));
        helix.setLifetime(RandUtil.nextInt(10, 30));
    });
}
Also used : 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)

Example 9 with InterpColorHSV

use of com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV 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 InterpFadeInOut(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));
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) 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)

Example 10 with InterpColorHSV

use of com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV 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));
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) 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)

Aggregations

ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)14 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)14 InterpFadeInOut (com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut)14 ResourceLocation (net.minecraft.util.ResourceLocation)14 Vec3d (net.minecraft.util.math.Vec3d)13 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)10 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)8 World (net.minecraft.world.World)5 InterpHelix (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix)3 InterpLine (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpLine)2 SpellRing (com.teamwizardry.wizardry.api.spell.SpellRing)2 Entity (net.minecraft.entity.Entity)2 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)1 InterpBezier3D (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpBezier3D)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