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