Search in sources :

Example 1 with StaticInterp

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

the class TileManaInteracter method suckManaFrom.

public boolean suckManaFrom(TileManaInteracter interacterFrom, SuckRule suckRule) {
    if (getWizardryCap() == null || interacterFrom.getWizardryCap() == null)
        return false;
    if (!isAllowOutsideSucking() && interacterFrom.isAllowOutsideSucking())
        return false;
    if (!suckRule.condition.test(this, interacterFrom))
        return false;
    CapManager thisManager = new CapManager(getWizardryCap());
    CapManager theirManager = new CapManager(interacterFrom.getWizardryCap());
    if (thisManager.isManaFull())
        return false;
    if (theirManager.isManaEmpty())
        return false;
    if (suckRule.equalize && Math.abs(thisManager.getMana() - theirManager.getMana()) <= suckRule.idealAmount)
        return false;
    Vec3d thisPos = new Vec3d(getPos()).addVector(0.5, 0.5, 0.5);
    Vec3d theirPos = new Vec3d(interacterFrom.getPos()).addVector(0.5, 0.5, 0.5);
    // DEBUG
    // ParticleBuilder helix = new ParticleBuilder(200);
    // helix.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
    // helix.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
    // ParticleSpawner.spawn(helix, world, new StaticInterp<>(thisPos), 1, 0, (someFloat, particleBuilder) -> {
    // particleBuilder.setColor(ColorUtils.changeColorAlpha(new Color(0xFF0000), RandUtil.nextInt(50, 200)));
    // particleBuilder.setScale(RandUtil.nextFloat(0.3f, 0.8f));
    // particleBuilder.disableRandom();
    // particleBuilder.setPositionFunction(new InterpLine(Vec3d.ZERO, theirPos.subtract(thisPos)));
    // particleBuilder.setLifetime(RandUtil.nextInt(50, 60));
    // });
    double ratio = theirManager.getMana() / thisManager.getMana();
    if (suckRule.equalize && Double.isFinite(ratio) && ratio <= 1.2)
        return false;
    if (getCachedDistanceSq(interacterFrom) > ConfigValues.networkLinkDistance * ConfigValues.networkLinkDistance)
        return false;
    if (!suckRule.ignoreTrace) {
        Vec3d thisSub = theirPos.subtract(thisPos.add(getOffset()));
        Vec3d thisNorm = thisSub.normalize();
        RayTraceResult trace = new RayTrace(world, thisNorm, thisPos.add(getOffset() == Vec3d.ZERO ? thisNorm : getOffset()), ConfigValues.networkLinkDistance * ConfigValues.networkLinkDistance).setSkipEntities(true).setIgnoreBlocksWithoutBoundingBoxes(true).trace();
        if (!trace.getBlockPos().equals(interacterFrom.getPos()))
            return false;
    }
    double amount = interacterFrom.drainMana(suckRule.idealAmount);
    if (amount <= 0)
        return false;
    thisManager.addMana(amount);
    ClientRunnable.run(new ClientRunnable() {

        @Override
        @SideOnly(Side.CLIENT)
        public void runIfClient() {
            ParticleBuilder helix = new ParticleBuilder(200);
            helix.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
            helix.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
            ParticleSpawner.spawn(helix, world, new StaticInterp<>(new Vec3d(interacterFrom.getPos()).addVector(0.5, 1, 0.5)), 1, 0, (someFloat, particleBuilder) -> {
                particleBuilder.setColor(ColorUtils.changeColorAlpha(new Color(0x0097FF), RandUtil.nextInt(50, 200)));
                particleBuilder.setScale(RandUtil.nextFloat(0.3f, 0.8f));
                particleBuilder.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, new Vec3d(getPos().subtract(interacterFrom.getPos())), new Vec3d(0, 5, 0), new Vec3d(0, -5, 0)));
                particleBuilder.setLifetime(RandUtil.nextInt(50, 60));
            });
        }
    });
    return true;
}
Also used : CapManager(com.teamwizardry.wizardry.api.capability.CapManager) java.util(java.util) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) ParticleSpawner(com.teamwizardry.librarianlib.features.particle.ParticleSpawner) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) RayTraceResult(net.minecraft.util.math.RayTraceResult) BiPredicate(java.util.function.BiPredicate) Module(com.teamwizardry.librarianlib.features.saving.Module) Vec3d(net.minecraft.util.math.Vec3d) Side(net.minecraftforge.fml.relauncher.Side) ITickable(net.minecraft.util.ITickable) TilePearlHolder(com.teamwizardry.wizardry.common.tile.TilePearlHolder) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) Save(com.teamwizardry.librarianlib.features.saving.Save) Nullable(javax.annotation.Nullable) ConfigValues(com.teamwizardry.wizardry.api.ConfigValues) InterpBezier3D(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpBezier3D) TileCraftingPlate(com.teamwizardry.wizardry.common.tile.TileCraftingPlate) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) IWizardryCapability(com.teamwizardry.wizardry.api.capability.IWizardryCapability) Wizardry(com.teamwizardry.wizardry.Wizardry) TileMod(com.teamwizardry.librarianlib.features.base.block.tile.TileMod) RayTrace(com.teamwizardry.wizardry.api.util.RayTrace) BlockPos(net.minecraft.util.math.BlockPos) ColorUtils(com.teamwizardry.wizardry.api.util.ColorUtils) CustomWizardryCapability(com.teamwizardry.wizardry.api.capability.CustomWizardryCapability) java.awt(java.awt) ManaModule(com.teamwizardry.wizardry.api.capability.ManaModule) TileManaBattery(com.teamwizardry.wizardry.common.tile.TileManaBattery) MathHelper(net.minecraft.util.math.MathHelper) ResourceLocation(net.minecraft.util.ResourceLocation) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) Constants(com.teamwizardry.wizardry.api.Constants) RayTraceResult(net.minecraft.util.math.RayTraceResult) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) CapManager(com.teamwizardry.wizardry.api.capability.CapManager) RayTrace(com.teamwizardry.wizardry.api.util.RayTrace) ResourceLocation(net.minecraft.util.ResourceLocation) InterpBezier3D(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpBezier3D)

Example 2 with StaticInterp

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

the class EntityBomb method onImpact.

@Override
protected void onImpact(RayTraceResult result) {
    if (getThrower() == null)
        return;
    if (result.entityHit != null && getThrower() != null && getThrower().getEntityId() == result.entityHit.getEntityId())
        return;
    int type = getDataManager().get(DATA_BOMB_TYPE);
    if (type == 0)
        PosUtils.boom(getEntityWorld(), getPositionVector(), null, 10, true);
    else
        PosUtils.boom(getEntityWorld(), getPositionVector(), null, 10, false);
    ClientRunnable.run(new ClientRunnable() {

        @SideOnly(Side.CLIENT)
        @Override
        public void runIfClient() {
            Color color, color2;
            if (type == 1) {
                color = Color.CYAN;
                color2 = Color.BLUE;
            } else {
                color = Color.RED;
                color2 = Color.ORANGE;
            }
            ParticleBuilder glitter = new ParticleBuilder(10);
            glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
            glitter.setCollision(true);
            glitter.setAcceleration(new Vec3d(0, RandUtil.nextDouble(-0.03, -0.04), 0));
            glitter.setCanBounce(true);
            glitter.enableMotionCalculation();
            ParticleSpawner.spawn(glitter, world, new StaticInterp<>(getPositionVector()), 500, 0, (i, build) -> {
                build.setMotion(Vec3d.ZERO);
                build.setLifetime(RandUtil.nextInt(50, 100));
                build.setAlphaFunction(new InterpFadeInOut(RandUtil.nextFloat(), RandUtil.nextFloat()));
                build.setScale(RandUtil.nextFloat(0.2f, 1));
                if (type == 0) {
                    double radius = RandUtil.nextDouble(20, 40);
                    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);
                    build.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(-radius, radius), z));
                    build.addMotion(build.getPositionOffset().scale(-1.0 / RandUtil.nextDouble(10, 30)));
                } else {
                    double radius = RandUtil.nextDouble(1, 3);
                    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);
                    build.addMotion(new Vec3d(x, RandUtil.nextDouble(-radius, radius), z));
                }
                if (RandUtil.nextBoolean())
                    build.setColor(color);
                else
                    build.setColor(color2);
            });
        }
    });
    setDead();
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) EntityDataManager(net.minecraft.network.datasync.EntityDataManager) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) World(net.minecraft.world.World) Wizardry(com.teamwizardry.wizardry.Wizardry) ParticleSpawner(com.teamwizardry.librarianlib.features.particle.ParticleSpawner) DataParameter(net.minecraft.network.datasync.DataParameter) PosUtils(com.teamwizardry.wizardry.api.util.PosUtils) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) java.awt(java.awt) EntityThrowable(net.minecraft.entity.projectile.EntityThrowable) ItemStack(net.minecraft.item.ItemStack) RayTraceResult(net.minecraft.util.math.RayTraceResult) DataSerializers(net.minecraft.network.datasync.DataSerializers) Vec3d(net.minecraft.util.math.Vec3d) EntityLivingBase(net.minecraft.entity.EntityLivingBase) Side(net.minecraftforge.fml.relauncher.Side) MathHelper(net.minecraft.util.math.MathHelper) ResourceLocation(net.minecraft.util.ResourceLocation) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Constants(com.teamwizardry.wizardry.api.Constants) ResourceLocation(net.minecraft.util.ResourceLocation) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 3 with StaticInterp

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

the class EntitySpiritBlight method onDeath.

@Override
public void onDeath(DamageSource cause) {
    ClientRunnable.run(new ClientRunnable() {

        @Override
        @SideOnly(Side.CLIENT)
        public void runIfClient() {
            ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
            glitter.setColor(Color.WHITE);
            glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
            glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
            glitter.setAcceleration(Vec3d.ZERO);
            ParticleSpawner.spawn(glitter, world, new StaticInterp<>(getPositionVector().addVector(0, height, 0)), 1000, 0, (i, build) -> {
                double radius = 0.2;
                build.setDeceleration(new Vec3d(RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95)));
                build.addMotion(new Vec3d(RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius)));
                build.setLifetime(RandUtil.nextInt(200, 250));
                build.setScaleFunction(new InterpScale(RandUtil.nextFloat(0.6f, 1.5f), 0));
                if (RandUtil.nextBoolean())
                    build.setColor(Color.WHITE);
                else
                    build.setColor(new Color(0xf404d4));
            });
        }
    });
    playSound(ModSounds.BASS_BOOM, 3, 0.5f);
    playSound(ModSounds.BASS_BOOM, 1, RandUtil.nextFloat(1, 1.5f));
    super.onDeath(cause);
}
Also used : Matrix4(com.teamwizardry.librarianlib.features.math.Matrix4) EntityDataManager(net.minecraft.network.datasync.EntityDataManager) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) ParticleSpawner(com.teamwizardry.librarianlib.features.particle.ParticleSpawner) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) Side(net.minecraftforge.fml.relauncher.Side) RandUtilSeed(com.teamwizardry.wizardry.api.util.RandUtilSeed) ModSounds(com.teamwizardry.wizardry.init.ModSounds) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Entity(net.minecraft.entity.Entity) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) World(net.minecraft.world.World) Wizardry(com.teamwizardry.wizardry.Wizardry) DataParameter(net.minecraft.network.datasync.DataParameter) DamageSource(net.minecraft.util.DamageSource) SharedMonsterAttributes(net.minecraft.entity.SharedMonsterAttributes) java.awt(java.awt) DataSerializers(net.minecraft.network.datasync.DataSerializers) EntityMob(net.minecraft.entity.monster.EntityMob) LibParticles(com.teamwizardry.wizardry.client.fx.LibParticles) EntityPlayer(net.minecraft.entity.player.EntityPlayer) MathHelper(net.minecraft.util.math.MathHelper) ResourceLocation(net.minecraft.util.ResourceLocation) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) Constants(com.teamwizardry.wizardry.api.Constants) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 4 with StaticInterp

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

the class EntitySpiritWight method onDeath.

@Override
public void onDeath(DamageSource cause) {
    ClientRunnable.run(new ClientRunnable() {

        @Override
        @SideOnly(Side.CLIENT)
        public void runIfClient() {
            ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
            glitter.setColor(Color.WHITE);
            glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
            glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
            glitter.setAcceleration(Vec3d.ZERO);
            ParticleSpawner.spawn(glitter, world, new StaticInterp<>(getPositionVector().addVector(0, height, 0)), 1000, 0, (i, build) -> {
                double radius = 0.2;
                build.setDeceleration(new Vec3d(RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95)));
                build.addMotion(new Vec3d(RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius)));
                build.setLifetime(RandUtil.nextInt(200, 250));
                build.setScaleFunction(new InterpScale(RandUtil.nextFloat(0.6f, 1.5f), 0));
                if (RandUtil.nextBoolean())
                    build.setColor(Color.WHITE);
                else
                    build.setColor(Color.YELLOW);
            });
        }
    });
    playSound(ModSounds.BASS_BOOM, 3, 0.5f);
    playSound(ModSounds.BASS_BOOM, 1, RandUtil.nextFloat(1, 1.5f));
    super.onDeath(cause);
}
Also used : InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) ParticleSpawner(com.teamwizardry.librarianlib.features.particle.ParticleSpawner) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d) Side(net.minecraftforge.fml.relauncher.Side) ModSounds(com.teamwizardry.wizardry.init.ModSounds) EntityAINearestAttackableTarget(net.minecraft.entity.ai.EntityAINearestAttackableTarget) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Entity(net.minecraft.entity.Entity) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) World(net.minecraft.world.World) Wizardry(com.teamwizardry.wizardry.Wizardry) DamageSource(net.minecraft.util.DamageSource) SharedMonsterAttributes(net.minecraft.entity.SharedMonsterAttributes) java.awt(java.awt) EntityMob(net.minecraft.entity.monster.EntityMob) EntityLivingBase(net.minecraft.entity.EntityLivingBase) LibParticles(com.teamwizardry.wizardry.client.fx.LibParticles) EntityPlayer(net.minecraft.entity.player.EntityPlayer) MathHelper(net.minecraft.util.math.MathHelper) ResourceLocation(net.minecraft.util.ResourceLocation) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) Constants(com.teamwizardry.wizardry.api.Constants) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ClientRunnable(com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) Vec3d(net.minecraft.util.math.Vec3d)

Example 5 with StaticInterp

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

the class ModuleEffectSubstitution method render.

@Override
@SuppressWarnings("unused")
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
    World world = spell.world;
    Entity caster = spell.getCaster();
    BlockPos targetBlock = spell.getTargetPos();
    Entity targetEntity = spell.getVictim();
    if (targetEntity != null && caster != null) {
        ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(20, 30));
        glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
        glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
        ParticleSpawner.spawn(glitter, spell.world, new StaticInterp<>(new Vec3d(targetEntity.posX, targetEntity.posY, targetEntity.posZ)), 50, RandUtil.nextInt(20, 30), (aFloat, particleBuilder) -> {
            glitter.setScale((float) RandUtil.nextDouble(0.3, 1));
            glitter.setAlphaFunction(new InterpFadeInOut(0.3f, (float) RandUtil.nextDouble(0.6, 1)));
            glitter.setLifetime(RandUtil.nextInt(10, 20));
            glitter.setScaleFunction(new InterpScale(1, 0));
            glitter.setPositionFunction(new InterpHelix(new Vec3d(0, 0, 0), new Vec3d(0, 2, 0), 0.5f, 0f, 1, RandUtil.nextFloat()));
        });
        glitter.setColorFunction(new InterpColorHSV(getSecondaryColor(), getPrimaryColor()));
        ParticleSpawner.spawn(glitter, spell.world, new StaticInterp<>(new Vec3d(caster.posX, caster.posY, caster.posZ)), 50, RandUtil.nextInt(20, 30), (aFloat, particleBuilder) -> {
            glitter.setScale((float) RandUtil.nextDouble(0.3, 1));
            glitter.setAlphaFunction(new InterpFadeInOut(0.3f, (float) RandUtil.nextDouble(0.6, 1)));
            glitter.setLifetime(RandUtil.nextInt(10, 20));
            glitter.setScaleFunction(new InterpScale(1, 0));
            glitter.setPositionFunction(new InterpHelix(new Vec3d(0, 0, 0), new Vec3d(0, 4, 0), 1f, 0f, 1, RandUtil.nextFloat()));
        });
    } else if (targetBlock != null) {
        ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(20, 30));
        glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
        glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
        ParticleSpawner.spawn(glitter, spell.world, new StaticInterp<>(new Vec3d(targetBlock).addVector(0.5, 0.5, 0.5)), 20, RandUtil.nextInt(20, 30), (aFloat, particleBuilder) -> {
            glitter.setScale((float) RandUtil.nextDouble(0.3, 1));
            glitter.setAlphaFunction(new InterpFadeInOut(0.3f, (float) RandUtil.nextDouble(0.6, 1)));
            glitter.setLifetime(RandUtil.nextInt(10, 20));
            glitter.setScaleFunction(new InterpScale(1, 0));
            glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.001, 0.001), RandUtil.nextDouble(-0.001, 0.001), RandUtil.nextDouble(-0.001, 0.001)));
        });
    }
}
Also used : InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) InterpFadeInOut(com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) RegisterModule(com.teamwizardry.wizardry.api.spell.module.RegisterModule) ParticleSpawner(com.teamwizardry.librarianlib.features.particle.ParticleSpawner) ModuleModifier(com.teamwizardry.wizardry.api.spell.module.ModuleModifier) ModuleEffect(com.teamwizardry.wizardry.api.spell.module.ModuleEffect) PosUtils(com.teamwizardry.wizardry.api.util.PosUtils) ParticleBuilder(com.teamwizardry.librarianlib.features.particle.ParticleBuilder) SpellRing(com.teamwizardry.wizardry.api.spell.SpellRing) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) HashSet(java.util.HashSet) ItemStack(net.minecraft.item.ItemStack) Block(net.minecraft.block.Block) Vec3d(net.minecraft.util.math.Vec3d) Side(net.minecraftforge.fml.relauncher.Side) ModSounds(com.teamwizardry.wizardry.init.ModSounds) SpellData(com.teamwizardry.wizardry.api.spell.SpellData) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) SoundCategory(net.minecraft.util.SoundCategory) Nonnull(javax.annotation.Nonnull) Entity(net.minecraft.entity.Entity) FACE_HIT(com.teamwizardry.wizardry.api.spell.SpellData.DefaultKeys.FACE_HIT) IBlockSelectable(com.teamwizardry.wizardry.api.spell.IBlockSelectable) World(net.minecraft.world.World) Wizardry(com.teamwizardry.wizardry.Wizardry) ModuleModifierIncreaseRange(com.teamwizardry.wizardry.common.module.modifiers.ModuleModifierIncreaseRange) EnumFacing(net.minecraft.util.EnumFacing) InterpHelix(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix) BlockPos(net.minecraft.util.math.BlockPos) InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) IBlockState(net.minecraft.block.state.IBlockState) AttributeRegistry(com.teamwizardry.wizardry.api.spell.attribute.AttributeRegistry) BlockUtils(com.teamwizardry.wizardry.api.util.BlockUtils) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ResourceLocation(net.minecraft.util.ResourceLocation) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) ItemBlock(net.minecraft.item.ItemBlock) NBTUtil(net.minecraft.nbt.NBTUtil) Constants(com.teamwizardry.wizardry.api.Constants) Entity(net.minecraft.entity.Entity) InterpHelix(com.teamwizardry.librarianlib.features.math.interpolate.position.InterpHelix) StaticInterp(com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp) 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) InterpColorHSV(com.teamwizardry.librarianlib.features.particle.functions.InterpColorHSV) InterpScale(com.teamwizardry.wizardry.api.util.interp.InterpScale) ResourceLocation(net.minecraft.util.ResourceLocation) BlockPos(net.minecraft.util.math.BlockPos) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

StaticInterp (com.teamwizardry.librarianlib.features.math.interpolate.StaticInterp)9 ParticleBuilder (com.teamwizardry.librarianlib.features.particle.ParticleBuilder)9 ParticleSpawner (com.teamwizardry.librarianlib.features.particle.ParticleSpawner)9 InterpFadeInOut (com.teamwizardry.librarianlib.features.particle.functions.InterpFadeInOut)9 Wizardry (com.teamwizardry.wizardry.Wizardry)9 Constants (com.teamwizardry.wizardry.api.Constants)9 RandUtil (com.teamwizardry.wizardry.api.util.RandUtil)9 ResourceLocation (net.minecraft.util.ResourceLocation)9 Vec3d (net.minecraft.util.math.Vec3d)9 Side (net.minecraftforge.fml.relauncher.Side)9 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)9 ClientRunnable (com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable)8 java.awt (java.awt)8 World (net.minecraft.world.World)8 MathHelper (net.minecraft.util.math.MathHelper)7 Entity (net.minecraft.entity.Entity)6 InterpScale (com.teamwizardry.wizardry.api.util.interp.InterpScale)5 Nonnull (javax.annotation.Nonnull)5 EntityLivingBase (net.minecraft.entity.EntityLivingBase)5 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)5