Jump to content

[1.8] Using Resource Location Outside of Normal Minecraft Domain


Recommended Posts

Posted

Hello,

 

I am trying to have my armor get its texture from a location outside of the normal Minecraft domain, but I have not found a way to accomplish this.

 

I have tried to override the getArmorTexture method using the following code:

 

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) 
{
	location = new ResourceLocation("<modding folder>", "<texture folder inside modding folder>/texture.png");
	return location.toString();
}

 

However, I get the following error:

 

java.io.FileNotFoundException: <modding folder>:<texture folder inside modding folder>/texture.png

 

Is it possible to accomplish this task using this method? Or possibly through another method?

Thanks in advance!

 

 

Posted

Why are you accessing something inside the mod folder?

You should use your normal resource settings and use your assets folder there.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I want my mod to allow players to add their own textures for my mod armor, in addition to the textures I already have. I know how to change between my textures in the domain, but I do not know how to allow users to add their own textures that I can access inside of the normal Minecraft domain, which is why I want to try to find a way to access them outside of the domain.

Posted

Create a resource pack based off the folder, add it to the default texture pack lists, parse your target folder for file names so you can convert them to resource locations and feed them to the resource manager.

 

I'd suggest creating an IResourcePack that uses unique key for the domain so that there aren't any conflicts pulling textures from your original assets. That is unless you want the capability to overwrite the original textures you or a resource pack has supplied

 

 

I think its my java of the variables.

Posted

Isnt that just possible with a normal regular resourcepack? You can 'override' any texture inside the resourcefolder with a resourcepack as long as you use the ResourceLocation object for binding the texture. The only thing people need to do is holding on to the same datastructure you have used inside your resourcefolder. No need to do crazy things

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

I want my mod to allow players to add their own textures for my mod armor, in addition to the textures I already have.

In addition, not replacing the existing textures. Hence the need to get crafty.

I think its my java of the variables.

Posted
Create a resource pack based off the folder, add it to the default texture pack lists, parse your target folder for file names so you can convert them to resource locations and feed them to the resource manager.

 

I'd suggest creating an IResourcePack that uses unique key for the domain so that there aren't any conflicts pulling textures from your original assets. That is unless you want the capability to overwrite the original textures you or a resource pack has supplied

 

You seem confident with this method. I will give it a shot! I have not used resource packs before, so this should be fun. :)

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.