feat: add playerWillDestroy,attack,pullInEntity

This commit is contained in:
子沐呀
2024-05-31 18:41:49 +08:00
Unverified
parent 28be308aba
commit 0872c064bb
2 changed files with 26 additions and 1 deletions
+10
View File
@@ -658,4 +658,14 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "blockIsAlwaysDestroyable", [](Block const* block) -> bool {
return block->getMaterial().isAlwaysDestroyable();
});
RemoteCall::exportAs(
"GMLIB_API",
"blockPlayerWillDestroy",
[](Block const* block, Player* player, std::pair<BlockPos, int> pos) -> bool {
return block->playerWillDestroy(*player, pos.first);
}
);
RemoteCall::exportAs("GMLIB_API", "playerAttack", [](Player* player, Actor* entity) -> bool {
return player->attack(*entity, ActorDamageCause::EntityAttack);
});
}