feat: add interface related to entity type

This commit is contained in:
子沐呀
2024-12-17 22:13:46 +08:00
Unverified
parent cf8076a9fc
commit 6e57f87129
3 changed files with 448 additions and 70 deletions
+9
View File
@@ -878,4 +878,13 @@ void Export_Compatibility_API() {
GMLIB::Mod::CustomRecipe::registerShapedCraftingTableRecipe(recipe_id, shape, types, *result);
}
);
RemoteCall::exportAs("GMLIB_API", "entityIsType", [](Actor* entity, int type) -> bool {
return entity->isType((ActorType)type);
});
RemoteCall::exportAs("GMLIB_API", "entityHasType", [](Actor* entity, int type) -> bool {
return entity->hasType((ActorType)type);
});
RemoteCall::exportAs("GMLIB_API", "getEntityTypeId", [](Actor* entity) -> int {
return (int)entity->getEntityTypeId();
});
}