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

Hi,

 

So I'm adding new blocks, and one of them is like grass. I want to be able to have the same texture style as grass.

 

This is what it looks like at the moment:

 

HLs94.jpg

 

In the middle you got the dirt and next to it is the grass. (Forget the far left block, its rock)

 

So whats the code to make it look like grass?

You mean different textures for the sides?

Use this:

public int getBlockTextureFromSideAndMetadata(int par1, int par2)

  • Author

Yes, thank you!

 

 

Another question, when I place a block, I get a warning:

 

Warning: Texture /aetherBlocks.png not preloaded, will cause render glitches!

 

Whats the code for this? I can only find old code, I need it for 1.3.2

 

Edit: Nvm, found it.

  • Author

You mean different textures for the sides?

Use this:

public int getBlockTextureFromSideAndMetadata(int par1, int par2)

 

Time to be a noob now, but I'm learning....

 

That code goes in the class i.e. NewGrass right?

Is there more codes to it? Because what I've tried so far, it loads the wrong texture.

The function gets parsed two parameters, the first one is the side of the block and the second one is the metadata. This is not 'sides' as in 'not the top of the bottom' but all the 6 sides of the cube. You need to check which side it is and return the appropriate texture (hint 0 is bottom 1 is top).

  • Author

The function gets parsed two parameters, the first one is the side of the block and the second one is the metadata. This is not 'sides' as in 'not the top of the bottom' but all the 6 sides of the cube. You need to check which side it is and return the appropriate texture (hint 0 is bottom 1 is top).

 

Thanks, I worked it out now, the full code is

 


public int getBlockTextureFromSideAndMetadata(int par1, int par2) 
{
  switch (par2) 
  {
  case 0:
   return 0;
  case 1:
   return 2;
  default:
   return 0;
  }
}

 

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.