Hello, I'm doing my first mod and I have a little problem.
I need to change the texture of a block as a function of its TilEntity. I do like this:
public int getBlockTexture(IBlockAccess iblockaccess, int x, int y, int z, int side)
{
return (((MyTileEntity)iblockaccess.getBlockTileEntity(x,y,z)).Texture);
}
I have also tried this option:
public int getBlockTexture(IBlockAccess iblockaccess, int x, int y, int z, int side)
{
return (((MyTileEntity)ModLoader.getMinecraftInstance().theWorld.getBlockTileEntity(x,y,z)).Texture);
}
It works in singleplayer mode but none of them in multiplayer.
My problem is that the function returns always 0 (default value), but this value (Texture in code) changes when click on the block.
I know that this value changes because I use it for other things (power redestone) and It works (multiplayer too).
Why the Texture value is always 0? this is a bug?
As I can access the variable World in multiplayer mode (possible solution)?
Thanks in advance. Sorry for my English I am Spanish.