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.

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...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...