Search in sources :

Example 31 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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) InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 32 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method STRUCTURE_FLAIR.

public static void STRUCTURE_FLAIR(World world, Vec3d pos, Color color) {
    ParticleBuilder glitter = new ParticleBuilder(10);
    glitter.setRenderNormalLayer(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(0F, 0.9F));
    glitter.setColor(color);
    glitter.setLifetime(40);
    glitter.setScale(2);
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
        build.setScale(5);
    });
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 10, 0, (i, build) -> {
        build.setScale(2);
        int x = RandUtil.nextInt(4);
        switch(x) {
            case 0:
                glitter.setMotion(new Vec3d(0, 0, 0.2));
                break;
            case 1:
                glitter.setMotion(new Vec3d(0, 0, -0.2));
                break;
            case 2:
                glitter.setMotion(new Vec3d(0.2, 0, 0));
                break;
            case 3:
                glitter.setMotion(new Vec3d(-0.2, 0, 0));
                break;
        }
    });
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 33 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method MAGIC_DOT.

public static void MAGIC_DOT(World world, Vec3d pos, float scale) {
    ParticleBuilder glitter = new ParticleBuilder(3);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, NBTConstants.MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(1f, 1f));
    glitter.enableMotionCalculation();
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
        glitter.setColor(new Color(RandUtil.nextInt(0, 100), RandUtil.nextInt(0, 100), RandUtil.nextInt(50, 255)));
        if (scale == -1)
            glitter.setScale(RandUtil.nextFloat());
        else {
            glitter.setAlphaFunction(new InterpFloatInOut(1f, 1f));
            glitter.setMotion(new Vec3d(0, RandUtil.nextDouble(0.3), 0));
            glitter.setLifetime(RandUtil.nextInt(30));
            glitter.setScale(scale);
        }
    });
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 34 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut 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 InterpFloatInOut(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) InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 35 with InterpFloatInOut

use of com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut in project Wizardry by TeamWizardry.

the class LibParticles method FIZZING_EXPLOSION.

public static void FIZZING_EXPLOSION(World world, Vec3d pos) {
    ParticleBuilder glitter = new ParticleBuilder(50);
    glitter.setScale(0.3f);
    glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
    glitter.setAlphaFunction(new InterpFloatInOut(0.0f, 0.3f));
    ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 300, 0, (aFloat, particleBuilder) -> {
        glitter.setLifetime(RandUtil.nextInt(20, 30));
        glitter.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(100, 255)));
        glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5), RandUtil.nextDouble(-0.5, 0.5)));
    });
}
Also used : InterpFloatInOut(com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut) ResourceLocation(net.minecraft.util.ResourceLocation) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

InterpFloatInOut (com.teamwizardry.librarianlib.features.math.interpolate.numeric.InterpFloatInOut)65 ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)65 ResourceLocation (net.minecraft.util.ResourceLocation)65 Vec3d (net.minecraft.util.math.Vec3d)62 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)32 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)30 InterpColorHSV (com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV)21 Entity (net.minecraft.entity.Entity)15 ClientRunnable (com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable)13 StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)11 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)11 Wizardry (com.teamwizardry.wizardry.Wizardry)11 NBTConstants (com.teamwizardry.wizardry.api.NBTConstants)11 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)11 Side (net.minecraftforge.fml.relauncher.Side)11 java.awt (java.awt)10 World (net.minecraft.world.World)10 MathHelper (net.minecraft.util.math.MathHelper)9 EntityLivingBase (net.minecraft.entity.EntityLivingBase)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)8