mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-09-28 14:37:42 +02:00
Add Item#copy
This commit is contained in:
parent
d5a568b3fc
commit
d5f2388723
@ -92,6 +92,11 @@ public class DataItem implements Item {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item copy() {
|
||||
return new DataItem(identifier, amount, data, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
|
@ -87,4 +87,11 @@ public interface Item {
|
||||
* @param tag item tag
|
||||
*/
|
||||
void setTag(@Nullable CompoundTag tag);
|
||||
|
||||
/**
|
||||
* Returns a copy of the item.
|
||||
*
|
||||
* @return copy of the item
|
||||
*/
|
||||
Item copy();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user