Posted September 7, 201213 yr 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: 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?
September 7, 201213 yr You mean different textures for the sides? Use this: public int getBlockTextureFromSideAndMetadata(int par1, int par2)
September 7, 201213 yr 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.
September 7, 201213 yr 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.
September 7, 201213 yr 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).
September 8, 201213 yr 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.