本文整理汇总了Java中thaumcraft.api.entities.ITaintedMob类的典型用法代码示例。如果您正苦于以下问题:Java ITaintedMob类的具体用法?Java ITaintedMob怎么用?Java ITaintedMob使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITaintedMob类属于thaumcraft.api.entities包,在下文中一共展示了ITaintedMob类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2)
{
if(target instanceof ITaintedMob)
{
target.heal(1);
}
else if(!target.isEntityUndead() && !(target instanceof EntityPlayer))
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
else if(!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer)))
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
示例2: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2) {
if (target instanceof ITaintedMob) {
target.heal(1);
}
else if (!target.isEntityUndead() && ! (target instanceof EntityPlayer)) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
else if (!target.isEntityUndead() && ( (target.getMaxHealth() > 1) || (target instanceof EntityPlayer))) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
示例3: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2) {
if (target instanceof ITaintedMob) {
target.heal(1);
} else
if (!target.isEntityUndead() && !(target instanceof EntityPlayer))
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
else
if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer)))
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
示例4: onDead
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@SubscribeEvent
public void onDead(LivingDeathEvent event)
{
if (!event.entityLiving.worldObj.isRemote)
{
if (event.entityLiving instanceof ITaintedMob)
{
// Ethereal
if (event.entityLiving.isPotionActive(ethereal))
{
this.spawnOriginalLivingEntity(event.entityLiving);
} else if (event.entityLiving.isPotionActive(PotionFluxTaint.instance))
{
this.spawnTaintLivingEntity(event.entityLiving);
}
}
// Tain Villager on death
else if ((event.entityLiving instanceof EntityVillager && event.source.getEntity() != null && (event.source.getEntity() instanceof EntityTaintVillager)) || (event.entityLiving instanceof EntityZombie && ((EntityZombie) event.entityLiving).isVillager()))
{
EntityTaintVillager tainVillager = new EntityTaintVillager(event.entityLiving.worldObj);
if (tainVillager != null)
{
tainVillager.setLocationAndAngles(event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, event.entityLiving.rotationYaw, 0.0F);
event.entityLiving.worldObj.spawnEntityInWorld(tainVillager);
event.entityLiving.setDead();
}
}
}
}
示例5: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2)
{
if (target instanceof ITaintedMob)
{
target.attackEntityFrom(ThaumicThings.ETHEREAL, 1.0F);
}
}
示例6: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2) {
if (target instanceof ITaintedMob) {
target.heal(1);
} else if (!target.isEntityUndead() && !(target instanceof EntityPlayer)) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
} else if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer))) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
示例7: performEffect
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase target, int par2) {
if (target instanceof ITaintedMob) {
target.heal(1);
} else if (!target.isEntityUndead() && !(target instanceof EntityPlayer)) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
} else if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer))) {
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
示例8: onImpact
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
protected void onImpact(MovingObjectPosition movingObjectPosition)
{
if (!worldObj.isRemote)
{
List entities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(5.0D, 5.0D, 5.0D));
if (entities.size() > 0)
{
Iterator iterator = entities.iterator();
while (iterator.hasNext())
{
Object y = iterator.next();
EntityLivingBase entity = (EntityLivingBase) y;
if (entity instanceof ITaintedMob && !entity.isEntityUndead())
entity.addPotionEffect(new PotionEffect(CommonProxy.ethereal.getId(), 1200, 0, false));
}
}
int entityPosX = (int) this.posX;
int entityPosY = (int) this.posY;
int entityPosZ = (int) this.posZ;
for (int i = 0; i < 10; ++i)
{
int x = (int) ((this.rand.nextFloat() - this.rand.nextFloat()) * 5.0F);
int z = (int) ((this.rand.nextFloat() - this.rand.nextFloat()) * 5.0F);
if ((this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeTaintID || this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeEerieID || this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeMagicalForestID))
{
BiomeGenBase[] biomesForGeneration = null;
biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x + entityPosX, z + entityPosZ, 1, 1);
if (biomesForGeneration != null && biomesForGeneration[0] != null)
{
BiomeGenBase biome = biomesForGeneration[0];
if (biome.biomeID == ThaumcraftWorldGenerator.biomeTaint.biomeID)
{
biome = BiomeGenBase.plains;
}
Utils.setBiomeAt(this.worldObj, x + entityPosX, z + entityPosZ, biome);
worldObj.markBlockRangeForRenderUpdate(x + entityPosX, entityPosY - 1, z + entityPosZ, x + entityPosX + 16, entityPosY, z + entityPosZ + 16);
}
}
}
this.setDead();
} else
{
ThaumicThings.proxy.onBottleBreak(ThaumicThings.proxy.bottleEthereal, worldObj, posX, posY, posZ);
}
}
示例9: isTainted
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
public static boolean isTainted(Entity entity) {
if(entity instanceof ITaintedMob) {
return true;
}
return false;
}
示例10: onAttack
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void onAttack(ItemStack stack, EntityPlayer player, Entity entity) {
super.onAttack(stack, player, entity);
if(entity instanceof EntityEldritchGuardian || entity instanceof ITaintedMob) {
DamageSource damageSource = new DamageSourceWarden("warden", player);
entity.attackEntityFrom(damageSource, 20);
}
}
示例11: onAttacked
import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
@Override
public void onAttacked(LivingHurtEvent event) {
super.onAttacked(event);
if(event.source.getEntity() instanceof EntityEldritchGuardian || event.source.getEntity() instanceof ITaintedMob) {
event.setCanceled(true);
}
}