Search in sources :

Example 1 with BlockSpectralContainer

use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.

the class ModBlocks method init.

public static void init() {
    blockAltar = new BlockAltar();
    bloodRune = new BloodRune();
    speedRune = new SpeedRune();
    efficiencyRune = new EfficiencyRune();
    runeOfSacrifice = new RuneOfSacrifice();
    runeOfSelfSacrifice = new RuneOfSelfSacrifice();
    blockTeleposer = new BlockTeleposer();
    spectralBlock = new SpectralBlock();
    ritualStone = new RitualStone();
    blockMasterStone = new BlockMasterStone();
    imperfectRitualStone = new ImperfectRitualStone();
    bloodSocket = new BlockSocket();
    armourForge = new ArmourForge();
    emptySocket = new EmptySocket();
    largeBloodStoneBrick = new LargeBloodStoneBrick();
    bloodStoneBrick = new BloodStoneBrick();
    blockWritingTable = new BlockWritingTable();
    blockHomHeart = new BlockHomHeart();
    blockPedestal = new BlockPedestal();
    blockPlinth = new BlockPlinth();
    blockConduit = new BlockConduit();
    blockBloodLight = new BlockBloodLightSource();
    blockSpellEffect = new BlockSpellEffect();
    blockSpellParadigm = new BlockSpellParadigm();
    blockSpellModifier = new BlockSpellModifier();
    blockSpellEnhancement = new BlockSpellEnhancement();
    blockSpectralContainer = new BlockSpectralContainer();
    blockDemonPortal = new BlockDemonPortal();
    blockBuildingSchematicSaver = new BlockSchematicSaver();
    blockReagentConduit = new BlockReagentConduit();
    blockAlchemicCalcinator = new BlockAlchemicCalcinator();
    blockCrystalBelljar = new BlockBelljar();
    blockDemonChest = new BlockDemonChest();
    blockCrystal = new BlockCrystal();
    blockMimic = new MimicBlock();
    blockLifeEssence = new LifeEssenceBlock();
    blockEnchantmentGlyph = new BlockEnchantmentGlyph();
    blockStabilityGlyph = new BlockStabilityGlyph();
    blockCrucible = new BlockCrucible();
}
Also used : BlockSchematicSaver(WayofTime.alchemicalWizardry.common.block.BlockSchematicSaver) BlockBelljar(WayofTime.alchemicalWizardry.common.block.BlockBelljar) BlockSpectralContainer(WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer) ImperfectRitualStone(WayofTime.alchemicalWizardry.common.block.ImperfectRitualStone) RuneOfSacrifice(WayofTime.alchemicalWizardry.common.block.RuneOfSacrifice) BlockDemonPortal(WayofTime.alchemicalWizardry.common.block.BlockDemonPortal) SpeedRune(WayofTime.alchemicalWizardry.common.block.SpeedRune) RuneOfSelfSacrifice(WayofTime.alchemicalWizardry.common.block.RuneOfSelfSacrifice) LargeBloodStoneBrick(WayofTime.alchemicalWizardry.common.block.LargeBloodStoneBrick) BlockConduit(WayofTime.alchemicalWizardry.common.block.BlockConduit) BlockAlchemicCalcinator(WayofTime.alchemicalWizardry.common.block.BlockAlchemicCalcinator) BlockPedestal(WayofTime.alchemicalWizardry.common.block.BlockPedestal) SpectralBlock(WayofTime.alchemicalWizardry.common.block.SpectralBlock) BlockCrystal(WayofTime.alchemicalWizardry.common.block.BlockCrystal) BlockSpellEffect(WayofTime.alchemicalWizardry.common.block.BlockSpellEffect) BlockReagentConduit(WayofTime.alchemicalWizardry.common.block.BlockReagentConduit) BlockSocket(WayofTime.alchemicalWizardry.common.block.BlockSocket) BlockBloodLightSource(WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource) BlockHomHeart(WayofTime.alchemicalWizardry.common.block.BlockHomHeart) EmptySocket(WayofTime.alchemicalWizardry.common.block.EmptySocket) BlockDemonChest(WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.BlockDemonChest) BlockSpellParadigm(WayofTime.alchemicalWizardry.common.block.BlockSpellParadigm) BlockSpellEnhancement(WayofTime.alchemicalWizardry.common.block.BlockSpellEnhancement) BlockTeleposer(WayofTime.alchemicalWizardry.common.block.BlockTeleposer) LifeEssenceBlock(WayofTime.alchemicalWizardry.common.block.LifeEssenceBlock) BlockEnchantmentGlyph(WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph) ArmourForge(WayofTime.alchemicalWizardry.common.block.ArmourForge) BlockWritingTable(WayofTime.alchemicalWizardry.common.block.BlockWritingTable) EfficiencyRune(WayofTime.alchemicalWizardry.common.block.EfficiencyRune) BlockStabilityGlyph(WayofTime.alchemicalWizardry.common.block.BlockStabilityGlyph) BlockPlinth(WayofTime.alchemicalWizardry.common.block.BlockPlinth) BloodStoneBrick(WayofTime.alchemicalWizardry.common.block.BloodStoneBrick) LargeBloodStoneBrick(WayofTime.alchemicalWizardry.common.block.LargeBloodStoneBrick) BlockSpellModifier(WayofTime.alchemicalWizardry.common.block.BlockSpellModifier) BlockCrucible(WayofTime.alchemicalWizardry.common.block.BlockCrucible) MimicBlock(WayofTime.alchemicalWizardry.common.block.MimicBlock) BlockAltar(WayofTime.alchemicalWizardry.common.block.BlockAltar) BloodRune(WayofTime.alchemicalWizardry.common.block.BloodRune) BlockMasterStone(WayofTime.alchemicalWizardry.common.block.BlockMasterStone) RitualStone(WayofTime.alchemicalWizardry.common.block.RitualStone) ImperfectRitualStone(WayofTime.alchemicalWizardry.common.block.ImperfectRitualStone)

Example 2 with BlockSpectralContainer

use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.

the class RitualEffectLava method performEffect.

@Override
public void performEffect(IMasterRitualStone ritualStone) {
    String owner = ritualStone.getOwner();
    int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
    World world = ritualStone.getWorld();
    int x = ritualStone.getXCoord();
    int y = ritualStone.getYCoord();
    int z = ritualStone.getZCoord();
    if (this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost)) {
        boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
        boolean drainReductus = world.getWorldTime() % 100 == 0;
        int range = 5;
        List<EntityLivingBase> entityList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range);
        EntityPlayer player = SpellHelper.getPlayerForUsername(owner);
        for (EntityLivingBase entity : entityList) {
            if (entity != player && this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost) && !entity.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) {
                if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) {
                    if (entity instanceof EntityPlayer) {
                        if (drainReductus) {
                            this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
                        }
                        continue;
                    }
                }
                entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id, 100, 0));
                this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true);
                SoulNetworkHandler.syphonFromNetwork(owner, fireFuseCost);
            }
        }
    }
    Block block = world.getBlock(x, y + 1, z);
    if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) {
        if (currentEssence < this.getCostPerRefresh()) {
            SoulNetworkHandler.causeNauseaToPlayer(owner);
        } else {
            for (int i = 0; i < 10; i++) {
                SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
            }
            world.setBlock(x, y + 1, z, Blocks.lava, 0, 3);
            SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
        }
    } else {
        boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
        if (!hasSanctus) {
            return;
        }
        TileEntity tile = world.getTileEntity(x, y + 1, z);
        if (tile instanceof IFluidHandler) {
            int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false);
            if (amount >= 1000) {
                ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true);
                this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
                SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
            }
        }
    }
}
Also used : PotionEffect(net.minecraft.potion.PotionEffect) BlockSpectralContainer(WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer) FluidStack(net.minecraftforge.fluids.FluidStack) World(net.minecraft.world.World) IFluidHandler(net.minecraftforge.fluids.IFluidHandler) TileEntity(net.minecraft.tileentity.TileEntity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Block(net.minecraft.block.Block)

Example 3 with BlockSpectralContainer

use of WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer in project BloodMagic by WayofTime.

the class RitualEffectWater method performEffect.

public void performEffect(IMasterRitualStone ritualStone) {
    String owner = ritualStone.getOwner();
    int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
    World world = ritualStone.getWorld();
    int x = ritualStone.getXCoord();
    int y = ritualStone.getYCoord();
    int z = ritualStone.getZCoord();
    boolean hasCrystallos = this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false);
    boolean hasAquasalus = this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false);
    boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false);
    if (hasAquasalus) {
        int hydrationRange = 4;
        int vertRange = 3;
        for (int i = -hydrationRange; i <= hydrationRange; i++) {
            for (int j = -vertRange; j <= vertRange; j++) {
                for (int k = -hydrationRange; k <= hydrationRange; k++) {
                    if (SpellHelper.hydrateSoil(world, x + i, y + j, z + k)) {
                        this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true);
                    }
                }
            }
        }
    }
    if (hasOffensa) {
        boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
        boolean drainReductus = world.getWorldTime() % 100 == 0;
        int range = 10;
        List<Entity> list = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range);
        for (Entity entity : list) {
            if (entity instanceof EntityLivingBase) {
                EntityLivingBase livingEntity = (EntityLivingBase) entity;
                if (livingEntity == SpellHelper.getPlayerForUsername(owner)) {
                    continue;
                }
                if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) {
                    if (livingEntity instanceof EntityPlayer) {
                        if (drainReductus) {
                            this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
                        }
                        continue;
                    }
                }
                if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionDrowning)) {
                    livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 0));
                    this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true);
                }
            }
        }
    }
    Block block = world.getBlock(x, y + 1, z);
    if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) {
        if (currentEssence < this.getCostPerRefresh()) {
            SoulNetworkHandler.causeNauseaToPlayer(owner);
        } else {
            for (int i = 0; i < 10; i++) {
                SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z);
            }
            world.setBlock(x, y + 1, z, Blocks.water, 0, 3);
            SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
        }
    } else {
        boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false);
        if (!hasSanctus) {
            return;
        }
        TileEntity tile = world.getTileEntity(x, y + 1, z);
        if (tile instanceof IFluidHandler) {
            int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false);
            if (amount >= 1000) {
                ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true);
                this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true);
                SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
            }
        }
    }
    if (hasCrystallos) {
        int range = 2;
        for (int i = -range; i <= range; i++) {
            for (int j = -range; j <= range; j++) {
                for (int k = -range; k <= range; k++) {
                    hasCrystallos = hasCrystallos && this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false);
                    if (hasCrystallos) {
                        boolean success = false;
                        if (!world.isAirBlock(x + i, y + j, z + k) && SpellHelper.freezeWaterBlock(world, x + i, y + j, z + k)) {
                            success = true;
                        } else {
                            if (world.rand.nextInt(100) == 0 && world.isSideSolid(x + i, y + j - 1, z + k, ForgeDirection.UP)) {
                                success = true;
                            }
                        }
                        if (success) {
                            this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true);
                        }
                    }
                }
            }
        }
    }
}
Also used : Entity(net.minecraft.entity.Entity) TileEntity(net.minecraft.tileentity.TileEntity) PotionEffect(net.minecraft.potion.PotionEffect) BlockSpectralContainer(WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer) FluidStack(net.minecraftforge.fluids.FluidStack) World(net.minecraft.world.World) IFluidHandler(net.minecraftforge.fluids.IFluidHandler) TileEntity(net.minecraft.tileentity.TileEntity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Block(net.minecraft.block.Block)

Aggregations

BlockSpectralContainer (WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer)3 Block (net.minecraft.block.Block)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 PotionEffect (net.minecraft.potion.PotionEffect)2 TileEntity (net.minecraft.tileentity.TileEntity)2 World (net.minecraft.world.World)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 IFluidHandler (net.minecraftforge.fluids.IFluidHandler)2 ArmourForge (WayofTime.alchemicalWizardry.common.block.ArmourForge)1 BlockAlchemicCalcinator (WayofTime.alchemicalWizardry.common.block.BlockAlchemicCalcinator)1 BlockAltar (WayofTime.alchemicalWizardry.common.block.BlockAltar)1 BlockBelljar (WayofTime.alchemicalWizardry.common.block.BlockBelljar)1 BlockBloodLightSource (WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource)1 BlockConduit (WayofTime.alchemicalWizardry.common.block.BlockConduit)1 BlockCrucible (WayofTime.alchemicalWizardry.common.block.BlockCrucible)1 BlockCrystal (WayofTime.alchemicalWizardry.common.block.BlockCrystal)1 BlockDemonPortal (WayofTime.alchemicalWizardry.common.block.BlockDemonPortal)1 BlockEnchantmentGlyph (WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph)1 BlockHomHeart (WayofTime.alchemicalWizardry.common.block.BlockHomHeart)1