Posted April 4, 201312 yr Hey there! Can anybody help me with getting metadata for blocks in 1.5.1 All what i got - is different icons in inventory of blocks sub-id, but i allways get default block with no meta texture when placing it. Here is my block code package pyani.spellblock; import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.relauncher.*; public class BlockBricked extends Block { protected Icon[] icon = new Icon[2]; public BlockBricked(int ID, Material material) {super(ID, material);} /**Adds the texture from the directory stated**/ @Override public void registerIcons(IconRegister iconRegister) { icon[0] = iconRegister.registerIcon("spellblock:Bricks"); icon[1] = iconRegister.registerIcon("spellblock:Bricks2"); } @Override public int damageDropped(int meta){ return meta; } @SideOnly(Side.CLIENT) public Icon getBlockTextureFromSideAndMetadata(int side, int meta) { return icon[meta]; } @SideOnly(Side.CLIENT) public void getSubBlocks(int unknown, CreativeTabs tab, List subItems) { for (int ix = 0; ix < 2; ix++) { subItems.add(new ItemStack(this, 1, ix)); } } }
May 10, 201312 yr I just got started today and have run into the same issue. Did you get it sorted out?
May 10, 201312 yr Have you tried overridng the other texture related method's like getIcon? If you guys dont get it.. then well ya.. try harder...
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.