本文整理匯總了Java中net.minecraft.entity.ai.attributes.IAttributeInstance.getAttributeValue方法的典型用法代碼示例。如果您正苦於以下問題:Java IAttributeInstance.getAttributeValue方法的具體用法?Java IAttributeInstance.getAttributeValue怎麽用?Java IAttributeInstance.getAttributeValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.ai.attributes.IAttributeInstance
的用法示例。
在下文中一共展示了IAttributeInstance.getAttributeValue方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFovModifier
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
public float getFovModifier()
{
float f = 1.0F;
if (this.capabilities.isFlying)
{
f *= 1.1F;
}
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D));
if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f))
{
f = 1.0F;
}
if (this.isHandActive() && this.getActiveItemStack().getItem() == Items.BOW)
{
int i = this.getItemInUseMaxCount();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
else
{
f1 = f1 * f1;
}
f *= 1.0F - f1 * 0.15F;
}
return Reflector.ForgeHooksClient_getOffsetFOV.exists() ? Reflector.callFloat(Reflector.ForgeHooksClient_getOffsetFOV, new Object[] {this, Float.valueOf(f)}): f;
}
示例2: getFovModifier
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
public float getFovModifier()
{
float f = 1.0F;
if (this.capabilities.isFlying)
{
f *= 1.1F;
}
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D));
if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f))
{
f = 1.0F;
}
if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow)
{
int i = this.getItemInUseDuration();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
else
{
f1 = f1 * f1;
}
f *= 1.0F - f1 * 0.15F;
}
return f;
}
示例3: getFovModifier
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
public float getFovModifier()
{
float f = 1.0F;
if (this.capabilities.isFlying)
{
f *= 1.1F;
}
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D));
if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f))
{
f = 1.0F;
}
if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow)
{
int i = this.getItemInUseDuration();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
else
{
f1 = f1 * f1;
}
f *= 1.0F - f1 * 0.15F;
}
return Reflector.ForgeHooksClient_getOffsetFOV.exists() ? Reflector.callFloat(Reflector.ForgeHooksClient_getOffsetFOV, new Object[] {this, Float.valueOf(f)}): f;
}
示例4: getTargetDistance
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
protected double getTargetDistance()
{
IAttributeInstance iattributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例5: func_179438_f
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
protected double func_179438_f()
{
IAttributeInstance iattributeinstance = this.field_179442_b.getEntityAttribute(SharedMonsterAttributes.followRange);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例6: getTargetDistance
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
protected double getTargetDistance()
{
IAttributeInstance iattributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例7: func_179431_f
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
protected double func_179431_f()
{
IAttributeInstance iattributeinstance = this.field_179434_b.getEntityAttribute(SharedMonsterAttributes.followRange);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例8: maxTargetRange
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
/**
* Return the max target range of the entiity (16 by default)
*/
protected double maxTargetRange()
{
IAttributeInstance iattributeinstance = this.entityLiving.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例9: func_191523_f
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
private double func_191523_f()
{
IAttributeInstance iattributeinstance = this.blaze.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}
示例10: getFollowRange
import net.minecraft.entity.ai.attributes.IAttributeInstance; //導入方法依賴的package包/類
protected double getFollowRange()
{
IAttributeInstance iattributeinstance = this.mob.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE);
return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue();
}