I'm using the following code to rotate "Directional" blocks and trigger a blockupdate:
@EventHandler public void onClick(PlayerInteractEvent e){ Block block = e.getClickedBlock(); BlockState state = block.getState(); BlockData blockData = block.getBlockData(); Directional directional = (Directional) blockData; directional.setFacing(BlockFace.NORTH); state.setBlockData(directional); e.setCancelled(true); state.update(true, true); }
This works fine, the rotation happens. However, when using it on Redstone components (For example Pistons or Repeaters) they don't change their powered state even though they are updated with state.update(true, true). In the screenshots it should be clear what I mean by that.