Search in sources :

Example 31 with InterpFadeInOut

use of com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut 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 32 with InterpFadeInOut

use of com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut 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 33 with InterpFadeInOut

use of com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut 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 34 with InterpFadeInOut

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

the class LibParticles method SPIRIT_WIGHT_FLAME_CLOSE.

public static void SPIRIT_WIGHT_FLAME_CLOSE(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), 20, 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.setColor(Color.RED);
        glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.5), z));
        glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.02, 0.02), RandUtil.nextDouble(0, 0.03), RandUtil.nextDouble(-0.02, 0.02)));
    });
}
Also used : 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 35 with InterpFadeInOut

use of com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut 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)

Aggregations

ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)62 InterpFadeInOut (com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut)62 ResourceLocation (net.minecraft.util.ResourceLocation)61 Vec3d (net.minecraft.util.math.Vec3d)59 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)25 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)22 World (net.minecraft.world.World)15 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)14 ClientRunnable (com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable)11 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)9 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)9 Wizardry (com.teamwizardry.wizardry.Wizardry)9 Constants (com.teamwizardry.wizardry.api.Constants)9 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)9 Entity (net.minecraft.entity.Entity)9 Side (net.minecraftforge.fml.relauncher.Side)9 java.awt (java.awt)8 InterpCircle (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpCircle)7 MathHelper (net.minecraft.util.math.MathHelper)7 InterpHelix (com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix)6