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