Jump to content

Register New Block Texture Without Registering A New Block


LRFLEW

Recommended Posts

I want to update a forge mod I made to work with MC 1.5+, but I'm having trouble with the new texture system.  My mod changes how a vanilla block is rendered on the client (in this case, it changes the standard rail blocks).  I used to be able to just register a multi-texture file in the mod initializer method and set the block's render id and texture file to my own.  All the tutorials I've seen for MC 1.5+ are added in the block class.  I really don't want to override the vanilla class for this mod as it complicates the installation process.  Is there a way to register a texture file outside of a block class?

Link to comment
Share on other sites

I want to update a forge mod I made to work with MC 1.5+, but I'm having trouble with the new texture system.  My mod changes how a vanilla block is rendered on the client (in this case, it changes the standard rail blocks).  I used to be able to just register a multi-texture file in the mod initializer method and set the block's render id and texture file to my own.  All the tutorials I've seen for MC 1.5+ are added in the block class.  I really don't want to override the vanilla class for this mod as it complicates the installation process.  Is there a way to register a texture file outside of a block class?

Link to comment
Share on other sites

sounds like you may need to either reflect to get access to the block's icon and replace it with your own, or reflect to replace the block instance with one of your own which will bind your custom texture

 

I'm not sure what you mean by "reflect to get access", and I can't seem to replace the instance of the block easily. 

Link to comment
Share on other sites

sounds like you may need to either reflect to get access to the block's icon and replace it with your own, or reflect to replace the block instance with one of your own which will bind your custom texture

 

I'm not sure what you mean by "reflect to get access", and I can't seem to replace the instance of the block easily. 

Link to comment
Share on other sites

I think I may have answered my own question.  I was surfing the code when I found the TextureStitchEvent.  It seems that the pre texture stitch even happens at just the right time to register the textures.  However, the textures aren't appearing correctly.  All I'm seeing is diamond block, gold block, and emerald block textures.  Any reason why that might be?

 

Edit: never mind.  I was having problems with how many times registerIcon() actually gets called.

Link to comment
Share on other sites

I think I may have answered my own question.  I was surfing the code when I found the TextureStitchEvent.  It seems that the pre texture stitch even happens at just the right time to register the textures.  However, the textures aren't appearing correctly.  All I'm seeing is diamond block, gold block, and emerald block textures.  Any reason why that might be?

 

Edit: never mind.  I was having problems with how many times registerIcon() actually gets called.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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