Conflict with Independent Mount Plugin
I wrote a mount plugin, which is a new entity. Players can right-click to ride the entity and operate it normally, including flying. However, when I add a ModelEngine4 model to this entity, the player mounts it but immediately dismounts! How can I resolve this issue?
@Override
public void setModel(Entity entity, String model) {
String[] args = model.split(" ");
ModelBlueprint blueprint = ModelEngineAPI.getBlueprint(args[0]);
if (blueprint != null) {
ModelOptionParser options = ModelOptionParser.parse(1, args);
Location location = entity.getLocation();
BukkitEntity base = new BukkitEntity(entity);
base.getBodyRotationController().setYBodyRot(location.getYaw());
ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(base);
modeledEntity.setBaseEntityVisible(false);
ActiveModel activeModel = ModelEngineAPI.createActiveModel(blueprint);
activeModel.setAutoRendererInitialization(false);
options.applyDisguiseOptions(activeModel);
modeledEntity.addModel(activeModel, true);
activeModel.initializeRenderer();
activeModel.getMountManager().ifPresent((mountManager) -> {
mountManager.setCanRide(true);
mountManager.setCanDrive(true);
modeledEntity.getMountData().setMainMountManager(mountManager);
});
}
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information