mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-22 15:22:56 +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) {
|
||||
return ItemStack.builder(material)
|
||||
.amount(amount)
|
||||
.meta(metaBuilder -> {
|
||||
metaBuilder.nbt = nbtCompound.deepClone();
|
||||
NBTUtils.loadDataIntoMeta(metaBuilder, metaBuilder.nbt);
|
||||
return metaBuilder;
|
||||
}).build();
|
||||
.meta(metaBuilder -> ItemMetaBuilder.fromNBT(metaBuilder, nbtCompound))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Contract(value = "_, _ -> new", pure = true)
|
||||
|
Loading…
Reference in New Issue
Block a user