mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Added ItemStack#getAttribute
This commit is contained in:
parent
4eb09e70e7
commit
857d3f0c6e
@ -323,6 +323,20 @@ public class ItemStack implements DataContainer {
|
||||
return Collections.unmodifiableList(attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link ItemAttribute} with the specified internal name
|
||||
*
|
||||
* @param internalName the internal name of the attribute
|
||||
* @return the {@link ItemAttribute} with the internal name, null if not found
|
||||
*/
|
||||
public ItemAttribute getAttribute(String internalName) {
|
||||
for (ItemAttribute itemAttribute : attributes) {
|
||||
if (itemAttribute.getInternalName().equals(internalName))
|
||||
return itemAttribute;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an attribute to the item
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user