Search in sources :

Example 11 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project ArsMagica2 by Mithion.

the class ItemWinterGuardianArm method getItemAttributeModifiers.

@Override
public Multimap getItemAttributeModifiers() {
    Multimap multimap = super.getItemAttributeModifiers();
    multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 6, 0));
    return multimap;
}
Also used : Multimap(com.google.common.collect.Multimap) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 12 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project ArsMagica2 by Mithion.

the class ItemNatureGuardianSickle method getItemAttributeModifiers.

@Override
public Multimap getItemAttributeModifiers() {
    Multimap multimap = super.getItemAttributeModifiers();
    multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 7, 0));
    return multimap;
}
Also used : Multimap(com.google.common.collect.Multimap) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 13 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project ImmersiveEngineering by BluSunrize.

the class ItemRevolver method getAttributeModifiers.

@Override
public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
    Multimap multimap = super.getAttributeModifiers(slot, stack);
    if (slot == EntityEquipmentSlot.MAINHAND) {
        double melee = getUpgrades(stack).getDouble("melee");
        if (melee != 0)
            multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", melee, 0));
        double speed = getUpgrades(stack).getDouble("speed");
        if (speed != 0)
            multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(speedModUUID, "Weapon modifier", speed, 1));
    }
    return multimap;
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) Multimap(com.google.common.collect.Multimap) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 14 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project Skree by Skelril.

the class ICustomTool method getItemAttributeModifiers.

/**
     * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
     */
@SuppressWarnings("unchecked")
default default Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
    Multimap<String, AttributeModifier> multimap = __superGetItemAttributeModifiers(equipmentSlot);
    if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", __getHitPower(), 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", __getAttackSpeed(), 0));
    }
    return multimap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 15 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project Skree by Skelril.

the class ICustomArmor method getItemAttributeModifiers.

default default Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
    Multimap<String, AttributeModifier> multimap = __superGetItemAttributeModifiers(equipmentSlot);
    if (equipmentSlot == __getSlotType()) {
        multimap.put(SharedMonsterAttributes.ARMOR.getAttributeUnlocalizedName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Armor modifier", (double) __getDamageReductionAmount(), 0));
        multimap.put(SharedMonsterAttributes.ARMOR_TOUGHNESS.getAttributeUnlocalizedName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Armor toughness", (double) __getToughness(), 0));
    }
    return multimap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Aggregations

AttributeModifier (net.minecraft.entity.ai.attributes.AttributeModifier)16 Multimap (com.google.common.collect.Multimap)4 IAttribute (net.minecraft.entity.ai.attributes.IAttribute)3 IAttributeInstance (net.minecraft.entity.ai.attributes.IAttributeInstance)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Collection (java.util.Collection)1 Iterator (java.util.Iterator)1 Nonnull (javax.annotation.Nonnull)1 IEntityLivingData (net.minecraft.entity.IEntityLivingData)1 ModifiableAttributeInstance (net.minecraft.entity.ai.attributes.ModifiableAttributeInstance)1 ItemStack (net.minecraft.item.ItemStack)1 Potion (net.minecraft.potion.Potion)1 PotionEffect (net.minecraft.potion.PotionEffect)1 Tuple (net.minecraft.util.Tuple)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1