Posted December 8, 201212 yr k so im making my mod and my machines im making are running of 1 id, how can i change this method so that , depending on the blocks metadata it will select the right texture heres what i tried which didnt work at all @SideOnly(Side.CLIENT) public int getBlockTextureFromSideAndMetadata(int i, int j, World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); // If no metadata is set, then this is an icon. if (j == 0 && i == 3) { return 0 * meta ; } if (i == j) { if (!isActive) return 0 + 1 * meta - 1; else return 1 * meta; } switch (i) { case 0: return 3 * meta; case 1: return 4 * meta; default: return 2 * meta; } } Or what other method do i need to use to set the texture, remember it has to work with orientation code too thanks
December 8, 201212 yr k so im making my mod and my machines im making are running of 1 id, how can i change this method so that , depending on the blocks metadata it will select the right texture heres what i tried which didnt work at all @SideOnly(Side.CLIENT) public int getBlockTextureFromSideAndMetadata(int i, int j, World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); // If no metadata is set, then this is an icon. if (j == 0 && i == 3) { return 0 * meta ; } if (i == j) { if (!isActive) return 0 + 1 * meta - 1; else return 1 * meta; } switch (i) { case 0: return 3 * meta; case 1: return 4 * meta; default: return 2 * meta; } } Or what other method do i need to use to set the texture, remember it has to work with orientation code too thanks I don't know what that code is suppose to be doing, but 'i' tells you the meta, and 'j' tells you which face you need to return. You could do something like this: //Where does this blocks textures start int OffSet = 0; return OffSet + (i * 6) + j; That could work if there is a different texture for every side and meta possibility, in order. Otherwise you will need some logic to determine the situational texture to use.
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.