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