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


Java EnchantmentHelper.func_152377_a方法代码示例

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


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

示例1: attack

import net.minecraft.enchantment.EnchantmentHelper; //导入方法依赖的package包/类
private void attack(final EntityLivingBase ent, final boolean crit) {
    this.swingItem();
    if (crit) {
        this.crit();
    }
    else {
        this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer());
    }
    final float sharpLevel = EnchantmentHelper.func_152377_a(this.mc.thePlayer.getHeldItem(), ent.getCreatureAttribute());
    final boolean vanillaCrit = this.mc.thePlayer.fallDistance > 0.0f && !this.mc.thePlayer.onGround && !this.mc.thePlayer.isOnLadder() && !this.mc.thePlayer.isInWater() && !this.mc.thePlayer.isPotionActive(Potion.blindness) && this.mc.thePlayer.ridingEntity == null;
    this.mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(ent, C02PacketUseEntity.Action.ATTACK));
    if (crit || vanillaCrit) {
        this.mc.thePlayer.onCriticalHit(ent);
    }
    if (sharpLevel > 0.0f) {
        this.mc.thePlayer.onEnchantmentCritical(ent);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:Aura.java

示例2: attackEntityAsMob

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

    if (entityIn instanceof EntityLivingBase)
    {
        f += EnchantmentHelper.func_152377_a(this.getHeldItem(), ((EntityLivingBase)entityIn).getCreatureAttribute());
        i += EnchantmentHelper.getKnockbackModifier(this);
    }

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

    if (flag)
    {
        if (i > 0)
        {
            entityIn.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)
        {
            entityIn.setFire(j * 4);
        }

        this.applyEnchantments(this, entityIn);
    }

    return flag;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:EntityMob.java

示例3: fakeAttack

import net.minecraft.enchantment.EnchantmentHelper; //导入方法依赖的package包/类
private void fakeAttack(final EntityLivingBase ent) {
    this.fakeSwingItem();
    final float sharpLevel = EnchantmentHelper.func_152377_a(this.mc.thePlayer.getHeldItem(), ent.getCreatureAttribute());
    final boolean vanillaCrit = this.mc.thePlayer.fallDistance > 0.0f && !this.mc.thePlayer.onGround && !this.mc.thePlayer.isOnLadder() && !this.mc.thePlayer.isInWater() && !this.mc.thePlayer.isPotionActive(Potion.blindness) && this.mc.thePlayer.ridingEntity == null;
    if (this.criticals || vanillaCrit) {
        this.mc.thePlayer.onCriticalHit(ent);
    }
    if (sharpLevel > 0.0f) {
        this.mc.thePlayer.onEnchantmentCritical(ent);
    }
    this.pseudoTimer.reset();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:Aura.java

示例4: player_attack_noSwing

import net.minecraft.enchantment.EnchantmentHelper; //导入方法依赖的package包/类
public static void player_attack_noSwing(EntityLivingBase target) {
    playerController().func_78764_a(thePlayer(), target);
    float sharpLevel = EnchantmentHelper.func_152377_a(thePlayer().func_70694_bm(), target.func_70668_bt());
    if (sharpLevel > 0.0F) thePlayer().func_71047_c(target);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:6,代码来源:Wrapper.java


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