Improve item default attribute API

This commit is contained in:
Jake Potrebic
2021-05-08 15:02:00 -07:00
parent f5eeda6d92
commit 00ebe90031
2 changed files with 57 additions and 4 deletions

View File

@@ -2368,6 +2368,21 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
// @NotNull
// EquipmentSlot getEquipmentSlot();
// Paper start - improve default item attribute API
/**
* Return an immutable copy of all default {@link Attribute}s and their
* {@link AttributeModifier}s.
* <p>
* Default attributes are those that are always preset on some items, unless
* they are specifically overridden on that {@link ItemStack}. Examples include
* the attack damage on weapons or the armor value on armor.
*
* @return the immutable {@link Multimap} with the respective default
* Attributes and modifiers, or an empty map if no attributes are set.
*/
@NotNull @org.jetbrains.annotations.Unmodifiable Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers();
// Paper end - improve default item attribute API
/**
* Return an immutable copy of all default {@link Attribute}s and their
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.