Hi
I have a block with a facing property
public static IProperty<EnumFacing> FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
When I place it, I use the following code because the texture has orientation
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
//Debugging line
System.out.println("Player facing: " + placer.getHorizontalFacing());
return this.getDefaultState().withProperty(BlockProperties.FACING, placer.getHorizontalFacing());
}
And after it has been placed I tried to debug to try to understand why the texture is changing orientation in the server
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
//Debugging line
System.out.println("Block facing:" + state.getProperties().get(BlockProperties.FACING));
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
}
When playing single player, everything works fine and the block looks good. No texture gets changed. But when playing on a server, the texture of the block changes orientation. On multiplayer server and single player, the output is the same on both methods. But on the server, I can temporarily see for a fraction of a second that once the block is placed, it rotates my texture, even though the facing of the block stays the same.
The version is 1.12.2