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


Java EntityLivingBase.isElytraFlying方法代码示例

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


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

示例1: getFiringSpeed

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public int getFiringSpeed(ItemStack stack, EntityLivingBase living) {
	int speed=(int) (TF2Attribute.getModifier("Fire Rate", stack,
			ItemFromData.getData(stack).getInt(PropertyType.FIRE_SPEED), living));
	if(living != null && this.isDoubleWielding(living))
		speed *= this.getDoubleWieldBonus(stack, living);
	if(TF2Attribute.getModifier("Fire Rate Health", stack, 1f, living) != 1f)
		speed *= this.getHealthBasedBonus(stack, living, TF2Attribute.getModifier("Fire Rate Health", stack, 1f, living));
	if(living != null && (WeaponsCapability.get(living).isExpJump() || living.isElytraFlying()) && TF2Attribute.getModifier("Airborne Bonus", stack, 0, living) != 0)
		speed *= 0.35f;
	if(living != null && living.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED)!=null){
		//System.out.println("Pre speed "+speed+" "+living.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getBaseValue());
		double modifiers=calculateModifiers(living.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED),ATTACK_SPEED_MODIFIER,living.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getBaseValue(),1.4);
		speed *= (living instanceof EntityPlayer? 4:living.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getBaseValue())/modifiers;
		//System.out.println("Post speed "+speed);
	}
	return speed;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:18,代码来源:ItemUsable.java

示例2: calculateCritPost

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public static int calculateCritPost(Entity target, EntityLivingBase shooter, int initial, ItemStack stack) {
	if (initial > 0 && (target instanceof EntityLivingBase && ((EntityLivingBase) target).getActivePotionEffect(TF2weapons.backup) != null))
		initial = 0;
	if (initial == 0 && (target instanceof EntityLivingBase && (((EntityLivingBase) target).getActivePotionEffect(TF2weapons.markDeath) != null
			|| ((EntityLivingBase) target).getActivePotionEffect(TF2weapons.jarate) != null)))
		initial = 1;
	if (initial == 0 && !stack.isEmpty() && !target.onGround && !target.isInWater() && TF2Attribute.getModifier("Minicrit Airborne", stack, 0, shooter) != 0)
		initial = 1;
	if (initial == 0 && !stack.isEmpty() && shooter != null) {
		float mindist=TF2Attribute.getModifier("Minicrit Distance", stack, 0, shooter);
		mindist*=mindist;
		if(mindist != 0f && target.getDistanceSqToEntity(shooter) >= mindist)
			initial = 1;
	}
	if (initial < 2 && (!stack.isEmpty() && target.isBurning() && TF2Attribute.getModifier("Crit Burn", stack, 0, shooter) != 0))
		initial = 2;
	if (initial < 2 && (!stack.isEmpty() && (target instanceof EntityLivingBase && ((EntityLivingBase) target).getActivePotionEffect(TF2weapons.stun) != null))
			&& TF2Attribute.getModifier("Crit Stun", stack, 0, shooter) != 0)
		initial = 2;
	if (initial < 2 && (!stack.isEmpty() && shooter != null && shooter instanceof EntityPlayer && 
			(shooter.getCapability(TF2weapons.WEAPONS_CAP, null).isExpJump() || shooter.isElytraFlying())
			&& TF2Attribute.getModifier("Crit Rocket", stack, 0, shooter) != 0))
		initial = 2;
	if (initial == 1 && (!stack.isEmpty() && shooter != null && shooter instanceof EntityPlayer && TF2Attribute.getModifier("Crit Mini", stack, 0, shooter) != 0))
		initial = 2;
	if (target instanceof EntityTF2Boss && initial == 1)
		initial = 0;
	if (target instanceof EntityMerasmus && ((EntityMerasmus) target).getActivePotionEffect(TF2weapons.stun) != null)
		initial = 2;
	return initial;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:32,代码来源:TF2Util.java


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