Search in sources :

Example 1 with FXFacingParticle

use of hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle in project AstralSorcery by HellFirePvP.

the class FXOrbitalCrystalAttunement method spawnOrbitalParticle.

@Override
public void spawnOrbitalParticle(Vector3 pos, Function<Vector3, FXFacingParticle> effectRegistrar) {
    Vector3 motion = this.getPosition().subtract(pos).crossProduct(this.getOrbitAxis()).normalize().multiply(0.1 + rand.nextFloat() * 0.1);
    motion.add(this.getOrbitAxis().normalize().multiply(0.15 + rand.nextFloat() * 0.15));
    Vector3 vortexPos = pos.clone();
    MiscUtils.applyRandomOffset(vortexPos, rand, 0.4F);
    FXFacingParticle p = effectRegistrar.apply(vortexPos).color(VFXColorFunction.WHITE).setScaleMultiplier(0.2F + rand.nextFloat() * 0.1F).setAlphaMultiplier(0.75F).alpha(VFXAlphaFunction.proximity(this.targetPoint::clone, 3F)).motion(VFXMotionController.target(this.targetPoint::clone, 0.075F)).setMotion(motion).setMaxAge(60);
    if (rand.nextInt(3) == 0) {
        p.color(VFXColorFunction.constant(cst.getConstellationColor()));
    }
}
Also used : Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle)

Example 2 with FXFacingParticle

use of hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle in project AstralSorcery by HellFirePvP.

the class ActiveCrystalAttunementRecipe method doClientTick.

@OnlyIn(Dist.CLIENT)
private void doClientTick(TileAttunementAltar altar) {
    Predicate<PositionedLoopSound> activeTest = s -> !altar.canPlayConstellationActiveEffects() || altar.getActiveRecipe() != this;
    if (this.itemAttuneSound == null || ((FadeLoopSound) this.itemAttuneSound).hasStoppedPlaying()) {
        this.itemAttuneSound = SoundHelper.playSoundLoopFadeInClient(SoundsAS.ATTUNEMENT_ATLAR_ITEM_LOOP, new Vector3(altar).add(0.5, 1, 0.5), 1F, 1F, false, activeTest).setFadeInTicks(20).setFadeOutTicks(20);
    }
    if (this.getTick() == 0) {
        SoundHelper.playSoundClientWorld(SoundsAS.ATTUNEMENT_ATLAR_ITEM_START, altar.getPos(), 1F, 1F);
    }
    if (this.getTick() >= 80) {
        if (attunementFlare == null || ((EntityComplexFX) attunementFlare).isRemoved()) {
            attunementFlare = EffectHelper.of(EffectTemplatesAS.FACING_SPRITE).spawn(new Vector3(altar).add(0.5, 1.75, 0.5)).setSprite(SpritesAS.SPR_ATTUNEMENT_FLARE).setScaleMultiplier(2.5F).refresh(fx -> altar.canPlayConstellationActiveEffects() && altar.getActiveRecipe() == this);
        }
    }
    Vector3 altarPos = new Vector3(altar).add(0.5, 0, 0.5);
    if (innerOrbital1 == null) {
        innerOrbital1 = EffectHelper.spawnSource(new FXOrbitalCrystalAttunement(altarPos.clone(), altarPos.clone().addY(1.75), this.constellation)).setOrbitRadius(3).setBranches(4).setOrbitAxis(Vector3.RotAxis.Y_AXIS).setTicksPerRotation(200).refresh(RefreshFunction.tileExistsAnd(altar, (tile, effect) -> tile.canPlayConstellationActiveEffects() && tile.getActiveRecipe() == this));
    }
    VFXColorFunction<?> beamColor = VFXColorFunction.constant(ColorsAS.DEFAULT_GENERIC_PARTICLE);
    if (getTick() >= 80 && getTick() % 40 == 0) {
        for (BlockPos pos : altar.getConstellationPositions(this.constellation)) {
            Vector3 from = new Vector3(pos).add(0.5, 0, 0.5);
            MiscUtils.applyRandomOffset(from, rand, 0.1F);
            EffectHelper.of(EffectTemplatesAS.LIGHTBEAM).spawn(from).setup(from.clone().addY(6), 1.2, 1.2).setAlphaMultiplier(0.8F).color(beamColor).setMaxAge(60);
        }
    }
    float total = DURATION_CRYSTAL_ATTUNEMENT;
    float percCycle = (float) (((getTick() % total) / total) * 2 * Math.PI);
    int parts = getTick() % 50 == 0 ? 180 : 6;
    Vector3 center = new Vector3(altar).add(0.5, 0.1, 0.5);
    float angleSwirl = 120F;
    float dst = 4.5F;
    for (int i = 0; i < parts; i++) {
        Vector3 v = Vector3.RotAxis.X_AXIS.clone();
        float originalAngle = (((float) i) / ((float) parts)) * 360F;
        double angle = originalAngle + (MathHelper.sin(percCycle) * angleSwirl);
        v.rotate(-Math.toRadians(angle), Vector3.RotAxis.Y_AXIS).normalize().multiply(dst);
        Vector3 pos = center.clone();
        Vector3 mot = center.clone().subtract(pos.clone().add(v)).normalize().multiply(0.14);
        int age = 20 + rand.nextInt(30);
        float size = 0.2F + rand.nextFloat() * 0.7F;
        EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(pos).setScaleMultiplier(size).setMotion(mot).color(VFXColorFunction.WHITE).setMaxAge(age);
        if (rand.nextInt(6) == 0) {
            EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(pos).setScaleMultiplier(size * 1.4F).setMotion(mot).color(VFXColorFunction.constant(this.constellation.getConstellationColor())).setGravityStrength(-0.0004F + rand.nextFloat() * -0.00015F).setMaxAge(age + 30);
        }
    }
    double scale = 7.0D;
    double edgeScale = (scale * 2 + 1);
    for (int i = 0; i < 7; i++) {
        Vector3 offset = new Vector3(altar).add(-scale, 0.1, -scale);
        if (rand.nextBoolean()) {
            offset.add(edgeScale * (rand.nextBoolean() ? 1 : 0), 0, rand.nextFloat() * edgeScale);
        } else {
            offset.add(rand.nextFloat() * edgeScale, 0, edgeScale * (rand.nextBoolean() ? 1 : 0));
        }
        FXFacingParticle particle = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).alpha(VFXAlphaFunction.FADE_OUT).setGravityStrength(-0.0002F + rand.nextFloat() * -0.0001F).setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F).color(VFXColorFunction.WHITE).setMaxAge(40 + rand.nextInt(10));
        if (rand.nextBoolean()) {
            particle.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
        }
    }
    if (this.getTick() >= 200) {
        for (int i = 0; i < 3; i++) {
            Vector3 at = new Vector3(altar).add(0.5, 0, 0.5);
            at.addX(rand.nextFloat() * 7F * (rand.nextBoolean() ? 1 : -1));
            at.addZ(rand.nextFloat() * 7F * (rand.nextBoolean() ? 1 : -1));
            FXFacingParticle p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(at).setAlphaMultiplier(0.75F).alpha(VFXAlphaFunction.FADE_OUT).setGravityStrength(-0.001F + rand.nextFloat() * -0.0005F).color(VFXColorFunction.WHITE).setScaleMultiplier(0.3F + rand.nextFloat() * 0.1F).setMaxAge(20 + rand.nextInt(10));
            if (rand.nextBoolean()) {
                p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
            }
            if (getTick() >= 400) {
                p.setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F);
            }
        }
    }
    if (getTick() >= 460) {
        if (getTick() % 5 == 0) {
            Vector3 from = new Vector3(altar).add(0.5, 0, 0.5);
            MiscUtils.applyRandomOffset(from, rand, 0.25F);
            EffectHelper.of(EffectTemplatesAS.LIGHTBEAM).spawn(from).setup(from.clone().addY(8), 2.4, 2).setAlphaMultiplier(0.8F).setMaxAge(30 + rand.nextInt(15));
        }
    }
    if (getTick() >= (DURATION_CRYSTAL_ATTUNEMENT - 10)) {
        for (int i = 0; i < 25; i++) {
            Vector3 at = new Vector3(altar).add(0.5, 0, 0.5).addY(rand.nextFloat() * 0.5 + rand.nextFloat() * 0.5);
            FXFacingParticle p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(at).color(VFXColorFunction.WHITE).setMotion(Vector3.random().setY(0).normalize().multiply(0.025 + rand.nextFloat() * 0.075)).setAlphaMultiplier(0.75F).setScaleMultiplier(0.25F + rand.nextFloat() * 0.15F).alpha(VFXAlphaFunction.FADE_OUT).setMaxAge(60 + rand.nextInt(40));
            if (rand.nextBoolean()) {
                p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
            }
        }
    }
}
Also used : Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn) IMinorConstellation(hellfirepvp.astralsorcery.common.constellation.IMinorConstellation) CompoundNBT(net.minecraft.nbt.CompoundNBT) SoundsAS(hellfirepvp.astralsorcery.common.lib.SoundsAS) FadeLoopSound(hellfirepvp.astralsorcery.client.util.sound.FadeLoopSound) Dist(net.minecraftforge.api.distmarker.Dist) ItemStack(net.minecraft.item.ItemStack) EffectTemplatesAS(hellfirepvp.astralsorcery.client.lib.EffectTemplatesAS) IWeakConstellation(hellfirepvp.astralsorcery.common.constellation.IWeakConstellation) MiscUtils(hellfirepvp.astralsorcery.common.util.MiscUtils) SoundHelper(hellfirepvp.astralsorcery.common.util.sound.SoundHelper) IConstellation(hellfirepvp.astralsorcery.common.constellation.IConstellation) TileAttunementAltar(hellfirepvp.astralsorcery.common.tile.TileAttunementAltar) ColorsAS(hellfirepvp.astralsorcery.common.lib.ColorsAS) Nullable(javax.annotation.Nullable) LogicalSide(net.minecraftforge.fml.LogicalSide) FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle) EntityComplexFX(hellfirepvp.astralsorcery.client.effect.EntityComplexFX) VFXAlphaFunction(hellfirepvp.astralsorcery.client.effect.function.VFXAlphaFunction) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) World(net.minecraft.world.World) Predicate(java.util.function.Predicate) RegistriesAS(hellfirepvp.astralsorcery.common.lib.RegistriesAS) BlockPos(net.minecraft.util.math.BlockPos) UUID(java.util.UUID) EffectHelper(hellfirepvp.astralsorcery.client.effect.handler.EffectHelper) ItemCrystalBase(hellfirepvp.astralsorcery.common.item.crystal.ItemCrystalBase) AdvancementsAS(hellfirepvp.astralsorcery.common.lib.AdvancementsAS) VFXColorFunction(hellfirepvp.astralsorcery.client.effect.function.VFXColorFunction) AttuneCrystalRecipe(hellfirepvp.astralsorcery.common.crafting.nojson.attunement.AttuneCrystalRecipe) FXOrbitalCrystalAttunement(hellfirepvp.astralsorcery.client.effect.source.orbital.FXOrbitalCrystalAttunement) AttunementRecipe(hellfirepvp.astralsorcery.common.crafting.nojson.attunement.AttunementRecipe) MathHelper(net.minecraft.util.math.MathHelper) RefreshFunction(hellfirepvp.astralsorcery.client.effect.function.RefreshFunction) SpritesAS(hellfirepvp.astralsorcery.client.lib.SpritesAS) ConstellationItem(hellfirepvp.astralsorcery.common.constellation.ConstellationItem) ResourceLocation(net.minecraft.util.ResourceLocation) PositionedLoopSound(hellfirepvp.astralsorcery.client.util.sound.PositionedLoopSound) ItemEntity(net.minecraft.entity.item.ItemEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) PositionedLoopSound(hellfirepvp.astralsorcery.client.util.sound.PositionedLoopSound) Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) BlockPos(net.minecraft.util.math.BlockPos) FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle) FXOrbitalCrystalAttunement(hellfirepvp.astralsorcery.client.effect.source.orbital.FXOrbitalCrystalAttunement) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 3 with FXFacingParticle

use of hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle in project AstralSorcery by HellFirePvP.

the class ActivePlayerAttunementRecipe method doEffectTick.

@OnlyIn(Dist.CLIENT)
private void doEffectTick(TileAttunementAltar altar) {
    IConstellation cst = altar.getActiveConstellation();
    if (cst == null) {
        return;
    }
    Vector3 playerTarget = new Vector3(altar).add(0.5, 2.5, 0.5);
    VFXColorFunction<?> beamColor = VFXColorFunction.constant(ColorsAS.DEFAULT_GENERIC_PARTICLE);
    int tick = getTick();
    if (tick % 40 == 0) {
        for (BlockPos pos : altar.getConstellationPositions(cst)) {
            Vector3 from = new Vector3(pos).add(0.5, 0, 0.5);
            MiscUtils.applyRandomOffset(from, rand, 0.1F);
            EffectHelper.of(EffectTemplatesAS.LIGHTBEAM).spawn(from).setup(from.clone().addY(6), 1.2, 1.2).setAlphaMultiplier(0.8F).color(beamColor).setMaxAge(60);
        }
    }
    double scale = 7.0D;
    double edgeScale = (scale * 2 + 1);
    for (int i = 0; i < 7; i++) {
        Vector3 offset = new Vector3(altar).add(-scale, 0.1, -scale);
        if (rand.nextBoolean()) {
            offset.add(edgeScale * (rand.nextBoolean() ? 1 : 0), 0, rand.nextFloat() * edgeScale);
        } else {
            offset.add(rand.nextFloat() * edgeScale, 0, edgeScale * (rand.nextBoolean() ? 1 : 0));
        }
        FXFacingParticle particle = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).alpha(VFXAlphaFunction.FADE_OUT).setGravityStrength(-0.0002F + rand.nextFloat() * -0.0001F).setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F).color(VFXColorFunction.WHITE).setMaxAge(40 + rand.nextInt(10));
        if (rand.nextBoolean()) {
            particle.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
        }
    }
    for (int i = 0; i < 5; i++) {
        Set<BlockPos> offsets = altar.getConstellationPositions(cst);
        BlockPos pos = MiscUtils.getRandomEntry(offsets, rand);
        if (tick <= 380) {
            Vector3 offset = new Vector3(pos).add(0.5, 0, 0.5).add(Vector3.random().setY(0).multiply(0.6));
            EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).color(VFXColorFunction.WHITE).setGravityStrength(-0.0006F + rand.nextFloat() * -0.003F).setMotion(Vector3.random().addY(4).normalize().multiply(0.015 + rand.nextFloat() * 0.01)).setAlphaMultiplier(0.6F).setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F).alpha(VFXAlphaFunction.FADE_OUT).setMaxAge(60 + rand.nextInt(20));
        } else {
            Vector3 offset = new Vector3(pos).add(0.5, 0, 0.5).add(Vector3.random().setY(0).multiply(0.5));
            EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).setAlphaMultiplier(0.6F).alpha(VFXAlphaFunction.proximity(playerTarget::clone, 3F)).motion(VFXMotionController.target(playerTarget::clone, 0.08F)).setScaleMultiplier(0.2F + rand.nextFloat() * 0.1F).color(VFXColorFunction.WHITE).setMotion(new Vector3(0, 0.2 + rand.nextFloat() * 0.15F, 0)).setMaxAge(60 + rand.nextInt(20));
            offset = new Vector3(altar).add(0.5, 0, 0.5).add(Vector3.random().setY(0).multiply(0.6));
            EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).color(VFXColorFunction.WHITE).setGravityStrength(-0.0006F + rand.nextFloat() * -0.004F).setMotion(Vector3.random().addY(4).normalize().multiply(0.02 + rand.nextFloat() * 0.01)).setAlphaMultiplier(0.75F).setScaleMultiplier(0.3F + rand.nextFloat() * 0.1F).alpha(VFXAlphaFunction.FADE_OUT).setMaxAge(40 + rand.nextInt(10));
        }
    }
    if (tick >= 220) {
        Vector3 offset = new Vector3(altar).add(0.5, 0, 0.5).add(Vector3.random().setY(0));
        FXFacingParticle p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(offset).setAlphaMultiplier(1F).alpha(VFXAlphaFunction.proximity(playerTarget::clone, 3F)).motion(VFXMotionController.target(playerTarget::clone, 0.1F)).setScaleMultiplier(0.2F + rand.nextFloat() * 0.1F).color(VFXColorFunction.WHITE).setMotion(Vector3.positiveYRandom().setY(1).normalize().multiply(0.5F + rand.nextFloat() * 0.1F)).setMaxAge(60 + rand.nextInt(20));
        if (rand.nextBoolean()) {
            p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
        }
        for (int i = 0; i < 3; i++) {
            Vector3 at = new Vector3(altar).add(0.5, 0, 0.5);
            at.addX(rand.nextFloat() * 7F * (rand.nextBoolean() ? 1 : -1));
            at.addZ(rand.nextFloat() * 7F * (rand.nextBoolean() ? 1 : -1));
            p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(at).setAlphaMultiplier(0.75F).alpha(VFXAlphaFunction.FADE_OUT).setGravityStrength(-0.001F + rand.nextFloat() * -0.0005F).color(VFXColorFunction.WHITE).setScaleMultiplier(0.3F + rand.nextFloat() * 0.1F).setMaxAge(20 + rand.nextInt(10));
            if (rand.nextBoolean()) {
                p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
            }
            if (tick >= 500) {
                p.setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F);
            }
        }
    }
    if (tick >= 400) {
        int amt = tick >= 500 ? 4 : 1;
        for (int i = 0; i < amt; i++) {
            RenderOffsetNoisePlane plane = (RenderOffsetNoisePlane) MiscUtils.getRandomEntry(this.playerNoisePlanes, rand);
            FXFacingParticle p = plane.createParticle(playerTarget.clone()).setMotion(Vector3.random().setY(0).multiply(rand.nextFloat() * 0.015F)).setAlphaMultiplier(0.6F).setScaleMultiplier(0.2F + rand.nextFloat() * 0.05F).alpha(VFXAlphaFunction.FADE_OUT).setMaxAge(60 + rand.nextInt(20));
            if (rand.nextBoolean()) {
                p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
            }
        }
    }
    if (tick >= 600) {
        if (tick % 10 == 0) {
            Vector3 from = new Vector3(altar).add(0.5, 0, 0.5);
            MiscUtils.applyRandomOffset(from, rand, 0.25F);
            EffectHelper.of(EffectTemplatesAS.LIGHTBEAM).spawn(from).setup(from.clone().addY(8), 2.4, 2).setAlphaMultiplier(0.8F).setMaxAge(40 + rand.nextInt(20));
        }
    }
    if (tick >= (DURATION_PLAYER_ATTUNEMENT - 4)) {
        for (int i = 0; i < 60; i++) {
            Vector3 at = new Vector3(altar).add(0.5, 0, 0.5).addY(rand.nextFloat() * 15);
            FXFacingParticle p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(at).color(VFXColorFunction.WHITE).setMotion(Vector3.random().setY(0).normalize().multiply(0.03 + rand.nextFloat() * 0.01)).setAlphaMultiplier(0.7F).setScaleMultiplier(0.3F + rand.nextFloat() * 0.15F).alpha(VFXAlphaFunction.FADE_OUT).setMaxAge(140 + rand.nextInt(60));
            if (rand.nextBoolean()) {
                p.color(VFXColorFunction.constant(this.constellation.getConstellationColor()));
            }
        }
    }
}
Also used : RenderOffsetNoisePlane(hellfirepvp.astralsorcery.client.effect.function.impl.RenderOffsetNoisePlane) Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) BlockPos(net.minecraft.util.math.BlockPos) FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle) IConstellation(hellfirepvp.astralsorcery.common.constellation.IConstellation) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 4 with FXFacingParticle

use of hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle in project AstralSorcery by HellFirePvP.

the class EntityIlluminationSpark method spawnEffects.

@OnlyIn(Dist.CLIENT)
private void spawnEffects() {
    FXFacingParticle p;
    for (int i = 0; i < 6; i++) {
        p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this)).setMotion(new Vector3(0.04F - rand.nextFloat() * 0.08F, 0.04F - rand.nextFloat() * 0.08F, 0.04F - rand.nextFloat() * 0.08F)).setScaleMultiplier(0.25F);
        randomizeColor(p);
    }
    p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this));
    p.setScaleMultiplier(0.6F);
    randomizeColor(p);
    p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this).add(getMotion().mul(0.5, 0.5, 0.5)));
    p.setScaleMultiplier(0.6F);
    randomizeColor(p);
}
Also used : FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle) Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 5 with FXFacingParticle

use of hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle in project AstralSorcery by HellFirePvP.

the class EntityNocturnalSpark method spawnEffects.

@OnlyIn(Dist.CLIENT)
private void spawnEffects() {
    if (isSpawning()) {
        for (int i = 0; i < 15; i++) {
            Vector3 thisPos = Vector3.atEntityCorner(this).addY(1);
            MiscUtils.applyRandomOffset(thisPos, rand, 2 + rand.nextInt(4));
            FXFacingParticle p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(thisPos).setScaleMultiplier(4).alpha(VFXAlphaFunction.PYRAMID).setAlphaMultiplier(0.7F).color(VFXColorFunction.constant(Color.BLACK));
            if (rand.nextInt(5) == 0) {
                randomizeColor(p);
            }
            if (rand.nextInt(20) == 0) {
                Vector3 at = Vector3.atEntityCorner(this);
                MiscUtils.applyRandomOffset(at, rand, 2);
                Vector3 to = Vector3.atEntityCorner(this);
                MiscUtils.applyRandomOffset(to, rand, 2);
                EffectHelper.of(EffectTemplatesAS.LIGHTNING).spawn(at).makeDefault(to).color(VFXColorFunction.constant(Color.BLACK));
            }
        }
    } else {
        FXFacingParticle p;
        for (int i = 0; i < 6; i++) {
            p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this)).setMotion(new Vector3(0.04F - rand.nextFloat() * 0.08F, 0.04F - rand.nextFloat() * 0.08F, 0.04F - rand.nextFloat() * 0.08F)).setScaleMultiplier(0.25F);
            randomizeColor(p);
        }
        p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this));
        p.setScaleMultiplier(0.6F);
        randomizeColor(p);
        p = EffectHelper.of(EffectTemplatesAS.GENERIC_PARTICLE).spawn(Vector3.atEntityCorner(this).add(getMotion().mul(0.5, 0.5, 0.5)));
        p.setScaleMultiplier(0.6F);
        randomizeColor(p);
    }
}
Also used : Vector3(hellfirepvp.astralsorcery.common.util.data.Vector3) FXFacingParticle(hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Aggregations

FXFacingParticle (hellfirepvp.astralsorcery.client.effect.vfx.FXFacingParticle)24 Vector3 (hellfirepvp.astralsorcery.common.util.data.Vector3)23 OnlyIn (net.minecraftforge.api.distmarker.OnlyIn)21 VFXAlphaFunction (hellfirepvp.astralsorcery.client.effect.function.VFXAlphaFunction)7 VFXColorFunction (hellfirepvp.astralsorcery.client.effect.function.VFXColorFunction)6 EffectHelper (hellfirepvp.astralsorcery.client.effect.handler.EffectHelper)6 EffectTemplatesAS (hellfirepvp.astralsorcery.client.lib.EffectTemplatesAS)6 Dist (net.minecraftforge.api.distmarker.Dist)6 ColorsAS (hellfirepvp.astralsorcery.common.lib.ColorsAS)4 Nonnull (javax.annotation.Nonnull)4 World (net.minecraft.world.World)4 MiscUtils (hellfirepvp.astralsorcery.common.util.MiscUtils)3 PlayerEntity (net.minecraft.entity.player.PlayerEntity)3 BlockPos (net.minecraft.util.math.BlockPos)3 MathHelper (net.minecraft.util.math.MathHelper)3 LogicalSide (net.minecraftforge.fml.LogicalSide)3 EntityVisualFX (hellfirepvp.astralsorcery.client.effect.EntityVisualFX)2 RefreshFunction (hellfirepvp.astralsorcery.client.effect.function.RefreshFunction)2 RenderOffsetNoisePlane (hellfirepvp.astralsorcery.client.effect.function.impl.RenderOffsetNoisePlane)2 SpritesAS (hellfirepvp.astralsorcery.client.lib.SpritesAS)2