當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。