Fix potential race condition

This commit is contained in:
TheMode 2021-04-13 03:29:55 +02:00
parent 2b74d7697c
commit 508659fd30
2 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ public abstract class ItemMetaBuilder {
public static @NotNull ItemMetaBuilder fromNBT(@NotNull ItemMetaBuilder src, @NotNull NBTCompound nbtCompound) {
ItemMetaBuilder dest = src.getSupplier().get();
dest.nbt = nbtCompound.deepClone();
NBTUtils.loadDataIntoMeta(dest, nbtCompound);
NBTUtils.loadDataIntoMeta(dest, dest.nbt);
return dest;
}

View File

@ -62,7 +62,7 @@ public final class ItemStack implements HoverEventSource<HoverEvent.ShowItem> {
.amount(amount)
.meta(metaBuilder -> {
metaBuilder.nbt = nbtCompound.deepClone();
NBTUtils.loadDataIntoMeta(metaBuilder, nbtCompound);
NBTUtils.loadDataIntoMeta(metaBuilder, metaBuilder.nbt);
return metaBuilder;
}).build();
}