1新增 2修复
- 新增getEntityOwnerUniqueId接口 - 修复注册PAPI变量无法使用匿名函数 - 修复注册相同PAPI名字无法重载
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#include "Global.h"
|
||||
#include "magic_enum.hpp"
|
||||
#include "mc/entity/systems/common/ServerCameraStateSystem.h"
|
||||
#include "mc/enums/AbilitiesIndex.h"
|
||||
#include "mc/scripting/modules/minecraft/ScriptCameraSetLocationOptions.h"
|
||||
#include "mc/world/actor/common/CameraInstruction.h"
|
||||
#include <regex>
|
||||
#include <vector>
|
||||
|
||||
@@ -843,4 +847,5 @@ void Export_Compatibility_API() {
|
||||
RemoteCall::exportAs("GMLIB_API", "getPlayerArmorValue", [](Player* player) -> int {
|
||||
return player->getArmorValue();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getEntityOwnerUniqueId", [](Actor* entity) -> int64 { return entity->getOwnerId().id; });
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "GMLIB/Server/PlaceholderAPI.h"
|
||||
#include "Global.h"
|
||||
#include <regex>
|
||||
|
||||
@@ -25,6 +26,7 @@ bool registerPlayerPlaceholder(
|
||||
std::string const& PAPIName
|
||||
) {
|
||||
if (RemoteCall::hasFunc(PluginName, FuncName)) {
|
||||
PlaceholderAPI::unregisterPlaceholder(PAPIName);
|
||||
if (isParameters(PAPIName)) {
|
||||
auto Call = RemoteCall::importAs<std::string(Player * pl, std::unordered_map<std::string, std::string>)>(
|
||||
PluginName,
|
||||
@@ -54,6 +56,7 @@ bool registerServerPlaceholder(
|
||||
std::string const& PAPIName
|
||||
) {
|
||||
if (RemoteCall::hasFunc(PluginName, FuncName)) {
|
||||
PlaceholderAPI::unregisterPlaceholder(PAPIName);
|
||||
if (isParameters(PAPIName)) {
|
||||
auto Call =
|
||||
RemoteCall::importAs<std::string(std::unordered_map<std::string, std::string>)>(PluginName, FuncName);
|
||||
@@ -78,6 +81,7 @@ bool registerStaticPlaceholder(
|
||||
int num
|
||||
) {
|
||||
if (RemoteCall::hasFunc(PluginName, FuncName)) {
|
||||
PlaceholderAPI::unregisterPlaceholder(PAPIName);
|
||||
if (isParameters(PAPIName)) {
|
||||
auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName);
|
||||
if (num == -1) {
|
||||
|
||||
Reference in New Issue
Block a user