mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-22 23:31:37 +01:00
Fix ItemStack#fromNBT
This commit is contained in:
parent
508659fd30
commit
61d2ef2f06
@ -60,11 +60,8 @@ public final class ItemStack implements HoverEventSource<HoverEvent.ShowItem> {
|
|||||||
public static @NotNull ItemStack fromNBT(@NotNull Material material, @NotNull NBTCompound nbtCompound, int amount) {
|
public static @NotNull ItemStack fromNBT(@NotNull Material material, @NotNull NBTCompound nbtCompound, int amount) {
|
||||||
return ItemStack.builder(material)
|
return ItemStack.builder(material)
|
||||||
.amount(amount)
|
.amount(amount)
|
||||||
.meta(metaBuilder -> {
|
.meta(metaBuilder -> ItemMetaBuilder.fromNBT(metaBuilder, nbtCompound))
|
||||||
metaBuilder.nbt = nbtCompound.deepClone();
|
.build();
|
||||||
NBTUtils.loadDataIntoMeta(metaBuilder, metaBuilder.nbt);
|
|
||||||
return metaBuilder;
|
|
||||||
}).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Contract(value = "_, _ -> new", pure = true)
|
@Contract(value = "_, _ -> new", pure = true)
|
||||||
|
Loading…
Reference in New Issue
Block a user