Compare commits
3 Commits
+18
-34
@@ -1,6 +1,3 @@
|
||||
// LiteLoader-AIDS automatic generated
|
||||
/// <reference path="D:\LiteLoader\VSCode/dts/HelperLib-master/src/index.d.ts"/>
|
||||
|
||||
const GMLIB_API = {
|
||||
createFloatingText: ll.import("GMLIB_API", "createFloatingText"),
|
||||
deleteFloatingText: ll.import("GMLIB_API", "deleteFloatingText"),
|
||||
@@ -19,6 +16,7 @@ const GMLIB_API = {
|
||||
setPlayerNbt: ll.import("GMLIB_API", "setPlayerNbt"),
|
||||
setPlayerNbtTags: ll.import("GMLIB_API", "setPlayerNbtTags"),
|
||||
resourcePackTranslate: ll.import("GMLIB_API", "resourcePackTranslate"),
|
||||
resourcePackDefaultTranslate: ll.import("GMLIB_API", "resourcePackDefaultTranslate"),
|
||||
getResourcePackI18nLanguage: ll.import("GMLIB_API", "getResourcePackI18nLanguage"),
|
||||
chooseResourcePackI18nLanguage: ll.import("GMLIB_API", "chooseResourcePackI18nLanguage"),
|
||||
setEducationFeatureEnabled: ll.import("GMLib_ServerAPI", "setEducationFeatureEnabled"),
|
||||
@@ -35,7 +33,7 @@ const GMLIB_API = {
|
||||
PlayerToEntity: ll.import("GMLib_ServerAPI", "PlayerToEntity"),
|
||||
setUnknownBlockCleaner: ll.import("GMLib_ModAPI", "setUnknownBlockCleaner"),
|
||||
getAllExperiments: ll.import("GMLIB_API", "getAllExperiments"),
|
||||
getExperimentTranslatedName: ll.import("GMLIB_API", "getExperimentTranslatedName"),
|
||||
getExperimentTranslateKey: ll.import("GMLIB_API", "getExperimentTranslateKey"),
|
||||
getExperimentEnabled: ll.import("GMLib_ModAPI", "getExperimentEnabled"),
|
||||
setExperimentEnabled: ll.import("GMLib_ModAPI", "setExperimentEnabled"),
|
||||
unregisterRecipe: ll.import("GMLIB_API", "unregisterRecipe"),
|
||||
@@ -434,18 +432,8 @@ class Experiments {
|
||||
return GMLIB_API.getAllExperiments();
|
||||
}
|
||||
|
||||
static getExperimentTranslatedName(id) {
|
||||
return GMLIB_API.getExperimentTranslatedName(id);
|
||||
}
|
||||
|
||||
static getExperimentsMap() {
|
||||
let ids = this.getAllExperimentIds();
|
||||
let result = {};
|
||||
for (let id in ids) {
|
||||
let name = this.getExperimentTranslatedName(id);
|
||||
result[id] = name;
|
||||
}
|
||||
return result;
|
||||
static getExperimentTranslateKey(id) {
|
||||
return GMLIB_API.getExperimentTranslateKey(id);
|
||||
}
|
||||
|
||||
static getExperimentEnabled(id) {
|
||||
@@ -501,28 +489,22 @@ class Version {
|
||||
if (Array.isArray(array) && array.length == 3) {
|
||||
let isNumber = array.every(element => typeof element == "number");
|
||||
if (isNumber) {
|
||||
return new Version(array[0], array[1], array[2])
|
||||
return new Version(array[0], array[1], array[2]);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static isPluginVersionMatched(version) {
|
||||
return GMLIB_API.isVersionMatched(version.mMajor, version.mMinor, version.mPatch);
|
||||
}
|
||||
|
||||
class GMLIB {
|
||||
constructor() {
|
||||
throw new Error("Static class cannot be instantiated");
|
||||
static getLrcaVersion() {
|
||||
return Version.fromString(GMLIB_API.getVersion_LRCA());
|
||||
}
|
||||
|
||||
static isVersionMatched(major, minor, patch) {
|
||||
return GMLIB_API.isVersionMatched(major, minor, patch);
|
||||
}
|
||||
|
||||
static getVersion_LRCA() {
|
||||
return GMLIB_API.getVersion_LRCA();
|
||||
}
|
||||
|
||||
static getVersion_GMLIB() {
|
||||
return GMLIB_API.getVersion_GMLIB();
|
||||
static getGmlibVersion() {
|
||||
return Version.fromString(GMLIB_API.getVersion_GMLIB());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -812,8 +794,11 @@ class I18nAPI {
|
||||
throw new Error("Static class cannot be instantiated");
|
||||
}
|
||||
|
||||
static get(key, params = []) {
|
||||
GMLIB_API.resourcePackTranslate(key, params);
|
||||
static get(key, params = [], langCode = undefined) {
|
||||
if (langCode) {
|
||||
return GMLIB_API.resourcePackTranslate(key, params, langCode);
|
||||
}
|
||||
return GMLIB_API.resourcePackDefaultTranslate(key, params);
|
||||
}
|
||||
|
||||
static translate(key, params = []) {
|
||||
@@ -840,7 +825,7 @@ class I18nAPI {
|
||||
GMLIB_API.updateOrCreateLanguageFile(code, lang, path);
|
||||
}
|
||||
|
||||
static loadLanguagePath(path) {
|
||||
static loadLanguageDirectory(path) {
|
||||
GMLIB_API.loadLanguagePath(path);
|
||||
}
|
||||
};
|
||||
@@ -875,7 +860,6 @@ module.exports = {
|
||||
Minecraft,
|
||||
Recipes,
|
||||
Experiments,
|
||||
GMLIB,
|
||||
Scoreboard,
|
||||
JsonConfig,
|
||||
JsonLanguage,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "${pluginName}",
|
||||
"entry": "${pluginFile}",
|
||||
"version": "0.12.3",
|
||||
"version": "0.12.5",
|
||||
"author": "GroupMountain",
|
||||
"type": "native",
|
||||
"dependencies": [
|
||||
|
||||
@@ -77,12 +77,12 @@ void Export_Compatibility_API() {
|
||||
}
|
||||
return result;
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getExperimentTranslatedName", [](int id) -> std::string {
|
||||
auto map = GMLIB_Level::getAllExperimentsTranslateKeys();
|
||||
if (map.count(id)) {
|
||||
return std::string(map[id]);
|
||||
}
|
||||
return "";
|
||||
RemoteCall::exportAs("GMLIB_API", "getExperimentTranslateKey", [](int id) -> std::string {
|
||||
std::string result;
|
||||
try {
|
||||
result = Experiments::getExperimentTextID(AllExperiments(id));
|
||||
} catch (...) {}
|
||||
return result;
|
||||
});
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
@@ -153,7 +153,7 @@ void Export_Compatibility_API() {
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "isVersionMatched", [](int a, int b, int c) -> bool {
|
||||
auto version = GMLIB::Version(a, b, c, "", "");
|
||||
return version >= LIB_VERSION;
|
||||
return LIB_VERSION >= version;
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getVersion_LRCA", []() -> std::string { return LIB_VERSION.asString(); });
|
||||
RemoteCall::exportAs("GMLIB_API", "getVersion_GMLIB", []() -> std::string {
|
||||
@@ -161,9 +161,16 @@ void Export_Compatibility_API() {
|
||||
});
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"resourcePackTranslate",
|
||||
"resourcePackDefaultTranslate",
|
||||
[](std::string key, std::vector<std::string> params) -> std::string { return I18nAPI::get(key, params); }
|
||||
);
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"resourcePackTranslate",
|
||||
[](std::string key, std::vector<std::string> params, std::string code) -> std::string {
|
||||
return I18nAPI::get(key, params, code);
|
||||
}
|
||||
);
|
||||
RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string code) -> void {
|
||||
if (GMLIB_Level::getInstance()) {
|
||||
I18nAPI::chooseLanguage(code);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
||||
|
||||
#define LIB_VERSION GMLIB::Version(0, 12, 3)
|
||||
#define LIB_VERSION GMLIB::Version(0, 12, 5)
|
||||
|
||||
extern ll::Logger logger;
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"format_version": 2,
|
||||
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
|
||||
"version": "0.12.3",
|
||||
"version": "0.12.5",
|
||||
"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.12.3/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.12.5/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"dependencies": {
|
||||
"github.com/GroupMountain/GMLIB": ">=0.12.4"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user