mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Added ItemStack#withTag
This commit is contained in:
parent
d4fc6a094a
commit
ffca5eea00
@ -193,6 +193,11 @@ public final class ItemStack implements TagReadable, HoverEventSource<HoverEvent
|
||||
.stackingRule(stackingRule);
|
||||
}
|
||||
|
||||
@Contract(value = "_, _ -> new", pure = true)
|
||||
public <T> @NotNull ItemStack withTag(@NotNull Tag<T> tag, @Nullable T value) {
|
||||
return builder().meta(metaBuilder -> metaBuilder.set(tag, value)).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
||||
return meta.getTag(tag);
|
||||
|
Loading…
Reference in New Issue
Block a user