use of net.minecraft.entity.ai.attributes.AttributeModifier in project Galacticraft by micdoodle8.
the class ItemSwordAsteroids 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", this.attackDamageD, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.8D, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Overloaded by CJ-MC-Mods.
the class ItemMultiChestplate method getItemAttributeModifiers.
@Override
@Nonnull
public Multimap<String, AttributeModifier> getItemAttributeModifiers(@Nullable EntityEquipmentSlot equipmentSlot) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
if (equipmentSlot == this.armorType) {
multimap.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Armor modifier", 100, 0));
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Max Health", 100, 0));
multimap.put(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Armor toughness", 100, 0));
}
return multimap;
}
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;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project SilentGems by SilentChaos512.
the class EquipmentTooltips method getToughness.
private float getToughness(ItemStack stack, float defaultValue) {
if (StackHelper.isEmpty(stack))
return defaultValue;
ItemArmor itemArmor = (ItemArmor) stack.getItem();
EntityEquipmentSlot slot = itemArmor.armorType;
UUID uuid = ItemArmor.ARMOR_MODIFIERS[slot.getIndex()];
Multimap<String, AttributeModifier> multimap = stack.getAttributeModifiers(slot);
for (Entry<String, AttributeModifier> entry : multimap.entries()) {
String key = entry.getKey();
AttributeModifier mod = entry.getValue();
if (key.equals(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName()) && mod.getID().equals(uuid)) {
return (float) mod.getAmount();
}
}
return 0f;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project SilentGems by SilentChaos512.
the class EquipmentTooltips method getProtection.
private float getProtection(ItemStack stack, float defaultValue) {
if (StackHelper.isEmpty(stack))
return defaultValue;
ItemArmor itemArmor = (ItemArmor) stack.getItem();
EntityEquipmentSlot slot = itemArmor.armorType;
UUID uuid = ItemArmor.ARMOR_MODIFIERS[slot.getIndex()];
Multimap<String, AttributeModifier> multimap = stack.getAttributeModifiers(slot);
for (Entry<String, AttributeModifier> entry : multimap.entries()) {
String key = entry.getKey();
AttributeModifier mod = entry.getValue();
if (key.equals(SharedMonsterAttributes.ARMOR.getName()) && mod.getID().equals(uuid)) {
return (float) mod.getAmount();
}
}
return 0f;
}
Aggregations