Jump to content

Recommended Posts

Posted

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.

Posted

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?

Posted

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. 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.