添加/修改

- 添加entityHasFamily,getPlayerDestroyBlockProgress接口
- 修改6事件名
This commit is contained in:
子沐呀
2024-08-01 18:56:03 +08:00
Unverified
parent a01ba9655d
commit b72c4564bc
5 changed files with 58 additions and 14 deletions
+8
View File
@@ -1,4 +1,6 @@
#include "Global.h"
#include "magic_enum.hpp"
#include "mc/deps/core/string/HashedString.h"
#include <regex>
bool isInteger(const std::string& str) {
@@ -884,4 +886,10 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "getItemMaxCount", [](ItemStack const* item) -> int {
return item->getMaxStackSize();
});
RemoteCall::exportAs("GMLIB_API", "entityHasFamily", [](Actor* entity, std::string const& family) -> bool {
return entity->hasFamily(HashedString(family));
});
RemoteCall::exportAs("GMLIB_API", "getPlayerDestroyBlockProgress", [](Player* player, Block const* block) -> float {
return player->getDestroyProgress(*block);
});
}