fix: fix version logic
This commit is contained in:
+8
-18
@@ -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"),
|
||||
@@ -502,28 +499,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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +870,6 @@ module.exports = {
|
||||
Minecraft,
|
||||
Recipes,
|
||||
Experiments,
|
||||
GMLIB,
|
||||
Scoreboard,
|
||||
JsonConfig,
|
||||
JsonLanguage,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "${pluginName}",
|
||||
"entry": "${pluginFile}",
|
||||
"version": "0.12.4",
|
||||
"version": "0.12.5",
|
||||
"author": "GroupMountain",
|
||||
"type": "native",
|
||||
"dependencies": [
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+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, 4)
|
||||
#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.4",
|
||||
"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.4/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