mirror of
https://github.com/Minestom/Minestom.git
synced 2024-06-25 05:54:53 +02:00
Fix potential race condition
This commit is contained in:
parent
2b74d7697c
commit
508659fd30
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user