From 620ba0a4641049057485ed008ae1fc470636a1f5 Mon Sep 17 00:00:00 2001 From: Tsubasa6848 <116721335+Tsubasa6848@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:20:57 +0800 Subject: [PATCH] adapt: adapt GMLIB v0.11.0 --- SDK-GMLIB | 2 +- manifest.json | 2 +- src/CompatibilityApi.cpp | 2 +- src/EventAPI.cpp | 15 +++++++++++++++ src/Global.h | 2 +- tooth.json | 4 ++-- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/SDK-GMLIB b/SDK-GMLIB index ae86cc4..cecc827 160000 --- a/SDK-GMLIB +++ b/SDK-GMLIB @@ -1 +1 @@ -Subproject commit ae86cc4327234e269b9be480148d9d6fe495b6fe +Subproject commit cecc827900f147de4c7aed916aeb4bca31b0682c diff --git a/manifest.json b/manifest.json index a69cfc2..c89d7e4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "${pluginName}", "entry": "${pluginFile}", - "version": "0.10.1", + "version": "0.11.0", "author": "GroupMountain", "type": "native", "dependencies": [ diff --git a/src/CompatibilityApi.cpp b/src/CompatibilityApi.cpp index c93ba4c..e6fdef3 100644 --- a/src/CompatibilityApi.cpp +++ b/src/CompatibilityApi.cpp @@ -394,7 +394,7 @@ void Export_Compatibility_API() { auto auids = GMLIB_Scoreboard::getInstance()->getInstance()->getAllEntities(); std::vector result; for (auto auid : auids) { - result.push_back(std::to_string(auid.get())); + result.push_back(std::to_string(auid.id)); } return result; }); diff --git a/src/EventAPI.cpp b/src/EventAPI.cpp index 388def3..c9ddb97 100644 --- a/src/EventAPI.cpp +++ b/src/EventAPI.cpp @@ -174,6 +174,21 @@ void Export_Event_API() { ); return true; } + case doHash("onEndermanTake"): { + auto Call = RemoteCall::importAs(eventName, eventId); + eventBus->emplaceListener( + [Call](GMLIB::Event::EntityEvent::EndermanTakeBlockBeforeEvent& ev) { + bool result = true; + try { + result = Call(&ev.self()); + } catch (...) {} + if (!result) { + ev.cancel(); + } + } + ); + return true; + } default: return false; } diff --git a/src/Global.h b/src/Global.h index dd1169c..e1a681d 100644 --- a/src/Global.h +++ b/src/Global.h @@ -4,7 +4,7 @@ #include #define PLUGIN_NAME "GMLIB-LRCA" -#define LIB_VERSION GMLIB::Version(0, 10, 1) +#define LIB_VERSION GMLIB::Version(0, 11, 0) extern ll::Logger logger; diff --git a/tooth.json b/tooth.json index 040fb96..5f17be7 100644 --- a/tooth.json +++ b/tooth.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi", - "version": "0.10.1", + "version": "0.11.0", "info": { "name": "GMLIB-LegacyRemoteCallApi", "description": "Legacy RemoteCall API for GMLIB", @@ -14,7 +14,7 @@ "library" ] }, - "asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.10.1/GMLIB-LegacyRemoteCallApi-windows-x64.zip", + "asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.11.0/GMLIB-LegacyRemoteCallApi-windows-x64.zip", "dependencies": { "github.com/GroupMountain/GMLIB": ">=0.10.0" },