Search in sources :

Example 11 with InterpFadeInOut

use of com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut 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 InterpFadeInOut(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, Constants.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) 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 12 with InterpFadeInOut

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

the class LibParticles method FAIRY_HEAD.

public static void FAIRY_HEAD(World world, Vec3d pos, Color color) {
    ParticleBuilder glitter = new ParticleBuilder(3);
    glitter.setColor(color);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
    glitter.setScale(3.5f);
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 2);
    ParticleBuilder glitter2 = new ParticleBuilder(5);
    glitter2.setColor(color);
    glitter2.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    glitter2.setAlphaFunction(new InterpFadeInOut(0.2f, 1f));
    glitter2.setScale(1);
    ParticleSpawner.spawn(glitter2, world, new StaticInterp<>(pos), 3);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder)

Example 13 with InterpFadeInOut

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

the class LibParticles method BOOK_LARGE_EXPLOSION.

public static void BOOK_LARGE_EXPLOSION(World world, Vec3d pos) {
    ParticleBuilder glitter = new ParticleBuilder(1000);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1000, 0, (i, build) -> {
        double radius = 1.0;
        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(0, RandUtil.nextDouble(0, 255.0), 0));
        glitter.setMotion(new Vec3d(x, 0, z));
        glitter.setJitter(10, new Vec3d(RandUtil.nextDouble(-0.05, 0.05), RandUtil.nextDouble(-0.05, -0.01), RandUtil.nextDouble(-0.05, 0.05)));
        glitter.enableMotionCalculation();
        glitter.setColor(new Color(255, 255, 255, RandUtil.nextInt(70, 170)));
        glitter.setScale((float) RandUtil.nextDouble(0.3, 0.5));
    });
}
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 14 with InterpFadeInOut

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

the class LibParticles method BOOK_BEAM_HELIX.

public static void BOOK_BEAM_HELIX(World world, Vec3d pos) {
    ParticleBuilder helix = new ParticleBuilder(200);
    helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    helix.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
    ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 30, 0, (aFloat, particleBuilder) -> {
        helix.setColor(new Color(255, 255, 255, RandUtil.nextInt(0, 255)));
        helix.setScale(RandUtil.nextFloat());
        helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(1.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
        helix.setLifetime(RandUtil.nextInt(0, 200));
    });
}
Also used : InterpHelix(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix) 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 15 with InterpFadeInOut

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