use of hellfirepvp.astralsorcery.common.tile.TileFountain in project AstralSorcery by HellFirePvP.
the class FountainEffectVortex method tickEffects.
@OnlyIn(Dist.CLIENT)
private void tickEffects(TileFountain fountain, VortexContext ctx, int operationTick, OperationSegment currentSegment) {
if (currentSegment.isLaterOrEqualTo(OperationSegment.STARTUP)) {
FXSpritePlane sprite = (FXSpritePlane) ctx.fountainSprite;
if (sprite == null) {
sprite = EffectHelper.of(EffectTemplatesAS.TEXTURE_SPRITE).spawn(new Vector3(fountain).add(0.5, 0.5, 0.5)).setAxis(Vector3.RotAxis.Y_AXIS).setNoRotation(45).setSprite(SpritesAS.SPR_FOUNTAIN_VORTEX).setAlphaMultiplier(1F).alpha((fx, alphaIn, pTicks) -> this.getSegmentPercent(OperationSegment.STARTUP, fountain.getTickActiveFountainEffect())).setScaleMultiplier(5.5F).refresh(RefreshFunction.tileExistsAnd(fountain, (tile, fx) -> tile.getCurrentEffect() == this));
} else if (sprite.isRemoved() || sprite.canRemove()) {
EffectHelper.refresh(sprite, EffectTemplatesAS.TEXTURE_SPRITE);
}
ctx.fountainSprite = sprite;
}
BlockPos fountainPos = fountain.getPos();
float segmentPercent = getSegmentPercent(currentSegment, operationTick);
switch(currentSegment) {
case STARTUP:
playFountainVortexParticles(fountainPos, segmentPercent);
playFountainArcs(fountainPos, segmentPercent);
playCoreParticles(fountainPos, segmentPercent);
break;
case PREPARATION:
playFountainArcs(fountainPos, 1F - segmentPercent);
playFountainVortexParticles(fountainPos, 1F - segmentPercent);
playCoreParticles(fountainPos, 1F - segmentPercent * 2F);
playCorePrimerParticles(fountainPos, segmentPercent);
break;
case RUNNING:
playFountainVortexParticles(fountainPos, 0.2F);
playFountainArcs(fountainPos, 0.6F);
playFountainVortexLowerParticles(fountainPos);
playVortexEffects(fountainPos, fountain, ctx);
break;
}
}
use of hellfirepvp.astralsorcery.common.tile.TileFountain in project AstralSorcery by HellFirePvP.
the class FountainEffectLiquid method tickEffects.
@OnlyIn(Dist.CLIENT)
private void tickEffects(TileFountain fountain, LiquidContext ctx, int operationTick, OperationSegment currentSegment) {
if (currentSegment.isLaterOrEqualTo(OperationSegment.STARTUP)) {
FXSpritePlane sprite = (FXSpritePlane) ctx.fountainSprite;
if (sprite == null) {
sprite = EffectHelper.of(EffectTemplatesAS.TEXTURE_SPRITE).spawn(new Vector3(fountain).add(0.5, 0.5, 0.5)).setAxis(Vector3.RotAxis.Y_AXIS).setNoRotation(45).setSprite(SpritesAS.SPR_FOUNTAIN_LIQUID).setAlphaMultiplier(1F).alpha((fx, alphaIn, pTicks) -> this.getSegmentPercent(OperationSegment.STARTUP, fountain.getTickActiveFountainEffect())).setScaleMultiplier(5.5F).refresh(RefreshFunction.tileExistsAnd(fountain, (tile, fx) -> tile.getCurrentEffect() == this));
} else if (sprite.isRemoved() || sprite.canRemove()) {
EffectHelper.refresh(sprite, EffectTemplatesAS.TEXTURE_SPRITE);
}
ctx.fountainSprite = sprite;
}
BlockPos fountainPos = fountain.getPos();
float segmentPercent = getSegmentPercent(currentSegment, operationTick);
switch(currentSegment) {
case STARTUP:
playFountainVortexParticles(fountainPos, segmentPercent);
playFountainArcs(fountainPos, segmentPercent);
break;
case PREPARATION:
playFountainArcs(fountainPos, 1F - segmentPercent);
playFountainVortexParticles(fountainPos, 1F - segmentPercent);
playDigPreparation(fountainPos, segmentPercent);
break;
case RUNNING:
playFountainVortexParticles(fountainPos, 0.2F);
playFountainArcs(fountainPos, 0.6F);
playDigParticles(fountainPos);
if (fountain.getTicksExisted() % 40 == 0) {
playDigLightbeam(fountainPos);
}
break;
}
}
Aggregations