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


Java IAttributeInstance.getAttributeValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:AbstractClientPlayer.java

示例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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:AbstractClientPlayer.java

示例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;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:37,代码来源:AbstractClientPlayer.java

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:EntityAITarget.java

示例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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:EntityAIFindEntityNearest.java

示例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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:EntityAITarget.java

示例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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:EntityAIFindEntityNearestPlayer.java

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:EntityAIFindEntityNearestPlayer.java

示例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();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:EntityBlaze.java

示例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();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:EntityAIFindEntityNearest.java


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