We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f06050 commit 4973963Copy full SHA for 4973963
src/legacy/api/ItemAPI.cpp
@@ -312,10 +312,13 @@ Local<Value> ItemClass::set(const Arguments& args) {
312
auto itemNew = ItemClass::extract(args[0]);
313
if (!itemNew) return Local<Value>(); // Null
314
315
+ auto tag = itemNew->save();
316
if (std::holds_alternative<std::unique_ptr<ItemStack>>(item)) {
- std::get<std::unique_ptr<ItemStack>>(item).reset();
317
+ std::get<std::unique_ptr<ItemStack>>(item)->load(*tag);
318
+ } else {
319
+ std::get<ItemStack*>(item)->load(*tag);
320
}
- (item = itemNew);
321
+
322
return Boolean::newBoolean(true);
323
324
CATCH("Fail in set!");
0 commit comments