Search in sources :

Example 1 with EntityMinorDemonGrunt

use of WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt in project BloodMagic by WayofTime.

the class DemonPacketMinorGrunt method summonDemons.

@Override
public int summonDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian) {
    EntityMinorDemonGrunt entity;
    {
        switch(type) {
            case FIRE:
                if (spawnGuardian) {
                    entity = new EntityMinorDemonGruntGuardianFire(world);
                } else {
                    entity = new EntityMinorDemonGruntFire(world);
                }
                break;
            case ICE:
                if (spawnGuardian) {
                    entity = new EntityMinorDemonGruntGuardianIce(world);
                } else {
                    entity = new EntityMinorDemonGruntIce(world);
                }
                break;
            case EARTH:
                if (spawnGuardian) {
                    entity = new EntityMinorDemonGruntGuardianEarth(world);
                } else {
                    entity = new EntityMinorDemonGruntEarth(world);
                }
                break;
            case WIND:
                if (spawnGuardian) {
                    entity = new EntityMinorDemonGruntGuardianWind(world);
                } else {
                    entity = new EntityMinorDemonGruntWind(world);
                }
                break;
            case NORMAL:
            default:
                if (spawnGuardian) {
                    entity = new EntityMinorDemonGruntGuardian(world);
                } else {
                    entity = new EntityMinorDemonGrunt(world);
                }
                break;
        }
    }
    entity.setPosition(x, y, z);
    world.spawnEntityInWorld(entity);
    teDemonPortal.enthrallDemon(entity);
    entity.setAggro(true);
    entity.setDropCrystal(false);
    return spawnGuardian ? 3 : 1;
}
Also used : EntityMinorDemonGruntGuardianEarth(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianEarth) EntityMinorDemonGruntIce(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntIce) EntityMinorDemonGrunt(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt) EntityMinorDemonGruntWind(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntWind) EntityMinorDemonGruntGuardianIce(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianIce) EntityMinorDemonGruntEarth(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntEarth) EntityMinorDemonGruntGuardian(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardian) EntityMinorDemonGruntGuardianWind(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianWind) EntityMinorDemonGruntFire(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntFire) EntityMinorDemonGruntGuardianFire(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianFire)

Example 2 with EntityMinorDemonGrunt

use of WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt in project BloodMagic by WayofTime.

the class RitualEffectAlphaPact method getRandomDemonForStage.

public IHoardDemon getRandomDemonForStage(World world, int x, int y, int z, int horizontalRange, int verticalRange) {
    EntityLivingBase entityLiving = new EntityMinorDemonGrunt(world);
    boolean isGood = false;
    for (int n = 0; n < 100; n++) {
        double newX = x + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5;
        double newY = y + (double) (rand.nextInt((int) verticalRange));
        double newZ = z + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5;
        entityLiving.posX = newX;
        entityLiving.posY = newY;
        entityLiving.posZ = newZ;
        int i = MathHelper.floor_double(entityLiving.posX);
        int j = MathHelper.floor_double(entityLiving.posY);
        int k = MathHelper.floor_double(entityLiving.posZ);
        Block l;
        if (entityLiving.worldObj.blockExists(i, j, k)) {
            boolean flag1 = false;
            while (!flag1 && j > 0) {
                l = entityLiving.worldObj.getBlock(i, j - 1, k);
                if (l != null && l.getMaterial().blocksMovement()) {
                    flag1 = true;
                } else {
                    --entityLiving.posY;
                    --j;
                }
            }
        }
        if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) {
            entityLiving.setPositionAndUpdate(newX, newY, newZ);
            isGood = true;
        }
    }
    if (isGood = false) {
        return null;
    }
    return (IHoardDemon) entityLiving;
}
Also used : EntityMinorDemonGrunt(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt) EntityLivingBase(net.minecraft.entity.EntityLivingBase) Block(net.minecraft.block.Block) IHoardDemon(WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon)

Aggregations

EntityMinorDemonGrunt (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt)2 EntityMinorDemonGruntEarth (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntEarth)1 EntityMinorDemonGruntFire (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntFire)1 EntityMinorDemonGruntGuardian (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardian)1 EntityMinorDemonGruntGuardianEarth (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianEarth)1 EntityMinorDemonGruntGuardianFire (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianFire)1 EntityMinorDemonGruntGuardianIce (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianIce)1 EntityMinorDemonGruntGuardianWind (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianWind)1 EntityMinorDemonGruntIce (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntIce)1 EntityMinorDemonGruntWind (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntWind)1 IHoardDemon (WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon)1 Block (net.minecraft.block.Block)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1