From ede771a9661bf9449475588c7759a21307a3da6e Mon Sep 17 00:00:00 2001 From: Tsubasa6848 <116721335+Tsubasa6848@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:14:27 +0800 Subject: [PATCH] fix: fix missing js-lib --- lib/BEPlaceholderAPI-JS.js | 3 --- lib/GMLIB_API-JS.js | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/BEPlaceholderAPI-JS.js b/lib/BEPlaceholderAPI-JS.js index afcc3af..91814db 100644 --- a/lib/BEPlaceholderAPI-JS.js +++ b/lib/BEPlaceholderAPI-JS.js @@ -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) } diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index d97fc34..9099037 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -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 }; \ No newline at end of file