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


Java EnchantmentThorns.func_92096_a方法代码示例

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


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

示例1: attackEntityAsMob

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
@Override
  public boolean attackEntityAsMob(Entity enemy)
  {
  	timeUntilSit = 100;
  	jawMove = 10;
      float i = getBiteDamage(enemy);
      
      if(armour[0] != null)
{
	if(armour[0].getItem() instanceof ItemHoundWeapon)
	{
		if(enemy instanceof EntityLiving)
		((ItemHoundWeapon)armour[0].getItem()).hitEntity(armour[0], (EntityLiving)enemy, this);
	}
	if (enemy instanceof EntityLiving)
          {
              i += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLiving)enemy);
          }
}
      if(enemy.attackEntityFrom(DamageSource.causeMobDamage(this), i))
      {
       xp += (int)i;
       return true;
      }
      if (enemy instanceof EntityLiving)
      {
          EnchantmentThorns.func_92096_a(this, (EntityLiving)enemy, this.rand);
          int l = EnchantmentHelper.getFireAspectModifier(this);

          if (l > 0 && !enemy.isBurning())
          {
              enemy.setFire(l);
          }
      }
      
      return false;
  }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:38,代码来源:EntityHound.java

示例2: func_70652_k

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
public boolean func_70652_k(Entity p_70652_1_) {
   float var2 = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e();
   int var3 = 0;
   if(p_70652_1_ instanceof EntityLivingBase) {
      var2 += EnchantmentHelper.func_77512_a(this, (EntityLivingBase)p_70652_1_);
      var3 += EnchantmentHelper.func_77507_b(this, (EntityLivingBase)p_70652_1_);
   }

   boolean var4 = p_70652_1_.func_70097_a(DamageSource.func_76358_a(this), var2);
   if(var4) {
      if(var3 > 0) {
         p_70652_1_.func_70024_g((double)(-MathHelper.func_76126_a(this.field_70177_z * 3.1415927F / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.func_76134_b(this.field_70177_z * 3.1415927F / 180.0F) * (float)var3 * 0.5F));
         this.field_70159_w *= 0.6D;
         this.field_70179_y *= 0.6D;
      }

      int var5 = EnchantmentHelper.func_90036_a(this);
      if(var5 > 0) {
         p_70652_1_.func_70015_d(var5 * 4);
      }

      if(p_70652_1_ instanceof EntityLivingBase) {
         EnchantmentThorns.func_92096_a(this, (EntityLivingBase)p_70652_1_, this.field_70146_Z);
      }
   }

   return var4;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:EntityMob.java

示例3: attackEntityAsMob

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
public boolean attackEntityAsMob(Entity par1Entity)
{
    float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
    int i = 0;

    if (par1Entity instanceof EntityLivingBase)
    {
        f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity);
        i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity);
    }

    boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), f);

    if (flag)
    {
        if (i > 0)
        {
            par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F));
            this.motionX *= 0.6D;
            this.motionZ *= 0.6D;
        }

        int j = EnchantmentHelper.getFireAspectModifier(this);

        if (j > 0)
        {
            par1Entity.setFire(j * 4);
        }

        if (par1Entity instanceof EntityLivingBase)
        {
            EnchantmentThorns.func_92096_a(this, (EntityLivingBase)par1Entity, this.rand);
        }
    }

    return flag;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:38,代码来源:EntityMob.java

示例4: attackEntityAsMob

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
@Override
public boolean attackEntityAsMob(Entity tar)
{
	if(!this.canEntityBeSeen(tar))return false;
	
    float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() * attackMod;
    int i = 0;

    if (tar instanceof EntityLivingBase)
    {
        f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)tar);
        i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)tar);
    }

    boolean flag = tar.attackEntityFrom(DamageSource.causeMobDamage(this), f);

    if(isTitan)
    {
     if(!worldObj.isRemote && rand.nextInt(getStrongChance()) == 0)
     {
     	worldObj.createExplosion(this, tar.posX, tar.posY, tar.posZ, rand.nextFloat()*0.5F + 0.5F, true);
     }
    }
    
    if (flag)
    {
        if (i > 0)
        {
            tar.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F));
            this.motionX *= 0.6D;
            this.motionZ *= 0.6D;
        }

        int j = EnchantmentHelper.getFireAspectModifier(this);

        if (j > 0)
        {
            tar.setFire(j * 4);
        }

        if (tar instanceof EntityLivingBase)
        {
            EnchantmentThorns.func_92096_a(this, (EntityLivingBase)tar, this.rand);
        }
    }

    return flag;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:49,代码来源:EntityMinotaur.java

示例5: attackEntityAsMob

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
public boolean attackEntityAsMob(Entity target)
{
    float var2 = this.getAttackStrength(target);

    if (this.isPotionActive(Potion.damageBoost))
    {
        var2 += 3 << this.getActivePotionEffect(Potion.damageBoost).getAmplifier();
    }

    if (this.isPotionActive(Potion.weakness))
    {
        var2 -= 2 << this.getActivePotionEffect(Potion.weakness).getAmplifier();
    }

    int var3 = 0;

    if (target instanceof EntityLiving)
    {
        var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLiving)target);
        var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLiving)target);
    }

    boolean var4 = target.attackEntityFrom(DamageSource.causeMobDamage(this), var2);

    if (var4)
    {
        if (var3 > 0)
        {
            target.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F));
            this.motionX *= 0.6D;
            this.motionZ *= 0.6D;
        }

        int var5 = EnchantmentHelper.getFireAspectModifier(this);

        if (var5 > 0)
        {
            target.setFire(var5 * 4);
        }

        if (target instanceof EntityLiving)
        {
            EnchantmentThorns.func_92096_a(this, (EntityLiving)target, this.rand);
        }
    }

    return var4;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:49,代码来源:EntityDaymob.java

示例6: attackEntityAsMob

import net.minecraft.enchantment.EnchantmentThorns; //导入方法依赖的package包/类
@Override
public boolean attackEntityAsMob(Entity par1Entity)
{
    int i = this.getAttackStrength(par1Entity);

    if (this.isPotionActive(Potion.damageBoost))
    {
        i += 3 << this.getActivePotionEffect(Potion.damageBoost).getAmplifier();
    }

    if (this.isPotionActive(Potion.weakness))
    {
        i -= 2 << this.getActivePotionEffect(Potion.weakness).getAmplifier();
    }

    int j = 0;

    if (par1Entity instanceof EntityLiving)
    {
        i += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLiving)par1Entity);
        j += EnchantmentHelper.getKnockbackModifier(this, (EntityLiving)par1Entity);
    }

    boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), i);

    if (flag)
    {
        if (j > 0)
        {
        	this.heal(5);
            par1Entity.addVelocity(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * j * 0.5F, 0.1D, MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * j * 0.5F);
            this.motionX *= 0.6D;
            this.motionZ *= 0.6D;
        }

        int k = EnchantmentHelper.getFireAspectModifier(this);

        if (k > 0)
        {
            par1Entity.setFire(k * 4);
        }

        if (par1Entity instanceof EntityLiving)
        {
            EnchantmentThorns.func_92096_a(this, (EntityLiving)par1Entity, this.rand);
        }
    }

    return flag;
}
 
开发者ID:Hologuardian,项目名称:FallingEarth,代码行数:51,代码来源:EntityMeteorSpawn.java


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