Jump to content

Recommended Posts

Posted

Hey,

At the moment, I'm porting my mod from ModLoader to Forge.

The only step i missed is porting the textures for crops.

 

In ModLoader it looks like this:

 

public int getBlockTextureFromSideAndMetadata(int i, int j)
{
	if(j == 0)
	{
	   return blockIndexInTexture;
	}
	if(j == 1)
	{
	   return mod_Namehere.growNamehere1;
	}
	if(j == 2)
	{
	   return mod_Namehere.growNamehere2;
	}
	if(j == 3)
	{
	   return mod_Namehere.growNamehere3;
	}
	if(j == 4)
	{
	   return mod_Namehere.growNamehere4;
	}
	if(j == 5)
	{
	   return mod_Namehere.growNamehere5;
	}
	if(j == 6)
	{
	   return mod_Namehere.growNamehere6;
	}
	if(j == 7)
	{
	   return mod_Namehere.growNamehere7;
	}
	if(j == 
	{
	   return mod_Namehere.growNamehere8;
	}
  return j;
}

 

But how i have to do that in Forge?

Posted

If you've set up ITextureProvider properly (Implement it in your block's file, import it, then return the local path to the spritesheet you want to use), just return a number between 0 and 255, depending on where the image is on your spritesheet.

 

 

To be more specific:

 

The texture on the top leftmost square is 0. For every square you go rightwards, add 1. When you go down by 1, add 16.

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.