feat: adapt GMLIB 0.8.5
This commit is contained in:
+1
-1
Submodule SDK-GMLIB updated: 0ad5f249ed...58cec5c0c5
@@ -5,6 +5,7 @@ const PAPIregisterServerPlaceholderAPI = ll.import("BEPlaceholderAPI", "register
|
|||||||
const PAPIregisterStaticPlaceholderAPI = ll.import("BEPlaceholderAPI", "registerStaticPlaceholder")
|
const PAPIregisterStaticPlaceholderAPI = ll.import("BEPlaceholderAPI", "registerStaticPlaceholder")
|
||||||
const PAPItranslateStringAPI = ll.import("BEPlaceholderAPI", "translateString")
|
const PAPItranslateStringAPI = ll.import("BEPlaceholderAPI", "translateString")
|
||||||
const PAPIunRegisterPlaceholderAPI = ll.import("BEPlaceholderAPI", "unRegisterPlaceholder")
|
const PAPIunRegisterPlaceholderAPI = ll.import("BEPlaceholderAPI", "unRegisterPlaceholder")
|
||||||
|
const PAPIgetAllPAPI = ll.import("BEPlaceholderAPI", "getAllPAPI")
|
||||||
|
|
||||||
Function.prototype.getName = function () {
|
Function.prototype.getName = function () {
|
||||||
|
|
||||||
@@ -13,7 +14,9 @@ Function.prototype.getName = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PAPI {
|
class PAPI {
|
||||||
constructor() { }
|
constructor() {
|
||||||
|
throw new Error("Static class cannot be instantiated");
|
||||||
|
}
|
||||||
|
|
||||||
static registerPlayerPlaceholder(func, PluginName, PAPIName) {
|
static registerPlayerPlaceholder(func, PluginName, PAPIName) {
|
||||||
|
|
||||||
@@ -47,6 +50,10 @@ class PAPI {
|
|||||||
return PAPIunRegisterPlaceholderAPI(str)
|
return PAPIunRegisterPlaceholderAPI(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getAllPAPI() {
|
||||||
|
return PAPIgetAllPAPI();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -108,13 +108,13 @@ std::string registerStaticPlaceholder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string translateString(std::string const& str, std::string const& xuid) {
|
std::string translateString(std::string const& str, std::string const& xuid) {
|
||||||
std::string _str = str;
|
return GMLIB::Server::PlaceholderAPI::translate(str, ll::service::bedrock::getLevel()->getPlayerByXuid(xuid));
|
||||||
GMLIB::Server::PlaceholderAPI::translateString(_str, ll::service::bedrock::getLevel()->getPlayerByXuid(xuid));
|
|
||||||
return _str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool unRegisterPlaceholder(std::string const& str) { return GMLIB::Server::PlaceholderAPI::unRegisterPlaceholder(str); }
|
bool unRegisterPlaceholder(std::string const& str) { return GMLIB::Server::PlaceholderAPI::unRegisterPlaceholder(str); }
|
||||||
|
|
||||||
|
std::vector<std::string> getAllPAPI() { return GMLIB::Server::PlaceholderAPI::getAllPAPI(); }
|
||||||
|
|
||||||
} // namespace PAPIRemoteCall
|
} // namespace PAPIRemoteCall
|
||||||
|
|
||||||
#define EXPORTAPI(T) \
|
#define EXPORTAPI(T) \
|
||||||
@@ -128,4 +128,5 @@ void ExportPAPI() {
|
|||||||
EXPORTAPI(PAPIRemoteCall::GetValueWithPlayer);
|
EXPORTAPI(PAPIRemoteCall::GetValueWithPlayer);
|
||||||
EXPORTAPI(PAPIRemoteCall::translateString);
|
EXPORTAPI(PAPIRemoteCall::translateString);
|
||||||
EXPORTAPI(PAPIRemoteCall::unRegisterPlaceholder);
|
EXPORTAPI(PAPIRemoteCall::unRegisterPlaceholder);
|
||||||
|
EXPORTAPI(PAPIRemoteCall::getAllPAPI);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user