use of WayofTime.bloodmagic.entity.mob.EntitySentientSpecter in project BloodMagic by WayofTime.
the class ItemSentientSword method spawnSentientEntityOnDrop.
@Override
public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) {
World world = player.getEntityWorld();
if (!world.isRemote) {
this.recalculatePowers(droppedStack, world, player);
EnumDemonWillType type = this.getCurrentType(droppedStack);
double soulsRemaining = PlayerDemonWillHandler.getTotalDemonWill(type, player);
if (soulsRemaining < 1024) {
return false;
}
PlayerDemonWillHandler.consumeDemonWill(type, player, 100);
EntitySentientSpecter specterEntity = new EntitySentientSpecter(world);
specterEntity.setPosition(player.posX, player.posY, player.posZ);
world.spawnEntity(specterEntity);
specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy());
specterEntity.setType(this.getCurrentType(droppedStack));
specterEntity.setOwner(player);
specterEntity.setTamed(true);
return true;
}
return false;
}
use of WayofTime.bloodmagic.entity.mob.EntitySentientSpecter in project BloodMagic by WayofTime.
the class ItemSentientBow method spawnSentientEntityOnDrop.
@Override
public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) {
World world = player.getEntityWorld();
if (!world.isRemote) {
this.recalculatePowers(droppedStack, world, player);
EnumDemonWillType type = this.getCurrentType(droppedStack);
double soulsRemaining = PlayerDemonWillHandler.getTotalDemonWill(type, player);
if (soulsRemaining < 1024) {
return false;
}
PlayerDemonWillHandler.consumeDemonWill(type, player, 100);
EntitySentientSpecter specterEntity = new EntitySentientSpecter(world);
specterEntity.setPosition(player.posX, player.posY, player.posZ);
world.spawnEntity(specterEntity);
specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy());
specterEntity.setType(this.getCurrentType(droppedStack));
specterEntity.setOwner(player);
specterEntity.setTamed(true);
return true;
}
return false;
}
use of WayofTime.bloodmagic.entity.mob.EntitySentientSpecter in project BloodMagic by WayofTime.
the class ItemSentientAxe method spawnSentientEntityOnDrop.
@Override
public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) {
World world = player.getEntityWorld();
if (!world.isRemote) {
this.recalculatePowers(droppedStack, world, player);
EnumDemonWillType type = this.getCurrentType(droppedStack);
double soulsRemaining = PlayerDemonWillHandler.getTotalDemonWill(type, player);
if (soulsRemaining < 1024) {
return false;
}
PlayerDemonWillHandler.consumeDemonWill(type, player, 100);
EntitySentientSpecter specterEntity = new EntitySentientSpecter(world);
specterEntity.setPosition(player.posX, player.posY, player.posZ);
world.spawnEntity(specterEntity);
specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy());
specterEntity.setType(this.getCurrentType(droppedStack));
specterEntity.setOwner(player);
specterEntity.setTamed(true);
return true;
}
return false;
}
use of WayofTime.bloodmagic.entity.mob.EntitySentientSpecter in project BloodMagic by WayofTime.
the class GenericHandler method onExplosion.
@SubscribeEvent
public static void onExplosion(ExplosionEvent.Start event) {
World world = event.getWorld();
Explosion exp = event.getExplosion();
Vec3d position = exp.getPosition();
double radius = 3;
AxisAlignedBB bb = new AxisAlignedBB(position.x - radius, position.y - radius, position.z - radius, position.x + radius, position.y + radius, position.z + radius);
List<EntitySentientSpecter> specterList = world.getEntitiesWithinAABB(EntitySentientSpecter.class, bb);
if (!specterList.isEmpty()) {
for (EntitySentientSpecter specter : specterList) {
if (specter.absorbExplosion(exp)) {
event.setCanceled(true);
return;
}
}
}
}
use of WayofTime.bloodmagic.entity.mob.EntitySentientSpecter in project BloodMagic by WayofTime.
the class ItemSentientPickaxe method spawnSentientEntityOnDrop.
@Override
public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) {
World world = player.getEntityWorld();
if (!world.isRemote) {
this.recalculatePowers(droppedStack, world, player);
EnumDemonWillType type = this.getCurrentType(droppedStack);
double soulsRemaining = PlayerDemonWillHandler.getTotalDemonWill(type, player);
if (soulsRemaining < 1024) {
return false;
}
PlayerDemonWillHandler.consumeDemonWill(type, player, 100);
EntitySentientSpecter specterEntity = new EntitySentientSpecter(world);
specterEntity.setPosition(player.posX, player.posY, player.posZ);
world.spawnEntity(specterEntity);
specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy());
specterEntity.setType(this.getCurrentType(droppedStack));
specterEntity.setOwner(player);
specterEntity.setTamed(true);
return true;
}
return false;
}
Aggregations