Program: 41392
Project: 41392
Buggy source:
@EventHandler public void onDaylightChange(PlayerInteractEvent evt){
  Player player=evt.getPlayer();
  if (evt.getAction() == Action.RIGHT_CLICK_BLOCK) {
    if (evt.getClickedBlock().getType() == Carbon.injector().daylightDetectorInvertedMat) {
      try {
        CraftBlock craftBlock=(CraftBlock)evt.getClickedBlock();
        craftBlock.setType(Material.DAYLIGHT_DETECTOR);
        Method method=CraftBlock.class.getDeclaredMethod("String_Node_Str",net.minecraft.server.v1_7_R4.Block.class);
        method.setAccessible(true);
        net.minecraft.server.v1_7_R4.Block nmsBlock=(net.minecraft.server.v1_7_R4.Block)method.invoke(craftBlock,Void.class);
        BlockDaylightDetector detector=(BlockDaylightDetector)nmsBlock;
        detector.setInverted(false);
        player.getWorld().playSound(evt.getClickedBlock().getLocation(),Sound.CLICK,1,1);
      }
 catch (      NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
        Logger.getLogger(BlockListener.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
 else     if (evt.getClickedBlock().getType() == Material.DAYLIGHT_DETECTOR) {
      try {
        CraftBlock craftBlock=(CraftBlock)evt.getClickedBlock();
        craftBlock.setType(Carbon.injector().daylightDetectorInvertedMat);
        Method method=CraftBlock.class.getDeclaredMethod("String_Node_Str",net.minecraft.server.v1_7_R4.Block.class);
        method.setAccessible(true);
        net.minecraft.server.v1_7_R4.Block nmsBlock=(net.minecraft.server.v1_7_R4.Block)method.invoke(craftBlock,Void.class);
        BlockDaylightDetector detector=(BlockDaylightDetector)nmsBlock;
        detector.setInverted(true);
        player.getWorld().playSound(evt.getClickedBlock().getLocation(),Sound.CLICK,1,1);
      }
 catch (      NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
        Logger.getLogger(BlockListener.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onDaylightChange(PlayerInteractEvent evt){
  Player player=evt.getPlayer();
  if (evt.getAction() == Action.RIGHT_CLICK_BLOCK) {
    if (evt.getClickedBlock().getType() == Carbon.injector().daylightDetectorInvertedMat) {
      try {
        CraftBlock craftBlock=(CraftBlock)evt.getClickedBlock();
        craftBlock.setType(Material.DAYLIGHT_DETECTOR);
        Method method=CraftBlock.class.getDeclaredMethod("String_Node_Str");
        method.setAccessible(true);
        net.minecraft.server.v1_7_R4.Block nmsBlock=(net.minecraft.server.v1_7_R4.Block)method.invoke(craftBlock);
        BlockDaylightDetector detector=(BlockDaylightDetector)nmsBlock;
        detector.setInverted(false);
        player.getWorld().playSound(evt.getClickedBlock().getLocation(),Sound.CLICK,1,1);
      }
 catch (      NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
        Logger.getLogger(BlockListener.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
 else     if (evt.getClickedBlock().getType() == Material.DAYLIGHT_DETECTOR) {
      try {
        CraftBlock craftBlock=(CraftBlock)evt.getClickedBlock();
        craftBlock.setType(Carbon.injector().daylightDetectorInvertedMat);
        Method method=CraftBlock.class.getDeclaredMethod("String_Node_Str");
        method.setAccessible(true);
        net.minecraft.server.v1_7_R4.Block nmsBlock=(net.minecraft.server.v1_7_R4.Block)method.invoke(craftBlock);
        BlockDaylightDetector detector=(BlockDaylightDetector)nmsBlock;
        detector.setInverted(true);
        player.getWorld().playSound(evt.getClickedBlock().getLocation(),Sound.CLICK,1,1);
      }
 catch (      NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
        Logger.getLogger(BlockListener.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
}