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


Java BaseAttributeMap.getAttributeInstance方法代码示例

本文整理汇总了Java中net.minecraft.entity.ai.attributes.BaseAttributeMap.getAttributeInstance方法的典型用法代码示例。如果您正苦于以下问题:Java BaseAttributeMap.getAttributeInstance方法的具体用法?Java BaseAttributeMap.getAttributeInstance怎么用?Java BaseAttributeMap.getAttributeInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.ai.attributes.BaseAttributeMap的用法示例。


在下文中一共展示了BaseAttributeMap.getAttributeInstance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyAttributesModifiersToEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void applyAttributesModifiersToEntity(EntityLivingBase p_111185_1_, BaseAttributeMap p_111185_2_, int p_111185_3_)
{
    Iterator iterator = this.field_111188_I.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        IAttributeInstance iattributeinstance = p_111185_2_.getAttributeInstance((IAttribute)entry.getKey());

        if (iattributeinstance != null)
        {
            AttributeModifier attributemodifier = (AttributeModifier)entry.getValue();
            iattributeinstance.removeModifier(attributemodifier);
            iattributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), this.getName() + " " + p_111185_3_, this.func_111183_a(p_111185_3_, attributemodifier), attributemodifier.getOperation()));
        }
    }
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:18,代码来源:PotionLoader.java

示例2: rateDamage

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public static double rateDamage(ItemStack is)
{
  if (is == null) {
    return 0.0D;
  }
  Multimap attrs = is.getItem().getAttributeModifiers(is);
  if (attrs == null) {
    return 0.0D;
  }
  BaseAttributeMap test = new ServersideAttributeMap();
  test.applyAttributeModifiers(attrs);
  IAttributeInstance attr = test.getAttributeInstance(SharedMonsterAttributes.attackDamage);
  if (attr == null) {
    return 0.0D;
  }
  return attr.getAttributeValue();
}
 
开发者ID:MHuanterAxe,项目名称:MHuanterMod,代码行数:18,代码来源:Utils.java

示例3: applyAttributesModifiersToEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3)
{
    Iterator var4 = this.field_111188_I.entrySet().iterator();

    while (var4.hasNext())
    {
        Entry var5 = (Entry)var4.next();
        IAttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((IAttribute)var5.getKey());

        if (var6 != null)
        {
            AttributeModifier var7 = (AttributeModifier)var5.getValue();
            var6.removeModifier(var7);
            var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + par3, this.func_111183_a(par3, var7), var7.getOperation()));
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:18,代码来源:Potion.java

示例4: applyAttributesModifiersToEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3)
{
    Iterator iterator = this.field_111188_I.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        AttributeInstance attributeinstance = par2BaseAttributeMap.getAttributeInstance((Attribute)entry.getKey());

        if (attributeinstance != null)
        {
            AttributeModifier attributemodifier = (AttributeModifier)entry.getValue();
            attributeinstance.removeModifier(attributemodifier);
            attributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), this.getName() + " " + par3, this.func_111183_a(par3, attributemodifier), attributemodifier.getOperation()));
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:18,代码来源:Potion.java

示例5: removeAttributesModifiersFromEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111187_2_, int amplifier)
{
    for (Entry<IAttribute, AttributeModifier> entry : this.attributeModifierMap.entrySet())
    {
        IAttributeInstance iattributeinstance = p_111187_2_.getAttributeInstance((IAttribute)entry.getKey());

        if (iattributeinstance != null)
        {
            iattributeinstance.removeModifier((AttributeModifier)entry.getValue());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:Potion.java

示例6: applyAttributesModifiersToEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111185_2_, int amplifier)
{
    for (Entry<IAttribute, AttributeModifier> entry : this.attributeModifierMap.entrySet())
    {
        IAttributeInstance iattributeinstance = p_111185_2_.getAttributeInstance((IAttribute)entry.getKey());

        if (iattributeinstance != null)
        {
            AttributeModifier attributemodifier = (AttributeModifier)entry.getValue();
            iattributeinstance.removeModifier(attributemodifier);
            iattributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), this.getName() + " " + amplifier, this.getAttributeModifierAmount(amplifier, attributemodifier), attributemodifier.getOperation()));
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:Potion.java

示例7: removeAttributesModifiersFromEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_)
{
    Iterator iterator = this.field_111188_I.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        IAttributeInstance iattributeinstance = p_111187_2_.getAttributeInstance((IAttribute)entry.getKey());

        if (iattributeinstance != null)
        {
            iattributeinstance.removeModifier((AttributeModifier)entry.getValue());
        }
    }
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:16,代码来源:PotionLoader.java

示例8: rateDamage

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public static double rateDamage(ItemStack is) {
    if (is == null) return 0;
    Multimap<String, AttributeModifier> attrs = is.getItem().getAttributeModifiers(is);
    if (attrs == null) return 0;
    BaseAttributeMap test = new ServersideAttributeMap();
    test.applyAttributeModifiers(attrs);
    IAttributeInstance attr = test.getAttributeInstance(SharedMonsterAttributes.attackDamage);
    if (attr == null) return 0;
    return attr.getAttributeValue();
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:11,代码来源:FzUtil.java

示例9: removeAttributesModifiersFromEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3)
{
    Iterator var4 = this.field_111188_I.entrySet().iterator();

    while (var4.hasNext())
    {
        Entry var5 = (Entry)var4.next();
        IAttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((IAttribute)var5.getKey());

        if (var6 != null)
        {
            var6.removeModifier((AttributeModifier)var5.getValue());
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:16,代码来源:Potion.java

示例10: removeAttributesModifiersFromEntity

import net.minecraft.entity.ai.attributes.BaseAttributeMap; //导入方法依赖的package包/类
public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3)
{
    Iterator iterator = this.field_111188_I.entrySet().iterator();

    while (iterator.hasNext())
    {
        Entry entry = (Entry)iterator.next();
        AttributeInstance attributeinstance = par2BaseAttributeMap.getAttributeInstance((Attribute)entry.getKey());

        if (attributeinstance != null)
        {
            attributeinstance.removeModifier((AttributeModifier)entry.getValue());
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:16,代码来源:Potion.java


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