fix: fix missing js-lib

This commit is contained in:
Tsubasa6848
2024-02-24 11:14:27 +08:00
Unverified
parent 01ebf91b43
commit ede771a966
2 changed files with 18 additions and 3 deletions
-3
View File
@@ -8,9 +8,7 @@ const PAPIunRegisterPlaceholderAPI = ll.import("BEPlaceholderAPI", "unRegisterPl
const PAPIgetAllPAPI = ll.import("BEPlaceholderAPI", "getAllPAPI")
Function.prototype.getName = function () {
return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]
}
class PAPI {
@@ -19,7 +17,6 @@ class PAPI {
}
static registerPlayerPlaceholder(func, PluginName, PAPIName) {
ll.export(func, PluginName, func.getName())
PAPIregisterPlayerPlaceholderAPI(PluginName, func.getName(), PAPIName)
}
+18
View File
@@ -349,4 +349,22 @@ class Experiments {
}
}
class GMLIB {
constructor() {
throw new Error("Static class cannot be instantiated");
}
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();
}
}
module.exports = { StaticFloatingText, DynamicFloatingText, Minecraft, Recipes, Experiments };