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;
}
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;
}
Aggregations