Compare commits

...

3 Commits

7 changed files with 27 additions and 16 deletions
-4
View File
@@ -105,10 +105,6 @@ class StaticFloatingText {
this.mPlaceholderAPI = papi; this.mPlaceholderAPI = papi;
this.mRuntimeId = GMLIB_API.createFloatingText(this.mPosition, this.mText, this.mPlaceholderAPI); this.mRuntimeId = GMLIB_API.createFloatingText(this.mPosition, this.mText, this.mPlaceholderAPI);
FloatingTextList.push(this); FloatingTextList.push(this);
this.sendToClients();
mc.listen("onJoin", (pl) => {
this.sendToClient(pl);
});
} }
sendToClient(player) { sendToClient(player) {
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "${pluginName}", "name": "${pluginName}",
"entry": "${pluginFile}", "entry": "${pluginFile}",
"version": "0.10.1", "version": "0.12.0",
"author": "GroupMountain", "author": "GroupMountain",
"type": "native", "type": "native",
"dependencies": [ "dependencies": [
+6 -6
View File
@@ -94,7 +94,7 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"createFloatingText", "createFloatingText",
[](std::pair<Vec3, int> pos, std::string text, bool papi) -> int { [](std::pair<Vec3, int> pos, std::string text, bool papi) -> int {
auto ft = new GMLIB::Server::FloatingText(text, pos.first, pos.second, papi); auto ft = new GMLIB::Server::StaticFloatingText(text, pos.first, pos.second, papi);
return ft->getRuntimeID(); return ft->getRuntimeID();
} }
); );
@@ -168,16 +168,16 @@ void Export_Compatibility_API() {
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"resourcePackTranslate", "resourcePackTranslate",
[](std::string key, std::vector<std::string> params) -> std::string { return I18n::get(key, params); } [](std::string key, std::vector<std::string> params) -> std::string { return I18nAPI::get(key, params); }
); );
RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string code) -> void { RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string code) -> void {
if (GMLIB_Level::getInstance()) { if (GMLIB_Level::getInstance()) {
I18n::chooseLanguage(code); I18nAPI::chooseLanguage(code);
} }
}); });
RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string { RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string {
if (GMLIB_Level::getInstance()) { if (auto result = I18nAPI::getCurrentLanguageCode()) {
return I18n::getCurrentLanguage()->getFullLanguageCode(); return result.value();
} }
return "unknown"; return "unknown";
}); });
@@ -394,7 +394,7 @@ void Export_Compatibility_API() {
auto auids = GMLIB_Scoreboard::getInstance()->getInstance()->getAllEntities(); auto auids = GMLIB_Scoreboard::getInstance()->getInstance()->getAllEntities();
std::vector<std::string> result; std::vector<std::string> result;
for (auto auid : auids) { for (auto auid : auids) {
result.push_back(std::to_string(auid.get())); result.push_back(std::to_string(auid.id));
} }
return result; return result;
}); });
+15
View File
@@ -174,6 +174,21 @@ void Export_Event_API() {
); );
return true; return true;
} }
case doHash("onEndermanTake"): {
auto Call = RemoteCall::importAs<bool(Actor * mob)>(eventName, eventId);
eventBus->emplaceListener<GMLIB::Event::EntityEvent::EndermanTakeBlockBeforeEvent>(
[Call](GMLIB::Event::EntityEvent::EndermanTakeBlockBeforeEvent& ev) {
bool result = true;
try {
result = Call(&ev.self());
} catch (...) {}
if (!result) {
ev.cancel();
}
}
);
return true;
}
default: default:
return false; return false;
} }
+1 -1
View File
@@ -4,7 +4,7 @@
#include <RemoteCallAPI.h> #include <RemoteCallAPI.h>
#define PLUGIN_NAME "GMLIB-LRCA" #define PLUGIN_NAME "GMLIB-LRCA"
#define LIB_VERSION GMLIB::Version(0, 10, 1) #define LIB_VERSION GMLIB::Version(0, 12, 0)
extern ll::Logger logger; extern ll::Logger logger;
+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"format_version": 2, "format_version": 2,
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi", "tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
"version": "0.10.1", "version": "0.12.0",
"info": { "info": {
"name": "GMLIB-LegacyRemoteCallApi", "name": "GMLIB-LegacyRemoteCallApi",
"description": "Legacy RemoteCall API for GMLIB", "description": "Legacy RemoteCall API for GMLIB",
@@ -14,9 +14,9 @@
"library" "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.12.0/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
"dependencies": { "dependencies": {
"github.com/GroupMountain/GMLIB": ">=0.10.0" "github.com/GroupMountain/GMLIB": ">=0.12.0"
}, },
"files": { "files": {
"place": [ "place": [