use of net.minecraft.entity.ai.attributes.AttributeModifier in project EnderIO by SleepyTrousers.
the class ItemDarkSteelArmor method getAttributeModifiers.
@Override
@Nonnull
public Multimap<String, AttributeModifier> getAttributeModifiers(@Nonnull EntityEquipmentSlot equipmentSlot, @Nonnull ItemStack stack) {
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == this.armorType) {
boolean isPowered = EnergyUpgradeManager.getEnergyStored(stack) > 0;
if (isPowered) {
int toughnessBonus = 1;
multimap.removeAll(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName());
multimap.put(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName(), new AttributeModifier(ARMOR_MODIFIERS.get(equipmentSlot), "Armor toughness", toughness + toughnessBonus, 0));
int powerBonus = getPoweredProtectionIncrease(3 - equipmentSlot.getIndex());
multimap.removeAll(SharedMonsterAttributes.ARMOR.getName());
multimap.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS.get(equipmentSlot), "Armor modifier", damageReduceAmount + powerBonus, 0));
}
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project EnderIO by SleepyTrousers.
the class SpeedController method setModifiers.
private static void setModifiers(@Nonnull EntityPlayer player) {
SpeedUpgrade speedUpgrade = getActiveSpeedUpgrade(player);
if (speedUpgrade != null) {
EnergyUpgrade energyUpgrade = getActiveEnergyUpgrade(player);
if (energyUpgrade != null) {
IAttributeInstance moveInst = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MOVEMENT_SPEED);
AttributeModifier modifier = DarkSteelAttributeModifiers.getWalkSpeed(player.isSprinting(), speedUpgrade.getLevel(), energyUpgrade.getLevel());
moveInst.applyModifier(modifier);
}
}
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.
the class ItemSentientAxe method getAttributeModifiers.
// TODO: Change attack speed.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.create();
if (slot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.
the class ItemSentientShovel method getAttributeModifiers.
// TODO: Change attack speed.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.create();
if (slot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project BloodMagic by WayofTime.
the class LivingArmourUpgradeHealthboost method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.create();
String name = getUniqueIdentifier() + "-HealthModifier1";
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0));
return modifierMap;
}
Aggregations