Search in sources :

Example 11 with InterpScale

use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.

the class ModuleEffectTelekinesis method render.

@Override
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
    World world = spell.world;
    Vec3d position = spell.getTarget();
    if (position == null)
        return;
    ParticleBuilder glitter = new ParticleBuilder(50);
    glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
    glitter.setScale(1);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position), 5, 0, (aFloat, particleBuilder) -> {
        glitter.setLifetime(RandUtil.nextInt(10, 20));
        glitter.setScale(RandUtil.nextFloat());
        glitter.setScaleFunction(new InterpScale(1, 0));
        glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
        glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1)));
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) World(net.minecraft.world.World) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 12 with InterpScale

use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.

the class ModuleEffectTimeSlow method render.

@Override
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
    World world = spell.world;
    Vec3d position = spell.getTarget();
    if (position == null)
        return;
    ParticleBuilder glitter = new ParticleBuilder(30);
    glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
    glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    glitter.disableRandom();
    glitter.setScaleFunction(new InterpScale(1, 0));
    glitter.setCollision(true);
    glitter.enableMotionCalculation();
    glitter.setAcceleration(new Vec3d(0, -0.001, 0));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position.addVector(0, 1, 0)), 3, 0, (aFloat, particleBuilder) -> {
        glitter.setLifetime(RandUtil.nextInt(30, 40));
        glitter.setScale(RandUtil.nextFloat());
        glitter.setAlphaFunction(new InterpFadeInOut(0.5f, RandUtil.nextFloat()));
        double radius = RandUtil.nextDouble(0, 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(-radius, radius), z);
        glitter.setPositionOffset(dest);
    // glitter.setPositionFunction(new InterpSlowDown(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(-1, 1), 0)));
    // glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, position.subtract(dest), dest.scale(2), new Vec3d(position.x, radius, position.z)));
    });
}
Also used : InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) World(net.minecraft.world.World) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 13 with InterpScale

use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.

the class LibParticles method CRAFTING_ALTAR_IDLE.

public static void CRAFTING_ALTAR_IDLE(World world, Vec3d pos) {
    ParticleBuilder glitter = new ParticleBuilder(30);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
    glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(0, 0.05), RandUtil.nextDouble(-0.01, 0.01)));
    glitter.setColor(new Color(0x0022FF));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
        double radius = 0.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);
        glitter.setScale((float) RandUtil.nextDouble(1, 2));
        glitter.setLifetime(RandUtil.nextInt(5, 30));
        glitter.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(1, 1.5), 0));
        glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.3), z));
    });
}
Also used : 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) Vec3d(net.minecraft.util.math.Vec3d)

Example 14 with InterpScale

use of com.teamwizardry.wizardry.api.util.interp.InterpScale 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 15 with InterpScale

use of com.teamwizardry.wizardry.api.util.interp.InterpScale 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)

Aggregations

ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)25 InterpFadeInOut (com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut)25 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)25 ResourceLocation (net.minecraft.util.ResourceLocation)25 Vec3d (net.minecraft.util.math.Vec3d)24 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)16 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)10 World (net.minecraft.world.World)10 Entity (net.minecraft.entity.Entity)6 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)5 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)5 ClientRunnable (com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable)5 Wizardry (com.teamwizardry.wizardry.Wizardry)5 Constants (com.teamwizardry.wizardry.api.Constants)5 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)5 Side (net.minecraftforge.fml.relauncher.Side)5 ModSounds (com.teamwizardry.wizardry.init.ModSounds)4 java.awt (java.awt)4 Nonnull (javax.annotation.Nonnull)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4