Search in sources :

Example 41 with ParticleBuilder

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

the class LibParticles method STRUCTURE_BEACON.

public static void STRUCTURE_BEACON(World world, Vec3d pos, Color color) {
    ParticleBuilder beacon = new ParticleBuilder(10);
    beacon.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    beacon.setScale(2);
    beacon.setLifetime(40);
    beacon.setAlphaFunction(new InterpFadeInOut(0F, 0.9F));
    beacon.setColor(color);
    ParticleSpawner.spawn(beacon, world, new StaticInterp<>(pos), 10, 0, (aFloat, particleBuilder) -> {
        if (RandUtil.nextBoolean()) {
            beacon.setMotion(new Vec3d(0, 0.2, 0));
        } else {
            beacon.setMotion(new Vec3d(0, -0.2, 0));
        }
    });
}
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 42 with ParticleBuilder

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

the class LibParticles method FIZZING_ITEM.

public static void FIZZING_ITEM(World world, Vec3d pos) {
    ParticleBuilder fizz = new ParticleBuilder(10);
    fizz.setScale(0.3f);
    fizz.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    fizz.setAlphaFunction(new InterpFadeInOut(0.3f, 0.3f));
    ParticleSpawner.spawn(fizz, world, new StaticInterp<>(pos.addVector(0, 0.5, 0)), 10, 0, (aFloat, particleBuilder) -> {
        fizz.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
        fizz.setLifetime(RandUtil.nextInt(20, 30));
        fizz.setPositionOffset(new Vec3d(RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1)));
        fizz.setMotion(new Vec3d(RandUtil.nextDouble(-0.005, 0.005), RandUtil.nextDouble(0.04, 0.08), RandUtil.nextDouble(-0.005, 0.005)));
    });
}
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 43 with ParticleBuilder

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

the class LibParticles method DEVIL_DUST_SMALL_CRACKLES.

public static void DEVIL_DUST_SMALL_CRACKLES(World world, Vec3d pos) {
    ParticleBuilder glitter = new ParticleBuilder(10);
    glitter.setColor(new Color(RandUtil.nextFloat(), 0, 0).darker());
    glitter.setScale((float) RandUtil.nextDouble(0, 0.5));
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFadeInOut(0.0f, 0.3f));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 5, 0, (i, builder) -> {
        glitter.setLifetime(RandUtil.nextInt(10, 30));
        glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.03, 0.03), RandUtil.nextDouble(0.07, 0.2), RandUtil.nextDouble(-0.03, 0.03)));
    });
}
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 44 with ParticleBuilder

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

the class LibParticles method EFFECT_REGENERATE.

public static void EFFECT_REGENERATE(World world, @Nonnull Vec3d pos, Color color) {
    ParticleBuilder glitter = new ParticleBuilder(50);
    glitter.setColor(ColorUtils.changeColorAlpha(color, RandUtil.nextInt(200, 255)));
    glitter.setScale(1);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    glitter.disableRandom();
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 20, 0, (aFloat, particleBuilder) -> {
        glitter.setLifetime(RandUtil.nextInt(10, 40));
        glitter.setScale(RandUtil.nextFloat());
        glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
        double radius = 1;
        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 dest = new Vec3d(x, RandUtil.nextDouble(-1, 1), z);
        glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, dest, dest.scale(2), new Vec3d(dest.x, RandUtil.nextDouble(-2, 2), dest.z)));
    });
}
Also used : 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 45 with ParticleBuilder

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

the class LibParticles method CRAFTING_ALTAR_HELIX.

public static void CRAFTING_ALTAR_HELIX(World world, Vec3d pos) {
    ParticleBuilder beam = new ParticleBuilder(200);
    beam.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    beam.setAlphaFunction(new InterpFadeInOut(1f, 1f));
    pos = pos.addVector(0, 0.75, 0);
    ParticleSpawner.spawn(beam, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
        beam.setScale(RandUtil.nextFloat());
        beam.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
        beam.setMotion(new Vec3d(0, RandUtil.nextDouble(0.1, 0.8), 0));
        beam.setLifetime(RandUtil.nextInt(0, 40));
    });
    ParticleBuilder helix = new ParticleBuilder(200);
    helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    helix.setAlphaFunction(new InterpFadeInOut(1f, 1f));
    ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
        helix.setScale(RandUtil.nextFloat());
        helix.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(200, 255)));
        helix.setPositionFunction(new InterpHelix(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(0.0, 255.0), 0), 0, RandUtil.nextInt(1, 5), RandUtil.nextInt(1, 5), 0));
        helix.setLifetime(RandUtil.nextInt(0, 100));
    });
}
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)

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