Posted November 24, 20222 yr Hi there, Let's say, I've got a BakedModel via this code BlockRenderDispatcher blockRenderer = Minecraft.getInstance().getBlockRenderer(); BakedModel blockModel = blockRenderer.getBlockModel(block); where block is an instance of BlockState. Then I do List<BakedQuad> quads = blockModel.getQuads(...); to get all BakedQuads of this model. While I iterate over them, I want to get a texture file (eg. .txt or .jpg) witch each of this quads use. Is that possible, and, if so, how can I do that? P. S. I see, that BakedQuad has a TextureAtlasSprite inside, witch I can get, but I don't know if that is what I need, and how to get texture file from it. Edited November 29, 20222 yr by Sireous
November 24, 20222 yr Look at TextureAtlas.load() - the private method not the simple one - for how it uses the name in the TextureAtlasSprite(Info) It isn't necessarily a file. All that is required is the resource pack implementation provides an InputStream. See the subclasses of PackResources for all the different ways it creates that InputStream. e.g. zip/jar, files, classpath, the assets subfolder with its index, etc. There are some mods that generate images dynamically so the InputStream could be from bytes in memory. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
November 24, 20222 yr Well, minecraft is obviously able to interpret that stream as 2D image. Am I able to interpret it the same way? And create usual image from that stream.
November 24, 20222 yr At resource pack loading Minecraft stiches those InputStreams into a big image, the TextureAtlas(es). That is what the code I told you to look at does. Your original question was how to get the source file. Which is complicated, if not impossible, since it doesn't necessarily exist. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
November 24, 20222 yr Well, now, when I understand this a bit better, question has changed. I need a way to get this big composite image(s), the TextureAtlas(es) and save as .png or something. Edited November 24, 20222 yr by Sireous
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.