本文整理匯總了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);
}
}
示例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;
}
示例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();
}
示例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);
}