Search in sources :

Example 1 with BlockFountainPrime

use of hellfirepvp.astralsorcery.common.block.tile.fountain.BlockFountainPrime in project AstralSorcery by HellFirePvP.

the class TileFountain method updateFountainComponents.

private void updateFountainComponents() {
    FountainEffect prevEffect = this.getCurrentEffect();
    FountainEffect.EffectContext prevContext = this.effectContext;
    BlockState primeState = world.getBlockState(pos.down());
    if (primeState.getBlock() instanceof BlockFountainPrime) {
        if (this.setCurrentEffect(((BlockFountainPrime) primeState.getBlock()).provideEffect()) && prevEffect != null) {
            this.replaceCurrentEffect(prevEffect, prevContext, this.getCurrentEffect());
        }
    } else {
        if (this.setCurrentEffect(null) && prevEffect != null) {
            this.replaceCurrentEffect(prevEffect, prevContext, null);
        }
    }
}
Also used : FountainEffect(hellfirepvp.astralsorcery.common.crafting.nojson.fountain.FountainEffect) BlockState(net.minecraft.block.BlockState) BlockFountainPrime(hellfirepvp.astralsorcery.common.block.tile.fountain.BlockFountainPrime)

Aggregations

BlockFountainPrime (hellfirepvp.astralsorcery.common.block.tile.fountain.BlockFountainPrime)1 FountainEffect (hellfirepvp.astralsorcery.common.crafting.nojson.fountain.FountainEffect)1 BlockState (net.minecraft.block.BlockState)1