Jump to content

Recommended Posts

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?

Posted

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.

Posted

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.

Posted

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

Posted

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

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