Posted July 25, 201510 yr Hi ! I have implemented an IModel to render a custom ore block with different stone backgrounds and an overlay. I have two questions : - If the bake() method is called for all the instances of my custom ores (I have checked with a logger), does that mean there model are correctly registered or not necessarily ? Because in game, all the different ores have no textures (purple and black cube) - What should I return at the end of this method ? A Wrapper (default implementation of IFlexibleModel) ? Because I can't return a IBakedModel In my opinion, the problem is inside the bake method , but even with the minimum, it doesn't works : public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { ModelResourceLocation stoneModelLocation = new ModelResourceLocation("minecraft:stone", null); IModel stoneModel = ModelLoaderRegistry.getModel(stoneModelLocation); IBakedModel stoneBakedModel = stoneModel.bake(stoneModel.getDefaultState(), format, bakedTextureGetter); return new Wrapper(stoneBakedModel, format); }
July 25, 201510 yr Author Also if someone could explain to me how what is a TextureAtlasSprite and how the Function<ResourceLocation, TextureAtlasSprite> textureGetter (one of the bake method argument) works. textureGetter.apply(stoneModelLocation); should return my stone texture right ?
July 25, 201510 yr Author I don't understand, with the following code, it says the texture is missing : public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { ModelResourceLocation stoneModelLocation = new ModelResourceLocation("minecraft:stone", null); IModel stoneModel = ModelLoaderRegistry.getModel(stoneModelLocation); IBakedModel stoneBakedModel = stoneModel.bake(stoneModel.getDefaultState(), format, bakedTextureGetter); Logger.info(stoneBakedModel.getTexture().getIconName()); } I think I have to do something with the texture getter, but I don't even know how it works.
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.