Posted September 26, 20205 yr Hello! I'm trying to get all files from one asset. For example I have a asset like this: "textures/gui/.." and I want to have all files from this asset in a List. I don't know if it's enough to describe what I need, but I hope You can get the point.
September 26, 20205 yr Author Thank you! I found it, however, I have problems with what to pass in to the pathIn parameter as most of the times it won't return anything for me. I've looked at some vanilla usages but after some tries, I came up empty handed.. Can you explain it for me, if you don't mind?
September 26, 20205 yr Author I actually looked at the FontResourceManager class to get some ideas on what to pass in, then when I tried it myself I did not get anything at all. I was expecting to get a few json files from the vanilla font directory, but seems it works differently. Anyway that is the exact code I tried last time: public static void test(){ FallbackResourceManager r = new FallbackResourceManager(ResourcePackType.CLIENT_RESOURCES); Collection<ResourceLocation> res = r.getAllResourceLocations("font", (t) -> {return t.toLowerCase().endsWith(".json");}); Logger.getLogger("Log").info(String.valueOf(res.size())); for(ResourceLocation resource : res) { Logger.getLogger("Log").info(resource.getPath()); } } In the meantime I'm also trying to figure out the implementation.
September 26, 20205 yr Author Oh thank you! works just as I expected now with Minecraft's ResourceManager.
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.