fix: fix typo [#57]

This commit is contained in:
zimuya4153
2025-08-17 17:00:59 +08:00
Unverified
parent 09a63596c9
commit e6d9356e72
+3 -3
View File
@@ -711,10 +711,10 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "setItemShouldKeepOnDeath", [](ItemStack const* item, bool value) -> void { RemoteCall::exportAs("GMLIB_API", "setItemShouldKeepOnDeath", [](ItemStack const* item, bool value) -> void {
auto nbt = ((GMItemStack*)item)->getNbt(); auto nbt = ((GMItemStack*)item)->getNbt();
if (value) { if (value) {
(*nbt)["tags"]["minecraft:keep_on_death"] = true; (*nbt)["tag"]["minecraft:keep_on_death"] = true;
} else { } else {
if (nbt->contains("tags") && (*nbt)["tags"].contains("minecraft:keep_on_death")) { if (nbt->contains("tag") && (*nbt)["tag"].contains("minecraft:keep_on_death")) {
(*nbt)["tags"].get<CompoundTag>().erase("minecraft:keep_on_death"); (*nbt)["tag"].get<CompoundTag>().erase("minecraft:keep_on_death");
} }
} }
((GMItemStack*)item)->setNbt(*nbt); ((GMItemStack*)item)->setNbt(*nbt);