Jump to content

Recommended Posts

Posted

I am confused about creating new textures. None of the videos and tutorials are that clear. Should I create one file with all of my textures? Or should I create a file for each texture? What are the downsides for each option?

Posted

The Forge way is one file for all the textures. One texture per file was the old modloader way, and it may be the correct way again in the future, but not now.

None of the tutorials seem to make it clear how to chose which part of the file is the texture for the block that you want to have that texture. Where do you chose the texture index for each block?

Posted

They sort of do tell you, but I'll reiterate.

  1. On the client side, somewhere in your initialization logic, you need to call

    MinecraftForgeClient.preloadTexture("/your/texture/file.png");
    
    
  2. In you block file make sure that you have this override.


@Override

public String getTextureFile() {

    return "/your/texture/file.png";

}
Finally, when you instantiate your block (instantiate means to call the constructor), make sure to set the texture parameter to the index of the texture you want in your texture file, starting from 0.

If you want your block to have more complicated textures, instead of doing step 3, you will instead override the various getBlockTexture* methods to return the correct index in the file based on conditions like side and metadata.

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...