本文整理汇总了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);
}