NovaEngineering-Source / ModularMachinery-Community-Edition

Customize your machinery with more powerful features.
https://www.curseforge.com/minecraft/mc-mods/modularmachinery-community-edition
GNU General Public License v3.0
28 stars 12 forks source link

Cannot install a GeckoLib model via a ControllerModelGetEvent. #92

Closed TheTzdDark closed 1 month ago

TheTzdDark commented 1 month ago

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: https://github.com/NovaEngineering-Source/ModularMachinery-Community-Edition/blob/946b21708ff4de24e93c4488beca34e3e1f8518a/src/main/java/hellfirepvp/modularmachinery/common/tiles/base/TileMultiblockMachineController.java#L1318

KasumiNova commented 1 month ago

Is the model registered?

TheTzdDark commented 1 month ago

Is the model registered?

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

TheTzdDark commented 1 month ago

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.

KasumiNova commented 1 month ago

https://github.com/NovaEngineering-Source/ModularMachinery-Community-Edition/blob/946b21708ff4de24e93c4488beca34e3e1f8518a/src/main/java/hellfirepvp/modularmachinery/common/tiles/base/TileMultiblockMachineController.java#L1329-L1333 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.

KasumiNova commented 1 month ago

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