MiCr2 Posted September 7, 2012 Posted September 7, 2012 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? Quote
Toldea Posted September 7, 2012 Posted September 7, 2012 You mean different textures for the sides? Use this: public int getBlockTextureFromSideAndMetadata(int par1, int par2) Quote
MiCr2 Posted September 7, 2012 Author Posted September 7, 2012 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. Quote
MiCr2 Posted September 7, 2012 Author Posted September 7, 2012 On 9/7/2012 at 10:41 AM, Toldea said: 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. Quote
Toldea Posted September 7, 2012 Posted September 7, 2012 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). Quote
MiCr2 Posted September 8, 2012 Author Posted September 8, 2012 On 9/7/2012 at 9:14 PM, Toldea said: 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; } } Quote
Recommended Posts
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.