当前位置: 首页>>代码示例>>Java>>正文


Java ITaintedMob类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:17,代码来源:PotionFluxTaint.java

示例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);
	}
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:13,代码来源:PotionFluxTaint.java

示例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);
       } 
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:16,代码来源:PotionFluxTaint.java

示例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();
            }
        }
    }

}
 
开发者ID:Thog,项目名称:ThaumicThings,代码行数:33,代码来源:CommonProxy.java

示例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);
    }
}
 
开发者ID:Thog,项目名称:ThaumicThings,代码行数:9,代码来源:PotionEthereal.java

示例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);
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:11,代码来源:PotionFluxTaint.java

示例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);
	}
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:11,代码来源:PotionFluxTaint.java

示例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);
    }
}
 
开发者ID:Thog,项目名称:ThaumicThings,代码行数:52,代码来源:EntityBottleEthereal.java

示例9: isTainted

import thaumcraft.api.entities.ITaintedMob; //导入依赖的package包/类
public static boolean isTainted(Entity entity) {

        if(entity instanceof ITaintedMob) {

            return true;

        }

        return false;

    }
 
开发者ID:MasterAbdoTGM50,项目名称:ThaumicWarden,代码行数:12,代码来源:PurityHelper.java

示例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);

    }

}
 
开发者ID:MasterAbdoTGM50,项目名称:ThaumicWarden,代码行数:15,代码来源:WardenicUpgradeWarden.java

示例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);

    }

}
 
开发者ID:MasterAbdoTGM50,项目名称:ThaumicWarden,代码行数:13,代码来源:WardenicUpgradeWarden.java


注:本文中的thaumcraft.api.entities.ITaintedMob类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。