Compare commits
4 Commits
@@ -9,10 +9,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: xmake-io/github-action-setup-xmake@v1
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: xmake-io/github-action-setup-xmake@v1
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "SDK-GMLIB"]
|
||||
path = SDK-GMLIB
|
||||
url = https://github.com/GroupMountain/SDK-GMLIB.git
|
||||
-1
Submodule SDK-GMLIB deleted from 710cc6e4c3
+38
-1
@@ -110,7 +110,12 @@ const GMLIB_API = {
|
||||
addFakeList: ll.import("GMLIB_API", "addFakeList"),
|
||||
removeFakeList: ll.import("GMLIB_API", "removeFakeList"),
|
||||
removeAllFakeLists: ll.import("GMLIB_API", "removeAllFakeList"),
|
||||
setFixI18nEnabled: ll.import("GMLib_ModAPI", "setFixI18nEnabled")
|
||||
setFixI18nEnabled: ll.import("GMLib_ModAPI", "setFixI18nEnabled"),
|
||||
getBlockTranslateKey: ll.import("GMLIB_API", "getBlockTranslateKey"),
|
||||
getItemTranslateKey: ll.import("GMLIB_API", "getItemTranslateKey"),
|
||||
getEntityTranslateKey: ll.import("GMLIB_API", "getEntityTranslateKey"),
|
||||
readNbtFromFile: ll.import("GMLIB_API", "readNbtFromFile"),
|
||||
saveNbtToFile: ll.import("GMLIB_API", "saveNbtToFile")
|
||||
}
|
||||
|
||||
const FloatingTextList = [];
|
||||
@@ -427,6 +432,14 @@ class Minecraft {
|
||||
static setFixI18nEnabled() {
|
||||
GMLIB_API.setFixI18nEnabled();
|
||||
}
|
||||
|
||||
static saveNbtToFile(path, nbt, isBinary = true) {
|
||||
return GMLIB_API.saveNbtToFile(path, nbt, isBinary);
|
||||
}
|
||||
|
||||
static readNbtFromFile(path, isBinary = true) {
|
||||
return GMLIB_API.readNbtFromFile(path, isBinary);
|
||||
}
|
||||
}
|
||||
|
||||
class Recipes {
|
||||
@@ -926,6 +939,30 @@ LLSE_Entity.prototype.throwEntity = function (proj, speed = 2, offset = 3) {
|
||||
return GMLIB_API.throwEntity(this, proj, speed, offset);
|
||||
}
|
||||
|
||||
LLSE_Entity.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getEntityTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Entity.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
LLSE_Block.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getBlockTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Block.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getItemTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
StaticFloatingText,
|
||||
DynamicFloatingText,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "${pluginName}",
|
||||
"entry": "${pluginFile}",
|
||||
"version": "0.12.6",
|
||||
"version": "0.12.7",
|
||||
"author": "GroupMountain",
|
||||
"type": "native",
|
||||
"dependencies": [
|
||||
|
||||
@@ -198,7 +198,8 @@ void Export_Compatibility_API() {
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"updateOrCreateLanguageFile",
|
||||
[](std::string const& code, std::string const& lang, std::string const& path) -> void {
|
||||
[](std::string const& code, std::unordered_map<std::string, std::string> lang, std::string const& path
|
||||
) -> void {
|
||||
if (GMLIB_Level::getInstance()) {
|
||||
I18nAPI::updateOrCreateLanguageFile(path, code, lang);
|
||||
}
|
||||
@@ -603,4 +604,30 @@ void Export_Compatibility_API() {
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getBlockTranslateKey", [](Block const* block) -> std::string {
|
||||
return block->buildDescriptionId();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getItemTranslateKey", [](ItemStack* item) -> std::string {
|
||||
return item->getDescriptionId();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getEntityTranslateKey", [](Actor* entity) -> std::string {
|
||||
return entity->getEntityLocNameString();
|
||||
});
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"readNbtFromFile",
|
||||
[](std::string const& path, bool isBinary) -> std::unique_ptr<CompoundTag> {
|
||||
if (auto nbt = GMLIB_CompoundTag::readFromFile(path, isBinary)) {
|
||||
return std::make_unique<CompoundTag>(nbt.value());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
);
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"saveNbtToFile",
|
||||
[](std::string const& path, CompoundTag* nbt, bool isBinary) -> bool {
|
||||
return GMLIB_CompoundTag::saveToFile(path, *nbt, isBinary);
|
||||
}
|
||||
);
|
||||
}
|
||||
+9
-9
@@ -3,14 +3,14 @@
|
||||
|
||||
ll::Logger logger(PLUGIN_NAME);
|
||||
|
||||
namespace GMLIB_LegacyRemoteCallApi {
|
||||
namespace GMLIB {
|
||||
|
||||
std::unique_ptr<LRCA>& LRCA::getInstance() {
|
||||
static std::unique_ptr<LRCA> instance;
|
||||
std::unique_ptr<LegacyRemoteCallApi>& LegacyRemoteCallApi::getInstance() {
|
||||
static std::unique_ptr<LegacyRemoteCallApi> instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
bool LRCA::load() {
|
||||
bool LegacyRemoteCallApi::load() {
|
||||
Export_Legacy_GMLib_ModAPI();
|
||||
Export_Legacy_GMLib_ServerAPI();
|
||||
Export_Compatibility_API();
|
||||
@@ -20,17 +20,17 @@ bool LRCA::load() {
|
||||
logger.info(
|
||||
"Loaded Version: {} with {}",
|
||||
fmt::format(fg(fmt::color::pink), "GMLIB-" + GMLIB::Version::getLibVersionString()),
|
||||
fmt::format(fg(fmt::color::light_green), "GMLIB-LegacyRemoteCallApi-"+LIB_VERSION.asString())
|
||||
fmt::format(fg(fmt::color::light_green), "GMLIB-LegacyRemoteCallApi-" + LIB_VERSION.asString())
|
||||
);
|
||||
logger.info("Author: GroupMountain");
|
||||
logger.info("Repository: https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LRCA::enable() { return true; }
|
||||
bool LegacyRemoteCallApi::enable() { return true; }
|
||||
|
||||
bool LRCA::disable() { return true; }
|
||||
bool LegacyRemoteCallApi::disable() { return true; }
|
||||
|
||||
} // namespace GMLIB_LegacyRemoteCallApi
|
||||
} // namespace GMLIB
|
||||
|
||||
LL_REGISTER_PLUGIN(GMLIB_LegacyRemoteCallApi::LRCA, GMLIB_LegacyRemoteCallApi::LRCA::getInstance());
|
||||
LL_REGISTER_PLUGIN(GMLIB::LegacyRemoteCallApi, GMLIB::LegacyRemoteCallApi::getInstance());
|
||||
|
||||
+5
-5
@@ -2,14 +2,14 @@
|
||||
#include <ll/api/plugin/NativePlugin.h>
|
||||
#include <ll/api/plugin/RegisterHelper.h>
|
||||
|
||||
namespace GMLIB_LegacyRemoteCallApi {
|
||||
namespace GMLIB {
|
||||
|
||||
class LRCA {
|
||||
class LegacyRemoteCallApi {
|
||||
|
||||
public:
|
||||
static std::unique_ptr<LRCA>& getInstance();
|
||||
static std::unique_ptr<LegacyRemoteCallApi>& getInstance();
|
||||
|
||||
LRCA(ll::plugin::NativePlugin& self) : mSelf(self) {}
|
||||
LegacyRemoteCallApi(ll::plugin::NativePlugin& self) : mSelf(self) {}
|
||||
|
||||
[[nodiscard]] ll::plugin::NativePlugin& getSelf() const { return mSelf; }
|
||||
|
||||
@@ -30,4 +30,4 @@ private:
|
||||
ll::plugin::NativePlugin& mSelf;
|
||||
};
|
||||
|
||||
} // namespace GMLIB_LegacyRemoteCallApi
|
||||
} // namespace GMLIB
|
||||
|
||||
+5
-1
@@ -5,7 +5,11 @@
|
||||
|
||||
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
||||
|
||||
#define LIB_VERSION GMLIB::Version(0, 12, 6)
|
||||
#define LIB_VERSION_MAJOR 0
|
||||
#define LIB_VERSION_MINOR 12
|
||||
#define LIB_VERSION_PATCH 7
|
||||
|
||||
#define LIB_VERSION GMLIB::Version(LIB_VERSION_MAJOR, LIB_VERSION_MINOR, LIB_VERSION_PATCH)
|
||||
|
||||
extern ll::Logger logger;
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"format_version": 2,
|
||||
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
|
||||
"version": "0.12.6",
|
||||
"version": "0.12.7",
|
||||
"info": {
|
||||
"name": "GMLIB-LegacyRemoteCallApi",
|
||||
"description": "Legacy RemoteCall API for GMLIB",
|
||||
@@ -14,9 +14,9 @@
|
||||
"library"
|
||||
]
|
||||
},
|
||||
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.12.6/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.12.7/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"dependencies": {
|
||||
"github.com/GroupMountain/GMLIB": ">=0.12.4"
|
||||
"github.com/GroupMountain/GMLIB": ">=0.12.7"
|
||||
},
|
||||
"files": {
|
||||
"place": [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
|
||||
add_repositories("groupmountain-repo https://github.com/GroupMountain/xmake-repo.git")
|
||||
|
||||
if not has_config("vs_runtime") then
|
||||
set_runtimes("MD")
|
||||
@@ -9,6 +10,7 @@ end
|
||||
-- Option 1: Use the latest version of LeviLamina released on GitHub.
|
||||
add_requires("levilamina")
|
||||
add_requires("legacyremotecall")
|
||||
add_requires("gmlib")
|
||||
|
||||
-- Option 2: Use a specific version of LeviLamina released on GitHub.
|
||||
-- add_requires("levilamina x.x.x")
|
||||
@@ -53,16 +55,13 @@ target("GMLIB-LegacyRemoteCallApi") -- Change this to your plugin name.
|
||||
add_files(
|
||||
"src/**.cpp"
|
||||
)
|
||||
add_links(
|
||||
"SDK-GMLIB/Lib/GMLIB"
|
||||
)
|
||||
add_includedirs(
|
||||
"SDK-GMLIB",
|
||||
"src"
|
||||
)
|
||||
add_packages(
|
||||
"levilamina",
|
||||
"legacyremotecall"
|
||||
"legacyremotecall",
|
||||
"gmlib"
|
||||
)
|
||||
add_shflags(
|
||||
"/DELAYLOAD:bedrock_server.dll" -- Magic to import symbols from BDS
|
||||
|
||||
Reference in New Issue
Block a user