Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

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.

  • Author

I tried that already. I also used the Bonemeal Tutorial in the forge wiki. When I use the Bonemeal, there still is the same texture.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.