Hello guys,
Using Forge v10.13.0.1180
I found out a weird behavior that I can't explain.
So, I made a custom block with metada.
I set Metadata with onBlockPlacedBy, it works fine.
With this code :
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float a, float b, float c)
{
int dest = (metadata+1)%idBlock;
if(!world.isRemote)
{
//Debug
player.addChatMessage(new ChatComponentText("Local BlockNumber : " + world.getBlockMetadata(x, y, z)));
player.addChatMessage(new ChatComponentText("onBlock BlockNumber : " + metadata));
}
}
world.getBlockMetadata(x, y, z) returns the correct value.
metadata (from onBlockActivated) return value that could be correct ("random" metadata from previous onBlockPlacedBy), but they are not the current block metadata value!
I am missing something fundamental? 5th paramater of onBlock should be the metadata of the activated block....
Thanks