Posted May 8, 20205 yr I'm updating a few multipart blocks that use the texture of the blocks they where crafted with, but have gotten stuck on how to retexture the models. While the sub models are combining and rendering correctly (minus textures) I figure listing what I've done may help. Switched from IModelLoader to IModelLoader, and redirected the json files. Had to switch to IModelGeometry from IUnbakedModel, and with the loss of getDependencies the extra models are now loaded via ModelLoader.addSpecialModel during FMLClientSetupEvent. I'm still using a IBakedModel just called from IModelGeometry.bake now. In the getQuads method I'm pulling the a list of submodels and textures from the IModelData (which is set in the tileentity) The needed submodels are looped over getting each IUnbakedModel via ModelLoader.instance().getModelOrMissing (was using ModelLoaderRegistry.getModel before) At this point I retextured the model via IModel.retexture then baked the submodel, but currently am only baking the model. Finally adding all the quads and returning the list The only thing I haven't found the replacement for is retexture. I have the model's resource location, and a Map of keys(string) and textures(resource location in string form) Edit: I have a working solution, don't believe its the best one, but its something for now. Just created a wrapper around BlockModel that overrides resolveTextureName. Edited May 8, 20205 yr by ShetiPhian Added info
July 6, 20205 yr Author Ran into this issue again, The wrapper works perfectly with json models, but it doesn't work on obj models. Is there a way to retexture an obj model that I'm just not seeing? Ignore; for anyone wondering, I forgot to add the # in front of the texture name in the mtl file. Edited July 6, 20205 yr by ShetiPhian
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.