Program: 44735
Project: 44735
Buggy source:
private static void setReceiver(Block block,boolean powerOn){
  Material mBlock=block.getType();
  int iData=(int)block.getData();
  if (mBlock == Material.LEVER) {
    if (!plugin.isApiOudated()) {
      if ((powerOn && (iData & 0x08) != 0x08) || (!powerOn && (iData & 0x08) == 0x08)) {
        CraftBlock cbBlock=(CraftBlock)block;
        BlockState cbState=cbBlock.getState();
        net.minecraft.server.v1_10_R1.WorldServer w=((CraftWorld)block.getWorld()).getHandle();
        Location l=block.getLocation();
        int blockX=l.getBlockX();
        int blockY=l.getBlockY();
        int blockZ=l.getBlockZ();
        BlockPosition bp=new BlockPosition(blockX,blockY,blockZ);
        int blockData=cbState.getRawData();
        int j1=blockData & 7;
        int k1=8 - (blockData & 8);
        net.minecraft.server.v1_10_R1.Block netBlock=w.getType(bp).getBlock();
        w.setTypeAndData(bp,netBlock.fromLegacyData(j1 + k1),3);
        w.applyPhysics(bp,netBlock);
        if (j1 == 1) {
          w.applyPhysics(new BlockPosition(blockX - 1,blockY,blockZ),netBlock);
        }
 else         if (j1 == 2) {
          w.applyPhysics(new BlockPosition(blockX + 1,blockY,blockZ),netBlock);
        }
 else         if (j1 == 3) {
          w.applyPhysics(new BlockPosition(blockX,blockY,blockZ - 1),netBlock);
        }
 else         if (j1 == 4) {
          w.applyPhysics(new BlockPosition(blockX,blockY,blockZ + 1),netBlock);
        }
 else         if (j1 != 5 && j1 != 6) {
          if (j1 == 0 || j1 == 7) {
            w.applyPhysics(new BlockPosition(blockX,blockY + 1,blockZ),netBlock);
          }
        }
 else {
          w.applyPhysics(new BlockPosition(blockX,blockY - 1,blockZ),netBlock);
        }
      }
    }
 else {
      BlockState state=block.getState();
      Lever lever=(Lever)state.getData();
      lever.setPowered(powerOn);
      state.setData(lever);
      state.update();
    }
  }
 else   if (mBlock == Material.POWERED_RAIL) {
    if (powerOn && (iData & 0x08) != 0x08) {
      iData|=0x08;
    }
 else     if (!powerOn && (iData & 0x08) == 0x08) {
      iData^=0x08;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR) {
    Block bOtherPiece=block.getRelative(((iData & 0x08) == 0x08) ? BlockFace.DOWN : BlockFace.UP);
    int iOtherPieceData=(int)bOtherPiece.getData();
    if (powerOn && (iData & 0x04) != 0x04) {
      iData|=0x04;
      iOtherPieceData|=0x04;
    }
 else     if (!powerOn && (iData & 0x04) == 0x04) {
      iData^=0x04;
      iOtherPieceData^=0x04;
    }
    block.setData((byte)iData);
    bOtherPiece.setData((byte)iOtherPieceData);
    block.getWorld().playEffect(block.getLocation(),Effect.DOOR_TOGGLE,0,10);
  }
 else   if (mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    if (powerOn && (iData & 0x04) != 0x04) {
      iData|=0x04;
    }
 else     if (!powerOn && (iData & 0x04) == 0x04) {
      iData^=0x04;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.PISTON_BASE || mBlock == Material.PISTON_STICKY_BASE) {
    if (powerOn && (iData & 0x08) != 0x08) {
      iData|=0x08;
    }
 else     if (!powerOn && (iData & 0x08) == 0x08) {
      iData^=0x08;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.REDSTONE_LAMP_ON) {
    if (!powerOn) {
      keepAlives.remove(block);
      block.setType(Material.REDSTONE_LAMP_OFF);
    }
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF) {
    if (powerOn) {
      keepAlives.add(block);
      net.minecraft.server.v1_10_R1.World w=((CraftWorld)block.getWorld()).getHandle();
      try {
        setStaticStatus(w,true);
        block.setType(Material.REDSTONE_LAMP_ON);
        setStaticStatus(w,false);
      }
 catch (      NoSuchFieldException e) {
        e.printStackTrace();
      }
catch (      IllegalAccessException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private static void setReceiver(Block block,boolean powerOn){
  Material mBlock=block.getType();
  int iData=(int)block.getData();
  if (mBlock == Material.LEVER) {
    if (!plugin.isApiOudated()) {
      if ((powerOn && (iData & 0x08) != 0x08) || (!powerOn && (iData & 0x08) == 0x08)) {
        CraftBlock cbBlock=(CraftBlock)block;
        BlockState cbState=cbBlock.getState();
        net.minecraft.server.v1_10_R1.WorldServer w=((CraftWorld)block.getWorld()).getHandle();
        Location l=block.getLocation();
        int blockX=l.getBlockX();
        int blockY=l.getBlockY();
        int blockZ=l.getBlockZ();
        BlockPosition bp=new BlockPosition(blockX,blockY,blockZ);
        int blockData=cbState.getRawData();
        int j1=blockData & 7;
        int k1=8 - (blockData & 8);
        net.minecraft.server.v1_10_R1.Block netBlock=w.getType(bp).getBlock();
        w.setTypeAndData(bp,netBlock.fromLegacyData(j1 + k1),3);
        w.applyPhysics(bp,netBlock);
        if (j1 == 1) {
          w.applyPhysics(new BlockPosition(blockX - 1,blockY,blockZ),netBlock);
        }
 else         if (j1 == 2) {
          w.applyPhysics(new BlockPosition(blockX + 1,blockY,blockZ),netBlock);
        }
 else         if (j1 == 3) {
          w.applyPhysics(new BlockPosition(blockX,blockY,blockZ - 1),netBlock);
        }
 else         if (j1 == 4) {
          w.applyPhysics(new BlockPosition(blockX,blockY,blockZ + 1),netBlock);
        }
 else         if (j1 != 5 && j1 != 6) {
          if (j1 == 0 || j1 == 7) {
            w.applyPhysics(new BlockPosition(blockX,blockY + 1,blockZ),netBlock);
          }
        }
 else {
          w.applyPhysics(new BlockPosition(blockX,blockY - 1,blockZ),netBlock);
        }
      }
    }
 else {
      BlockState state=block.getState();
      Lever lever=(Lever)state.getData();
      lever.setPowered(powerOn);
      state.setData(lever);
      state.update();
    }
  }
 else   if (mBlock == Material.POWERED_RAIL) {
    if (powerOn && (iData & 0x08) != 0x08) {
      iData|=0x08;
    }
 else     if (!powerOn && (iData & 0x08) == 0x08) {
      iData^=0x08;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.SPRUCE_DOOR || mBlock == Material.BIRCH_DOOR || mBlock == Material.JUNGLE_DOOR || mBlock == Material.ACACIA_DOOR || mBlock == Material.DARK_OAK_DOOR) {
    Block bOtherPiece=block.getRelative(((iData & 0x08) == 0x08) ? BlockFace.DOWN : BlockFace.UP);
    int iOtherPieceData=(int)bOtherPiece.getData();
    if (powerOn && (iData & 0x04) != 0x04) {
      iData|=0x04;
      iOtherPieceData|=0x04;
    }
 else     if (!powerOn && (iData & 0x04) == 0x04) {
      iData^=0x04;
      iOtherPieceData^=0x04;
    }
    block.setData((byte)iData);
    bOtherPiece.setData((byte)iOtherPieceData);
    block.getWorld().playEffect(block.getLocation(),Effect.DOOR_TOGGLE,0,10);
  }
 else   if (mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE || mBlock == Material.SPRUCE_FENCE_GATE || mBlock == Material.BIRCH_FENCE_GATE || mBlock == Material.JUNGLE_FENCE_GATE || mBlock == Material.ACACIA_FENCE_GATE || mBlock == Material.DARK_OAK_FENCE_GATE) {
    if (powerOn && (iData & 0x04) != 0x04) {
      iData|=0x04;
    }
 else     if (!powerOn && (iData & 0x04) == 0x04) {
      iData^=0x04;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.PISTON_BASE || mBlock == Material.PISTON_STICKY_BASE) {
    if (powerOn && (iData & 0x08) != 0x08) {
      iData|=0x08;
    }
 else     if (!powerOn && (iData & 0x08) == 0x08) {
      iData^=0x08;
    }
    block.setData((byte)iData);
  }
 else   if (mBlock == Material.REDSTONE_LAMP_ON) {
    if (!powerOn) {
      keepAlives.remove(block);
      block.setType(Material.REDSTONE_LAMP_OFF);
    }
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF) {
    if (powerOn) {
      keepAlives.add(block);
      net.minecraft.server.v1_10_R1.World w=((CraftWorld)block.getWorld()).getHandle();
      try {
        setStaticStatus(w,true);
        block.setType(Material.REDSTONE_LAMP_ON);
        setStaticStatus(w,false);
      }
 catch (      NoSuchFieldException e) {
        e.printStackTrace();
      }
catch (      IllegalAccessException e) {
        e.printStackTrace();
      }
    }
  }
}