9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 12:29:15 +00:00

improve MEG compatibility

This commit is contained in:
XiaoMoMi
2025-04-01 04:12:21 +08:00
parent 8ecc78b28a
commit cf53e4b243
3 changed files with 26 additions and 1 deletions

View File

@@ -12,4 +12,16 @@ public class ModelEngineUtils {
ActiveModel activeModel = ModelEngineAPI.createActiveModel(id);
modeledEntity.addModel(activeModel, true);
}
public static int interactionToBaseEntity(int entityId) {
ActiveModel activeModel = ModelEngineAPI.getInteractionTracker().getModelRelay(entityId);
if (activeModel != null) {
ModeledEntity modeledEntity = activeModel.getModeledEntity();
if (modeledEntity == null) {
return entityId;
}
return modeledEntity.getBase().getEntityId();
}
return entityId;
}
}