Program: 33994
Project: 33994
Buggy source:
/** 
 * Class dedicated to deleting islands
 * @param plugin
 * @param loc
 */
public DeleteIslandChunk(final ASkyBlock plugin,final Island island){
  this.plugin=plugin;
  nms=checkVersion();
  final World world=island.getCenter().getWorld();
  if (world == null || nms == null) {
    plugin.getLogger().severe("String_Node_Str");
    return;
  }
  final int range=island.getProtectionSize() / 2 * +1;
  final int minx=island.getMinProtectedX();
  final int minz=island.getMinProtectedZ();
  final int maxx=island.getMinProtectedX() + island.getProtectionSize();
  final int maxz=island.getMinProtectedZ() + island.getProtectionSize();
  final int islandSpacing=Settings.islandDistance - island.getProtectionSize();
  final int minxX=(island.getCenter().getBlockX() - range - islandSpacing);
  final int minzZ=(island.getCenter().getBlockZ() - range - islandSpacing);
  final int maxxX=(island.getCenter().getBlockX() + range + islandSpacing);
  final int maxzZ=(island.getCenter().getBlockZ() + range + islandSpacing);
  Set<ChunkSnapshot> chunkSnapshot=new HashSet<ChunkSnapshot>();
  Set<ChunkSnapshot> netherChunkSnapshot=new HashSet<ChunkSnapshot>();
  for (int x=island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionSize() + 16); x+=16) {
    for (int z=island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionSize() + 16); z+=16) {
      chunkSnapshot.add(ASkyBlock.getIslandWorld().getBlockAt(x,0,z).getChunk().getChunkSnapshot());
      if (Settings.createNether && Settings.newNether) {
        netherChunkSnapshot.add(ASkyBlock.getNetherWorld().getBlockAt(x,0,z).getChunk().getChunkSnapshot());
      }
    }
  }
  final Set<ChunkSnapshot> finalChunk=chunkSnapshot;
  final Set<ChunkSnapshot> finalNetherChunk=netherChunkSnapshot;
  plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
    @Deprecated @Override public void run(){
      for (      ChunkSnapshot snap : finalChunk) {
        if (snap.getX() * 16 >= minxX && snap.getZ() * 16 >= minzZ && snap.getX() * 16 + 15 <= maxxX && snap.getZ() * 16 + 15 <= maxzZ) {
          chunksToClear.add(new Pair(snap.getX(),snap.getZ()));
        }
 else {
          for (int x=0; x < 16; x++) {
            for (int z=0; z < 16; z++) {
              if (snap.getX() * 16 + x >= minx && snap.getZ() * 16 + z >= minz && snap.getX() * 16 + x < maxx && snap.getZ() * 16 + z < maxz) {
                for (int y=0; y < ASkyBlock.getIslandWorld().getMaxHeight(); y++) {
                  if (y < Settings.sea_level) {
                    if (snap.getBlockTypeId(x,y,z) != Material.STATIONARY_WATER.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getIslandWorld(),snap.getX() * 16 + x,y,snap.getZ() * 16 + z),Material.STATIONARY_WATER);
                    }
                  }
 else {
                    if (snap.getBlockTypeId(x,y,z) != Material.AIR.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getIslandWorld(),snap.getX() * 16 + x,y,snap.getZ() * 16 + z),Material.AIR);
                    }
                  }
                }
              }
            }
          }
        }
      }
      if (Settings.createNether && Settings.newNether) {
        for (        ChunkSnapshot snap1 : finalNetherChunk) {
          if (!(snap1.getX() * 16 >= minxX && snap1.getZ() * 16 >= minzZ && snap1.getX() * 16 + 15 <= maxxX && snap1.getZ() * 16 + 15 <= maxzZ)) {
            for (int x=0; x < 16; x++) {
              for (int z=0; z < 16; z++) {
                if (snap1.getX() * 16 + x >= minx && snap1.getZ() * 16 + z >= minz && snap1.getX() * 16 + x < maxx && snap1.getZ() * 16 + z < maxz) {
                  for (int y=0; y < ASkyBlock.getNetherWorld().getMaxHeight() - 16; y++) {
                    if (snap1.getBlockTypeId(x,y,z) != Material.AIR.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getNetherWorld(),snap1.getX() * 16 + x,y,snap1.getZ() * 16 + z),Material.AIR);
                    }
                  }
                }
              }
            }
          }
        }
      }
      if (Settings.cleanUpBlocks) {
        new BukkitRunnable(){
          @Override public void run(){
            Iterator<Entry<Location,Material>> it=blocksToClear.entrySet().iterator();
            int count=0;
            while (it.hasNext() && count < 500) {
              Entry<Location,Material> entry=it.next();
              if (entry.getKey().getBlock().getState() instanceof InventoryHolder) {
                ((InventoryHolder)entry.getKey().getBlock().getState()).getInventory().clear();
              }
              nms.setBlockSuperFast(entry.getKey().getBlock(),entry.getValue().getId(),(byte)0,false);
              it.remove();
              count++;
            }
            if (blocksToClear.isEmpty()) {
              this.cancel();
            }
          }
        }
.runTaskTimer(plugin,10L,5L);
      }
      new BukkitRunnable(){
        @Override public void run(){
          Iterator<Pair> it1=chunksToClear.iterator();
          while (it1.hasNext()) {
            Pair entry=it1.next();
            ASkyBlock.getIslandWorld().regenerateChunk(entry.getLeft(),entry.getRight());
            if (Settings.createNether && Settings.newNether) {
              ASkyBlock.getNetherWorld().regenerateChunk(entry.getLeft(),entry.getRight());
            }
            it1.remove();
          }
        }
      }
.runTask(plugin);
    }
  }
);
  plugin.getGrid().deleteIsland(island.getCenter());
}

Fixed version (ground truth):
/** 
 * Class dedicated to deleting islands
 * @param plugin
 * @param loc
 */
public DeleteIslandChunk(final ASkyBlock plugin,final Island island){
  this.plugin=plugin;
  nms=checkVersion();
  final World world=island.getCenter().getWorld();
  if (world == null || nms == null) {
    plugin.getLogger().severe("String_Node_Str");
    return;
  }
  final int range=island.getProtectionSize() / 2 * +1;
  final int minx=island.getMinProtectedX();
  final int minz=island.getMinProtectedZ();
  final int maxx=island.getMinProtectedX() + island.getProtectionSize();
  final int maxz=island.getMinProtectedZ() + island.getProtectionSize();
  final int islandSpacing=Settings.islandDistance - island.getProtectionSize();
  final int minxX=(island.getCenter().getBlockX() - range - islandSpacing);
  final int minzZ=(island.getCenter().getBlockZ() - range - islandSpacing);
  final int maxxX=(island.getCenter().getBlockX() + range + islandSpacing);
  final int maxzZ=(island.getCenter().getBlockZ() + range + islandSpacing);
  Set<ChunkSnapshot> chunkSnapshot=new HashSet<ChunkSnapshot>();
  Set<ChunkSnapshot> netherChunkSnapshot=new HashSet<ChunkSnapshot>();
  for (int x=island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionSize() + 16); x+=16) {
    for (int z=island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionSize() + 16); z+=16) {
      chunkSnapshot.add(ASkyBlock.getIslandWorld().getBlockAt(x,0,z).getChunk().getChunkSnapshot());
      if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {
        netherChunkSnapshot.add(ASkyBlock.getNetherWorld().getBlockAt(x,0,z).getChunk().getChunkSnapshot());
      }
    }
  }
  final Set<ChunkSnapshot> finalChunk=chunkSnapshot;
  final Set<ChunkSnapshot> finalNetherChunk=netherChunkSnapshot;
  plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
    @Deprecated @Override public void run(){
      for (      ChunkSnapshot snap : finalChunk) {
        if (snap.getX() * 16 >= minxX && snap.getZ() * 16 >= minzZ && snap.getX() * 16 + 15 <= maxxX && snap.getZ() * 16 + 15 <= maxzZ) {
          chunksToClear.add(new Pair(snap.getX(),snap.getZ()));
        }
 else {
          for (int x=0; x < 16; x++) {
            for (int z=0; z < 16; z++) {
              if (snap.getX() * 16 + x >= minx && snap.getZ() * 16 + z >= minz && snap.getX() * 16 + x < maxx && snap.getZ() * 16 + z < maxz) {
                for (int y=0; y < ASkyBlock.getIslandWorld().getMaxHeight(); y++) {
                  if (y < Settings.sea_level) {
                    if (snap.getBlockTypeId(x,y,z) != Material.STATIONARY_WATER.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getIslandWorld(),snap.getX() * 16 + x,y,snap.getZ() * 16 + z),Material.STATIONARY_WATER);
                    }
                  }
 else {
                    if (snap.getBlockTypeId(x,y,z) != Material.AIR.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getIslandWorld(),snap.getX() * 16 + x,y,snap.getZ() * 16 + z),Material.AIR);
                    }
                  }
                }
              }
            }
          }
        }
      }
      if (Settings.createNether && Settings.newNether) {
        for (        ChunkSnapshot snap1 : finalNetherChunk) {
          if (!(snap1.getX() * 16 >= minxX && snap1.getZ() * 16 >= minzZ && snap1.getX() * 16 + 15 <= maxxX && snap1.getZ() * 16 + 15 <= maxzZ)) {
            for (int x=0; x < 16; x++) {
              for (int z=0; z < 16; z++) {
                if (snap1.getX() * 16 + x >= minx && snap1.getZ() * 16 + z >= minz && snap1.getX() * 16 + x < maxx && snap1.getZ() * 16 + z < maxz) {
                  for (int y=0; y < ASkyBlock.getNetherWorld().getMaxHeight() - 16; y++) {
                    if (snap1.getBlockTypeId(x,y,z) != Material.AIR.getId()) {
                      blocksToClear.put(new Location(ASkyBlock.getNetherWorld(),snap1.getX() * 16 + x,y,snap1.getZ() * 16 + z),Material.AIR);
                    }
                  }
                }
              }
            }
          }
        }
      }
      if (Settings.cleanUpBlocks) {
        new BukkitRunnable(){
          @Override public void run(){
            Iterator<Entry<Location,Material>> it=blocksToClear.entrySet().iterator();
            int count=0;
            while (it.hasNext() && count < 500) {
              Entry<Location,Material> entry=it.next();
              if (entry.getKey().getBlock().getState() instanceof InventoryHolder) {
                ((InventoryHolder)entry.getKey().getBlock().getState()).getInventory().clear();
              }
              nms.setBlockSuperFast(entry.getKey().getBlock(),entry.getValue().getId(),(byte)0,false);
              it.remove();
              count++;
            }
            if (blocksToClear.isEmpty()) {
              this.cancel();
            }
          }
        }
.runTaskTimer(plugin,10L,5L);
      }
      new BukkitRunnable(){
        @Override public void run(){
          Iterator<Pair> it1=chunksToClear.iterator();
          while (it1.hasNext()) {
            Pair entry=it1.next();
            ASkyBlock.getIslandWorld().regenerateChunk(entry.getLeft(),entry.getRight());
            if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {
              ASkyBlock.getNetherWorld().regenerateChunk(entry.getLeft(),entry.getRight());
            }
            it1.remove();
          }
        }
      }
.runTask(plugin);
    }
  }
);
  plugin.getGrid().deleteIsland(island.getCenter());
}