Modular Machinery: Community Edition

Modular Machinery: Community Edition

239k Downloads

Cannot install a GeckoLib model via a ControllerModelGetEvent.

TheTzdDark opened this issue ยท 5 comments

commented

When I install another model via event.modelName = "name", the model does not change.

Most likely, the problem is that this condition is incorrect, it cannot be fulfilled with the correct model name:

commented

Is the model registered?

commented

Is the model registered?

Yes, all the models I used were pre-registered via "GeoMachineModel.registerGeoMachineModel".

commented

It still seems to me that this condition, which I noted above, should look something like this:
modelName != null && !modelName.isEmpty()

After all, it is not logical to try to get a model by an empty name or a null one.

commented

public String getCurrentModelName() {
ControllerModelGetEvent event = new ControllerModelGetEvent(this);
event.postEvent();
return event.getModelName();
}

The machine will first get the model via an event... It only goes back to get the default model if it returns an empty name.

commented

holy shit... it will be fixed in pre6.