mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +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);
|
.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
|
@Override
|
||||||
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
public <T> @Nullable T getTag(@NotNull Tag<T> tag) {
|
||||||
return meta.getTag(tag);
|
return meta.getTag(tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user