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


Java EnumCreatureAttribute.UNDEAD属性代码示例

本文整理汇总了Java中net.minecraft.entity.EnumCreatureAttribute.UNDEAD属性的典型用法代码示例。如果您正苦于以下问题:Java EnumCreatureAttribute.UNDEAD属性的具体用法?Java EnumCreatureAttribute.UNDEAD怎么用?Java EnumCreatureAttribute.UNDEAD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.entity.EnumCreatureAttribute的用法示例。


在下文中一共展示了EnumCreatureAttribute.UNDEAD属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hitEntity

@Override
public boolean hitEntity(ItemStack weapon, EntityLiving target, EntityLiving user)
   {
	if(this.toolMaterial == ToolMaterialMedieval.DRAGONFORGE)
		target.setFire(20);
	
	if(this.toolMaterial == ToolMaterialMedieval.IGNOTUMITE)
	{
		user.heal(2);
	}
	if(this.toolMaterial == ToolMaterialMedieval.ORNATE)
	{
		if (((EntityLiving) target).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD || target.getClass().getName().endsWith("MoCEntityWarewolf"))
		{
			target.setFire(20);
			target.worldObj.playSoundAtEntity(target, "random.fizz", 1, 1);
		}
	}
	
       return super.hitEntity(weapon, target, user);
   }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:21,代码来源:ItemHoundWeaponMF.java

示例2: addCollisionBoxToList

@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
		entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
	}
	if (entityIn instanceof EntityBlaze) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityEnderman) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityGhast) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityVex) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:22,代码来源:BlockSaltBarrier.java

示例3: doShadowAttack

public void doShadowAttack(EntityLivingBase par1EntityLiving, float par2) {
	final boolean harm_undead = par1EntityLiving.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
	final EntityThrowable entityball = new EntityShadowBall(worldObj, this, harm_undead,
			IaSWorldHelper.getRegionLevel(par1EntityLiving) >= 6);

	final double d0 = par1EntityLiving.posX + par1EntityLiving.motionX - posX;
	final double d1 = par1EntityLiving.posY + par1EntityLiving.getEyeHeight() - getEyeHeight() - posY;
	final double d2 = par1EntityLiving.posZ + par1EntityLiving.motionZ - posZ;
	final float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);

	if (f1 <= 2.0) {
		entityball.setThrowableHeading(d0, d1, d2, 0.40F, 8.0F);
	} else {
		entityball.rotationPitch += 20.0F;
	}
	entityball.setThrowableHeading(d0, d1 + f1 * 0.2F, d2, 0.80F, 8.0F);
	worldObj.spawnEntityInWorld(entityball);
}
 
开发者ID:TheDaemoness,项目名称:IceAndShadow2,代码行数:18,代码来源:EntityNyxSkeleton.java

示例4: shouldSilverHurt

public static boolean shouldSilverHurt(EntityLivingBase target) 
{
	Class enClass = target.getClass();
	String name = "";
	if(enClass != null && EntityList.classToStringMapping.get(enClass) != null)
	{
		name = (String) EntityList.classToStringMapping.get(enClass);
	}
	
	if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) 
	{
		return true;
	}
	if (name.endsWith("Werewolf")) 
	{
		return true;
	}
	
	return false;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:20,代码来源:ItemArmourMFOld.java

示例5: shouldDefend

@Override
public boolean shouldDefend(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, ArmourSlot slot) {

    Entity entity = source.getSourceOfDamage();

    if (entity == null) {
        return false;
    }

    if (!(entity instanceof EntityMob)) {
        return false;
    }

    EntityMob entityMob = (EntityMob) entity;

    return entityMob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
}
 
开发者ID:chbachman,项目名称:ModularArmour,代码行数:17,代码来源:UpgradeUndead.java

示例6: getDamage

@Override
public float getDamage(Entity tar)
   {
	float dam = weaponDamage;
	
	if(tar != null && tar instanceof EntityLiving && toolMaterial == ToolMaterialMedieval.ORNATE)
	{
		if (((EntityLiving) tar).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD || tar.getClass().getName().endsWith("MoCEntityWarewolf"))
		{
			if(tar.getClass().getName().endsWith("MoCEntityWarewolf"))
			{
				dam *= 10;
			}
			else
			{
				dam *= 2;
			}
		}
	}
	
       return dam;
   }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:22,代码来源:ItemHoundWeaponMF.java

示例7: hitEntity

@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) {
	if (!target.world.isRemote) {
		if (target.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD && attacker instanceof EntityPlayer) {
			target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12);
			stack.damageItem(25, attacker);
		} else {
			stack.damageItem(1, attacker);
		}
	}

	return true;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:13,代码来源:ItemSilverPickaxe.java

示例8: handle_Cure

public static void handle_Cure(PacketSpellToServer message, World world)
{
	Entity e;
	
	e = world.getEntityByID(message.data);
	
	if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){
	
	((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 4.0f + (message.data2 / 20.0f));
	}
	if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
	{
		((EntityLivingBase)e).heal(3.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
	}
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例9: handle_Cura

public static void handle_Cura(PacketSpellToServer message, World world)
{
	Entity e;
	
	e = world.getEntityByID(message.data);
	if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
	{
		((EntityLivingBase)e).heal(6.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
	}
	if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){
		
		((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 8.0f + (message.data2 / 20.0f));
	}
	
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例10: handle_Curaga

public static void handle_Curaga(PacketSpellToServer message, World world)
{
	Entity e;
	
	e = world.getEntityByID(message.data);
	if (e instanceof EntityLivingBase && !(e instanceof EntityMob))
	{
		((EntityLivingBase)e).heal(9.0f + message.data2 / 30); //30 clarity pour 1 coeur en plus
	}
	
	if(((EntityLivingBase) e).getCreatureAttribute()==EnumCreatureAttribute.UNDEAD){
		
		((EntityLivingBase)e).attackEntityFrom(DamageSource.generic, 12.0f + (message.data2 / 20.0f));
	}
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例11: getDamageAgainstEntity

@Override
public float getDamageAgainstEntity(Entity shooter, Entity hitEntity, double originalDamage)
{
    if (hitEntity instanceof EntityLivingBase && ((EntityLivingBase) hitEntity).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
    {
        return (float) (originalDamage + 10 * (1 + Math.log(potency)));
    }
    return (float) originalDamage;
}
 
开发者ID:WayofTime,项目名称:Hemomancy,代码行数:9,代码来源:SpiritForceProjectileEffect.java

示例12: applyBonus

private float applyBonus(Entity entityHit, float dam) 
   {
   	EntityLivingBase living = null;
   	if(entityHit instanceof EntityLivingBase)
   	{
   		living = (EntityLivingBase)entityHit;
   	}
   	
   	if(type != null)
   	{
   		if(type.material == ToolMaterialMedieval.DRAGONFORGE)
   		{
   			entityHit.setFire(10);
   		}
   		if(type.material == ToolMaterialMedieval.IGNOTUMITE)
   		{
   			if(shootingEntity != null && shootingEntity instanceof EntityLivingBase)
   			{
   				((EntityLivingBase)shootingEntity).heal(dam/4F);
   			}
   		}
   		if(type.material == ToolMaterialMedieval.ORNATE)
   		{
   			if (living != null && living.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD || entityHit.getClass().getName().endsWith("MoCEntityWerewolf")) 
   			{
   				living.setFire(10);
				if(living.getClass().getName().endsWith("MoCEntityWarewolf"))
				{
					dam *= 10;
				}
				else
				{
					dam *= 3;
				}
				living.worldObj.playSoundAtEntity(living, "random.fizz", 1, 1);
			}
   		}
   	}
	return dam;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:40,代码来源:EntityBoltMF.java

示例13: getCreatureAttribute

/**
 * Get this Entity's EnumCreatureAttribute
 */
public EnumCreatureAttribute getCreatureAttribute()
{
    return EnumCreatureAttribute.UNDEAD;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:EntityZombie.java

示例14: getCreatureAttribute

/**
 * Get this Entity's EnumCreatureAttribute
 */
public EnumCreatureAttribute getCreatureAttribute()
{
    return this.getType().isUndead() ? EnumCreatureAttribute.UNDEAD : EnumCreatureAttribute.UNDEFINED;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:EntityHorse.java

示例15: calcDamageByCreature

/**
 * Calculates the additional damage that will be dealt by an item with this enchantment. This alternative to
 * calcModifierDamage is sensitive to the targets EnumCreatureAttribute.
 */
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType)
{
    return this.damageType == 0 ? 1.0F + (float)Math.max(0, level - 1) * 0.5F : (this.damageType == 1 && creatureType == EnumCreatureAttribute.UNDEAD ? (float)level * 2.5F : (this.damageType == 2 && creatureType == EnumCreatureAttribute.ARTHROPOD ? (float)level * 2.5F : 0.0F));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:EnchantmentDamage.java


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