Search in sources :

Example 46 with AttributeModifier

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

the class OmegaArmourFire method getAttributeModifiers.

@Override
public Multimap getAttributeModifiers(ItemStack stack) {
    Multimap map = HashMultimap.create();
    int biomeID = this.getBiomeIDStored(stack);
    BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
    if (biome != null) {
        map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, /**
         * Random number *
         */
        armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForBiome(biome), 1));
        map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(196312, /**
         * Random number *
         */
        armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForBiome(biome), 1));
    }
    return map;
}
Also used : Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) BiomeGenBase(net.minecraft.world.biome.BiomeGenBase) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier) UUID(java.util.UUID)

Example 47 with AttributeModifier

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

the class OmegaArmourWind method getAttributeModifiers.

@Override
public Multimap getAttributeModifiers(ItemStack stack) {
    Multimap map = HashMultimap.create();
    int yLevel = this.getYLevelStored(stack);
    map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212, /**
     * Random number *
     */
    armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForLevel(yLevel), 1));
    map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(86212, /**
     * Random number *
     */
    armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForLevel(yLevel), 2));
    return map;
}
Also used : Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier) UUID(java.util.UUID)

Example 48 with AttributeModifier

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

the class OmegaArmourEarth method getAttributeModifiers.

@Override
public Multimap getAttributeModifiers(ItemStack stack) {
    Multimap map = HashMultimap.create();
    int yLevel = this.getYLevelStored(stack);
    map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618, /**
     * Random number *
     */
    armorType), "Knockback modifier" + armorType, getKnockbackResist(), 0));
    map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(80532, /**
     * Random number *
     */
    armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForLevel(yLevel), 1));
    map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85112, /**
     * Random number *
     */
    armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForLevel(yLevel), 2));
    return map;
}
Also used : Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier) UUID(java.util.UUID)

Example 49 with AttributeModifier

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

the class OmegaArmourWater method getAttributeModifiers.

@Override
public Multimap getAttributeModifiers(ItemStack stack) {
    Multimap map = HashMultimap.create();
    int biomeID = this.getBiomeIDStored(stack);
    BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
    if (biome != null) {
        map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312, /**
         * Random number *
         */
        armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForBiome(biome), 2));
        map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85432, /**
         * Random number *
         */
        armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForBiome(biome), 2));
    }
    return map;
}
Also used : Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) BiomeGenBase(net.minecraft.world.biome.BiomeGenBase) AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier) UUID(java.util.UUID)

Example 50 with AttributeModifier

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

the class ItemNanosaber method getAttributeModifiers.

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
    Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
    int modifier = 0;
    if (stack.getTagCompound().getBoolean("isActive"))
        modifier = 9;
    if (slot == EntityEquipmentSlot.MAINHAND) {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) modifier, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4000000953674316D, 0));
    }
    return multimap;
}
Also used : TextComponentString(net.minecraft.util.text.TextComponentString) 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