Jump to content

wnx

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by wnx

  1. Hi, I have a problem, I have a block and I am storing data about side texture at TileEntity, when Block is in inventory texture data are stored in NBT data of ItemBlock. When block is placed in the world, everything works fine, but I can't figure out how to get rendering at inventory/hand working, I know that i can use public IIcon getIcon(int side, int meta) in block, but I don't have acess to ItemStack/ItemBlock, so I can't get data from NBT. I tryed a couple of methods in ItemBlock like public IIcon getIcon(ItemStack stack, int pass) but it also did not work ...

     

    Thanks for any help!

     

    getIcon of my Block (this works)

    public IIcon getIcon(IBlockAccess blockAcess, int x, int y, int z, int side) {
    	TileEntityMW te = (TileEntityMW) blockAcess.getTileEntity(x, y, z);
    	if(te != null){
    		return sideTextures[te.getSideTexture(side)];
    	} else {
    		return null;
    	}
    }
    

     

    I can use this or blockIcon to set Icon of block, this works in inventory/hand but I can't get data from TileEntity/ItemStack

    @Override
    public IIcon getIcon(int side, int meta) {
    	return sideTexture[0];
    }
    

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.