Search in sources :

Example 86 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.

the class LivingArmourUpgradeKnockbackResist method getAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers() {
    Multimap<String, AttributeModifier> modifierMap = HashMultimap.create();
    String name = getUniqueIdentifier() + "-KnockbackModifier1";
    modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "KnockbackModifier1", kbModifier[this.level], 0));
    if (healthModifier[this.level] > 0) {
        name = getUniqueIdentifier() + "-HealthModifier1";
        modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0));
    }
    return modifierMap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 87 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.

the class LivingArmourUpgradeMeleeDamage method getAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers() {
    Multimap<String, AttributeModifier> modifierMap = HashMultimap.create();
    String name = getUniqueIdentifier() + "-DamageModifier1";
    modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "DamageModifier1", meleeDamage[this.level], 0));
    return modifierMap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 88 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.

the class LivingArmourUpgradeSlowness method getAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers() {
    Multimap<String, AttributeModifier> modifierMap = HashMultimap.create();
    String name = getUniqueIdentifier() + "-SpeedModifier1";
    modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "SpeedModifier1", speedModifier[this.level], 1));
    return modifierMap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 89 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.

the class ItemBoundPickaxe method getAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
    if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 5 : 2, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0));
    }
    return multimap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Example 90 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.

the class ItemBoundShovel method getItemAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
    if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 5, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0));
    }
    return multimap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Aggregations

AttributeModifier (net.minecraft.entity.ai.attributes.AttributeModifier)115 Nonnull (javax.annotation.Nonnull)19 Multimap (com.google.common.collect.Multimap)14 IAttributeInstance (net.minecraft.entity.ai.attributes.IAttributeInstance)11 UUID (java.util.UUID)9 ItemStack (net.minecraft.item.ItemStack)9 IAttribute (net.minecraft.entity.ai.attributes.IAttribute)8 HashMultimap (com.google.common.collect.HashMultimap)6 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)5 Map (java.util.Map)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 EntityEquipmentSlot (net.minecraft.inventory.EntityEquipmentSlot)4 Potion (net.minecraft.potion.Potion)4 PotionEffect (net.minecraft.potion.PotionEffect)4 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)4 Calendar (java.util.Calendar)3 EnergyUpgrade (crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 Iterator (java.util.Iterator)2