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