From cd1933519a8ecfeefea5a543bc1cc97abe014a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=B2=90=E5=91=80?= <163636894+zimuya4153@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DsetItemShouldKeepOnDeath?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CompatibilityApi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CompatibilityApi.cpp b/src/CompatibilityApi.cpp index 063af08..fb9eea2 100644 --- a/src/CompatibilityApi.cpp +++ b/src/CompatibilityApi.cpp @@ -1,5 +1,6 @@ #include "Global.h" #include +#include bool isInteger(const std::string& str) { std::regex pattern("^[+-]?\\d+$"); @@ -790,7 +791,7 @@ void Export_Compatibility_API() { return ((GMLIB_ItemStack*)item)->getShouldKeepOnDeath(); }); RemoteCall::exportAs("GMLIB_API", "setItemShouldKeepOnDeath", [](ItemStack const* item, bool value) -> void { - ((GMLIB_ItemStack*)item)->setShouldKeepOnDeath(true); + ((GMLIB_ItemStack*)item)->setShouldKeepOnDeath(value); }); RemoteCall::exportAs("GMLIB_API", "getItemLockMode", [](ItemStack const* item) -> int { return (int)((GMLIB_ItemStack*)item)->getItemLockMode();