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