• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Attribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.entity.ai.attributes.Attribute的典型用法代码示例。如果您正苦于以下问题:Java Attribute类的具体用法?Java Attribute怎么用?Java Attribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Attribute类属于net.minecraft.entity.ai.attributes包,在下文中一共展示了Attribute类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: func_111261_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
private static NBTTagCompound func_111261_a(AttributeInstance p_111261_0_) {
   NBTTagCompound var1 = new NBTTagCompound();
   Attribute var2 = p_111261_0_.func_111123_a();
   var1.func_74778_a("Name", var2.func_111108_a());
   var1.func_74780_a("Base", p_111261_0_.func_111125_b());
   Collection var3 = p_111261_0_.func_111122_c();
   if(var3 != null && !var3.isEmpty()) {
      NBTTagList var4 = new NBTTagList();
      Iterator var5 = var3.iterator();

      while(var5.hasNext()) {
         AttributeModifier var6 = (AttributeModifier)var5.next();
         if(var6.func_111165_e()) {
            var4.func_74742_a(func_111262_a(var6));
         }
      }

      var1.func_74782_a("Modifiers", var4);
   }

   return var1;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:23,代码来源:SharedMonsterAttributes.java


示例2: applyAttributesModifiersToEntity

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的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


示例3: ModifiableAttributeInstance

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public ModifiableAttributeInstance(BaseAttributeMap p_i1608_1_, Attribute p_i1608_2_) {
   this.field_111138_a = p_i1608_1_;
   this.field_111136_b = p_i1608_2_;
   this.field_111132_f = p_i1608_2_.func_111110_b();

   for(int var3 = 0; var3 < 3; ++var3) {
      this.field_111137_c.put(Integer.valueOf(var3), new HashSet());
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:11,代码来源:ModifiableAttributeInstance.java


示例4: func_111150_b

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public AttributeInstance func_111150_b(Attribute p_111150_1_) {
   if(this.field_111153_b.containsKey(p_111150_1_.func_111108_a())) {
      throw new IllegalArgumentException("Attribute is already registered!");
   } else {
      ModifiableAttributeInstance var2 = new ModifiableAttributeInstance(this, p_111150_1_);
      this.field_111153_b.put(p_111150_1_.func_111108_a(), var2);
      if(p_111150_1_ instanceof RangedAttribute && ((RangedAttribute)p_111150_1_).func_111116_f() != null) {
         this.field_111163_c.put(((RangedAttribute)p_111150_1_).func_111116_f(), var2);
      }

      this.field_111154_a.put(p_111150_1_, var2);
      return var2;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:ServersideAttributeMap.java


示例5: func_111187_a

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

   while(var4.hasNext()) {
      Entry var5 = (Entry)var4.next();
      AttributeInstance var6 = p_111187_2_.func_111151_a((Attribute)var5.getKey());
      if(var6 != null) {
         var6.func_111124_b((AttributeModifier)var5.getValue());
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:13,代码来源:Potion.java


示例6: func_111185_a

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

   while(var4.hasNext()) {
      Entry var5 = (Entry)var4.next();
      AttributeInstance var6 = p_111185_2_.func_111151_a((Attribute)var5.getKey());
      if(var6 != null) {
         AttributeModifier var7 = (AttributeModifier)var5.getValue();
         var6.func_111124_b(var7);
         var6.func_111121_a(new AttributeModifier(var7.func_111167_a(), this.func_76393_a() + " " + p_111185_3_, this.func_111183_a(p_111185_3_, var7), var7.func_111169_c()));
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:Potion.java


示例7: func_111261_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
private static NBTTagCompound func_111261_a(AttributeInstance par0AttributeInstance)
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    Attribute attribute = par0AttributeInstance.func_111123_a();
    nbttagcompound.setString("Name", attribute.getAttributeUnlocalizedName());
    nbttagcompound.setDouble("Base", par0AttributeInstance.getBaseValue());
    Collection collection = par0AttributeInstance.func_111122_c();

    if (collection != null && !collection.isEmpty())
    {
        NBTTagList nbttaglist = new NBTTagList();
        Iterator iterator = collection.iterator();

        while (iterator.hasNext())
        {
            AttributeModifier attributemodifier = (AttributeModifier)iterator.next();

            if (attributemodifier.isSaved())
            {
                nbttaglist.appendTag(func_111262_a(attributemodifier));
            }
        }

        nbttagcompound.setTag("Modifiers", nbttaglist);
    }

    return nbttagcompound;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:SharedMonsterAttributes.java


示例8: removeAttributesModifiersFromEntity

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的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


示例9: func_111123_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public Attribute func_111123_a() {
   return this.field_111136_b;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:ModifiableAttributeInstance.java


示例10: func_111151_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public AttributeInstance func_111151_a(Attribute p_111151_1_) {
   return (AttributeInstance)this.field_111154_a.get(p_111151_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:BaseAttributeMap.java


示例11: func_111159_c

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public ModifiableAttributeInstance func_111159_c(Attribute p_111159_1_) {
   return (ModifiableAttributeInstance)super.func_111151_a(p_111159_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:ServersideAttributeMap.java


示例12: func_111151_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public AttributeInstance func_111151_a(Attribute p_111151_1_) {
   return this.func_111159_c(p_111151_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:ServersideAttributeMap.java


示例13: func_110148_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public AttributeInstance func_110148_a(Attribute p_110148_1_) {
   return this.func_110140_aT().func_111151_a(p_110148_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:EntityLivingBase.java


示例14: func_77624_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void func_77624_a(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
   if(p_77624_1_.func_77960_j() != 0) {
      List var5 = Item.field_77726_bs.func_77832_l(p_77624_1_);
      HashMultimap var6 = HashMultimap.create();
      Iterator var16;
      if(var5 != null && !var5.isEmpty()) {
         var16 = var5.iterator();

         while(var16.hasNext()) {
            PotionEffect var8 = (PotionEffect)var16.next();
            String var9 = StatCollector.func_74838_a(var8.func_76453_d()).trim();
            Potion var10 = Potion.field_76425_a[var8.func_76456_a()];
            Map var11 = var10.func_111186_k();
            if(var11 != null && var11.size() > 0) {
               Iterator var12 = var11.entrySet().iterator();

               while(var12.hasNext()) {
                  Entry var13 = (Entry)var12.next();
                  AttributeModifier var14 = (AttributeModifier)var13.getValue();
                  AttributeModifier var15 = new AttributeModifier(var14.func_111166_b(), var10.func_111183_a(var8.func_76458_c(), var14), var14.func_111169_c());
                  var6.put(((Attribute)var13.getKey()).func_111108_a(), var15);
               }
            }

            if(var8.func_76458_c() > 0) {
               var9 = var9 + " " + StatCollector.func_74838_a("potion.potency." + var8.func_76458_c()).trim();
            }

            if(var8.func_76459_b() > 20) {
               var9 = var9 + " (" + Potion.func_76389_a(var8) + ")";
            }

            if(var10.func_76398_f()) {
               p_77624_3_.add(EnumChatFormatting.RED + var9);
            } else {
               p_77624_3_.add(EnumChatFormatting.GRAY + var9);
            }
         }
      } else {
         String var7 = StatCollector.func_74838_a("potion.empty").trim();
         p_77624_3_.add(EnumChatFormatting.GRAY + var7);
      }

      if(!var6.isEmpty()) {
         p_77624_3_.add("");
         p_77624_3_.add(EnumChatFormatting.DARK_PURPLE + StatCollector.func_74838_a("potion.effects.whenDrank"));
         var16 = var6.entries().iterator();

         while(var16.hasNext()) {
            Entry var17 = (Entry)var16.next();
            AttributeModifier var18 = (AttributeModifier)var17.getValue();
            double var19 = var18.func_111164_d();
            double var20;
            if(var18.func_111169_c() != 1 && var18.func_111169_c() != 2) {
               var20 = var18.func_111164_d();
            } else {
               var20 = var18.func_111164_d() * 100.0D;
            }

            if(var19 > 0.0D) {
               p_77624_3_.add(EnumChatFormatting.BLUE + StatCollector.func_74837_a("attribute.modifier.plus." + var18.func_111169_c(), new Object[]{ItemStack.field_111284_a.format(var20), StatCollector.func_74838_a("attribute.name." + (String)var17.getKey())}));
            } else if(var19 < 0.0D) {
               var20 *= -1.0D;
               p_77624_3_.add(EnumChatFormatting.RED + StatCollector.func_74837_a("attribute.modifier.take." + var18.func_111169_c(), new Object[]{ItemStack.field_111284_a.format(var20), StatCollector.func_74838_a("attribute.name." + (String)var17.getKey())}));
            }
         }
      }

   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:72,代码来源:ItemPotion.java


示例15: func_111184_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public Potion func_111184_a(Attribute p_111184_1_, String p_111184_2_, double p_111184_3_, int p_111184_5_) {
   AttributeModifier var6 = new AttributeModifier(UUID.fromString(p_111184_2_), this.func_76393_a(), p_111184_3_, p_111184_5_);
   this.field_111188_I.put(p_111184_1_, var6);
   return this;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:6,代码来源:Potion.java


示例16: getEntityAttribute

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public AttributeInstance getEntityAttribute(Attribute par1Attribute)
{
    return this.getAttributeMap().getAttributeInstance(par1Attribute);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:EntityLivingBase.java


示例17: func_111184_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5)
{
    AttributeModifier attributemodifier = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5);
    this.field_111188_I.put(par1Attribute, attributemodifier);
    return this;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:7,代码来源:Potion.java


示例18: func_111150_b

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
public abstract AttributeInstance func_111150_b(Attribute var1); 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:2,代码来源:BaseAttributeMap.java


示例19: func_111123_a

import net.minecraft.entity.ai.attributes.Attribute; //导入依赖的package包/类
Attribute func_111123_a(); 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:2,代码来源:AttributeInstance.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ILogger类代码示例发布时间:2022-05-23
下一篇:
Java FormEditText类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap