Program: 34048
Project: 34048
Buggy source:
/** 
 * Makes an island using schematic. No permission checks are made. They have to be decided before this method is called.
 * @param player
 * @param schematic
 */
public void newIsland(final Player player,final Schematic schematic){
  final UUID playerUUID=player.getUniqueId();
  boolean firstTime=false;
  if (!plugin.getPlayers().hasIsland(playerUUID)) {
    firstTime=true;
  }
  Location next=getNextIsland();
  plugin.setNewIsland(true);
  if (schematic != null) {
    if (schematic.isInNether() && Settings.newNether) {
      if (!schematic.getPartnerName().isEmpty() && schematics.containsKey(schematic.getPartnerName())) {
        pastePartner(schematics.get(schematic.getPartnerName()),next,player);
      }
      next=next.toVector().toLocation(ASkyBlock.getNetherWorld());
      schematic.pasteSchematic(next,player);
    }
 else {
      schematic.pasteSchematic(next,player);
      if (Settings.newNether) {
        final Location netherLoc=next.toVector().toLocation(ASkyBlock.getNetherWorld());
        if (schematic.getPartnerName().isEmpty()) {
          pastePartner(schematic,netherLoc,player);
        }
 else {
          if (schematics.containsKey(schematic.getPartnerName())) {
            pastePartner(schematics.get(schematic.getPartnerName()),netherLoc,player);
          }
 else {
            plugin.getLogger().severe("String_Node_Str" + schematic.getPartnerName() + "String_Node_Str");
          }
        }
      }
    }
    plugin.getPlayers().setStartIslandRating(playerUUID,schematic.getRating());
  }
  plugin.setNewIsland(false);
  plugin.getPlayers().setHasIsland(playerUUID,true);
  plugin.getPlayers().clearHomeLocations(playerUUID);
  plugin.getPlayers().setIslandLocation(playerUUID,next);
  Island myIsland=plugin.getGrid().addIsland(next.getBlockX(),next.getBlockZ(),playerUUID);
  plugin.getPlayers().save(playerUUID);
  if (schematic.isPlayerSpawn()) {
    plugin.getPlayers().setHomeLocation(playerUUID,schematic.getPlayerSpawn(next),1);
    player.teleport(schematic.getPlayerSpawn(next));
  }
 else {
    plugin.getGrid().homeTeleport(player);
  }
  plugin.resetPlayer(player);
  if (Settings.resetMoney) {
    resetMoney(player);
  }
  setResetWaitTime(player);
  int range=Settings.island_protectionRange;
  for (  PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
    if (perms.getPermission().startsWith(Settings.PERMPREFIX + "String_Node_Str")) {
      range=Integer.valueOf(perms.getPermission().split(Settings.PERMPREFIX + "String_Node_Str")[1]);
      if (range % 2 != 0) {
        range--;
        plugin.getLogger().warning("String_Node_Str" + range + "String_Node_Str"+ player.getName());
      }
      if (range > Settings.islandDistance) {
        if (!plugin.getConfig().getBoolean("String_Node_Str",false)) {
          if (range > (Settings.islandDistance - 16)) {
            range=Settings.islandDistance - 16;
            plugin.getLogger().warning("String_Node_Str" + (Settings.islandDistance - 16) + "String_Node_Str"+ range);
          }
        }
 else {
          range=Settings.islandDistance;
        }
      }
      if (range < 50) {
        range=50;
      }
    }
  }
  myIsland.setProtectionSize(range);
  if (!plugin.myLocale(player.getUniqueId()).islandSubTitle.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandSubTitle+ "String_Node_Str");
  }
  if (!plugin.myLocale(player.getUniqueId()).islandTitle.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandTitle+ "String_Node_Str");
  }
  if (!plugin.myLocale(player.getUniqueId()).islandDonate.isEmpty() && !plugin.myLocale(player.getUniqueId()).islandURL.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandDonate+ "String_Node_Str"+ "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandURL+ "String_Node_Str");
  }
  if (firstTime) {
    runCommands(Settings.startCommands,player.getUniqueId());
  }
  final IslandNewEvent event=new IslandNewEvent(player,schematic,myIsland);
  plugin.getServer().getPluginManager().callEvent(event);
}

Fixed version (ground truth):
/** 
 * Makes an island using schematic. No permission checks are made. They have to be decided before this method is called.
 * @param player
 * @param schematic
 */
public void newIsland(final Player player,final Schematic schematic){
  final UUID playerUUID=player.getUniqueId();
  boolean firstTime=false;
  if (!plugin.getPlayers().hasIsland(playerUUID)) {
    firstTime=true;
  }
  Location next=getNextIsland();
  plugin.setNewIsland(true);
  if (schematic != null) {
    if (Settings.createNether && schematic.isInNether() && Settings.newNether) {
      if (!schematic.getPartnerName().isEmpty() && schematics.containsKey(schematic.getPartnerName())) {
        pastePartner(schematics.get(schematic.getPartnerName()),next,player);
      }
      next=next.toVector().toLocation(ASkyBlock.getNetherWorld());
      schematic.pasteSchematic(next,player);
    }
 else {
      schematic.pasteSchematic(next,player);
      if (Settings.createNether && Settings.newNether) {
        final Location netherLoc=next.toVector().toLocation(ASkyBlock.getNetherWorld());
        if (schematic.getPartnerName().isEmpty()) {
          pastePartner(schematic,netherLoc,player);
        }
 else {
          if (schematics.containsKey(schematic.getPartnerName())) {
            pastePartner(schematics.get(schematic.getPartnerName()),netherLoc,player);
          }
 else {
            plugin.getLogger().severe("String_Node_Str" + schematic.getPartnerName() + "String_Node_Str");
          }
        }
      }
    }
    plugin.getPlayers().setStartIslandRating(playerUUID,schematic.getRating());
  }
  plugin.setNewIsland(false);
  plugin.getPlayers().setHasIsland(playerUUID,true);
  plugin.getPlayers().clearHomeLocations(playerUUID);
  plugin.getPlayers().setIslandLocation(playerUUID,next);
  Island myIsland=plugin.getGrid().addIsland(next.getBlockX(),next.getBlockZ(),playerUUID);
  plugin.getPlayers().save(playerUUID);
  if (schematic.isPlayerSpawn()) {
    plugin.getPlayers().setHomeLocation(playerUUID,schematic.getPlayerSpawn(next),1);
    player.teleport(schematic.getPlayerSpawn(next));
  }
 else {
    plugin.getGrid().homeTeleport(player);
  }
  plugin.resetPlayer(player);
  if (Settings.resetMoney) {
    resetMoney(player);
  }
  setResetWaitTime(player);
  int range=Settings.island_protectionRange;
  for (  PermissionAttachmentInfo perms : player.getEffectivePermissions()) {
    if (perms.getPermission().startsWith(Settings.PERMPREFIX + "String_Node_Str")) {
      range=Integer.valueOf(perms.getPermission().split(Settings.PERMPREFIX + "String_Node_Str")[1]);
      if (range % 2 != 0) {
        range--;
        plugin.getLogger().warning("String_Node_Str" + range + "String_Node_Str"+ player.getName());
      }
      if (range > Settings.islandDistance) {
        if (!plugin.getConfig().getBoolean("String_Node_Str",false)) {
          if (range > (Settings.islandDistance - 16)) {
            range=Settings.islandDistance - 16;
            plugin.getLogger().warning("String_Node_Str" + (Settings.islandDistance - 16) + "String_Node_Str"+ range);
          }
        }
 else {
          range=Settings.islandDistance;
        }
      }
      if (range < 50) {
        range=50;
      }
    }
  }
  myIsland.setProtectionSize(range);
  if (!plugin.myLocale(player.getUniqueId()).islandSubTitle.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandSubTitle+ "String_Node_Str");
  }
  if (!plugin.myLocale(player.getUniqueId()).islandTitle.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandTitle+ "String_Node_Str");
  }
  if (!plugin.myLocale(player.getUniqueId()).islandDonate.isEmpty() && !plugin.myLocale(player.getUniqueId()).islandURL.isEmpty()) {
    plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),"String_Node_Str" + player.getName() + "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandDonate+ "String_Node_Str"+ "String_Node_Str"+ plugin.myLocale(player.getUniqueId()).islandURL+ "String_Node_Str");
  }
  if (firstTime) {
    runCommands(Settings.startCommands,player.getUniqueId());
  }
  final IslandNewEvent event=new IslandNewEvent(player,schematic,myIsland);
  plugin.getServer().getPluginManager().callEvent(event);
}