Program: 33838
Project: 33838
Buggy source:
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onPlayerPortal(PlayerPortalEvent event){
  if (DEBUG)   plugin.getLogger().info("String_Node_Str" + event.getCause());
  UUID playerUUID=event.getPlayer().getUniqueId();
  if (!Settings.createNether || ASkyBlock.getNetherWorld() == null) {
    return;
  }
  Location currentLocation=event.getFrom().clone();
  String currentWorld=currentLocation.getWorld().getName();
  if (!currentWorld.equalsIgnoreCase(Settings.worldName) && !currentWorld.equalsIgnoreCase(Settings.worldName + "String_Node_Str") && !currentWorld.equalsIgnoreCase(Settings.worldName + "String_Node_Str")) {
    return;
  }
  Island island=plugin.getGrid().getIslandAt(currentLocation);
  if ((island == null && !Settings.defaultWorldSettings.get(SettingsFlag.PORTAL)) || (island != null && !(island.getIgsFlag(SettingsFlag.PORTAL) || island.getMembers().contains(event.getPlayer().getUniqueId())))) {
    if (!event.getPlayer().isOp() && !VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).islandProtected);
      event.setCancelled(true);
      return;
    }
  }
switch (event.getCause()) {
case END_PORTAL:
    if (!event.getFrom().getWorld().getEnvironment().equals(Environment.THE_END)) {
      if (plugin.getServer().getWorld(Settings.worldName + "String_Node_Str") != null) {
        event.setCancelled(true);
        Location end_place=plugin.getServer().getWorld(Settings.worldName + "String_Node_Str").getSpawnLocation();
        if (GridManager.isSafeLocation(end_place)) {
          event.getPlayer().teleport(end_place);
          return;
        }
 else {
          Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).warpserrorNotSafe);
          plugin.getGrid().homeTeleport(event.getPlayer());
          return;
        }
      }
    }
 else {
      event.setCancelled(true);
      plugin.getGrid().homeTeleport(event.getPlayer());
    }
  break;
case NETHER_PORTAL:
World homeWorld=ASkyBlock.getIslandWorld();
Location home=plugin.getPlayers().getHomeLocation(event.getPlayer().getUniqueId());
if (home != null) {
homeWorld=home.getWorld();
}
if (!Settings.newNether) {
if (event.getFrom().getWorld().getEnvironment().equals(Environment.NORMAL)) {
if (homeWorld.getEnvironment().equals(Environment.NORMAL)) {
event.setTo(ASkyBlock.getNetherWorld().getSpawnLocation());
event.useTravelAgent(true);
}
 else {
event.useTravelAgent(false);
Location dest=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (dest != null) {
  event.setTo(dest);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
}
}
}
 else {
if (homeWorld.getEnvironment().equals(Environment.NORMAL)) {
event.useTravelAgent(false);
Location dest=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (dest != null) {
  event.setTo(dest);
  Island islandTo=plugin.getGrid().getIslandAt(dest);
  final IslandEnterEvent event2=new IslandEnterEvent(event.getPlayer().getUniqueId(),islandTo,dest);
  plugin.getServer().getPluginManager().callEvent(event2);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
  Island islandTo=plugin.getGrid().getIslandAt(plugin.getPlayers().getIslandLocation(playerUUID));
  final IslandEnterEvent event2=new IslandEnterEvent(event.getPlayer().getUniqueId(),islandTo,plugin.getPlayers().getIslandLocation(playerUUID));
  plugin.getServer().getPluginManager().callEvent(event2);
}
}
 else {
event.setTo(ASkyBlock.getIslandWorld().getSpawnLocation());
event.useTravelAgent(true);
}
}
}
 else {
if (island == null) {
event.setCancelled(true);
return;
}
Location overworldIsland=island.getCenter().toVector().toLocation(ASkyBlock.getIslandWorld());
Location netherIsland=island.getCenter().toVector().toLocation(ASkyBlock.getNetherWorld());
if (event.getFrom().getWorld().getEnvironment().equals(Environment.NORMAL)) {
if (DEBUG) plugin.getLogger().info("String_Node_Str" + island.getCenter());
if (netherIsland.getBlock().getType() != Material.BEDROCK) {
if (plugin.getGrid().bigScan(netherIsland,20) == null) {
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  plugin.getLogger().warning("String_Node_Str" + event.getPlayer().getName() + "String_Node_Str");
  Schematic nether=IslandCmd.getSchematics().get("String_Node_Str");
  if (nether != null) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str" + island.getCenter().toVector());
    plugin.getIslandCmd().pasteSchematic(nether,netherIsland,event.getPlayer(),PasteReason.PARTNER);
    if (nether.isPlayerSpawn()) {
      plugin.getPlayers().setHomeLocation(event.getPlayer().getUniqueId(),nether.getPlayerSpawn(netherIsland),-2);
    }
  }
 else {
    plugin.getLogger().severe("String_Node_Str");
    event.setCancelled(true);
    Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).warpserrorNotSafe);
    return;
  }
}
}
if (DEBUG) plugin.getLogger().info("String_Node_Str" + event.getFrom().toVector().toLocation(ASkyBlock.getNetherWorld()));
event.setCancelled(true);
new SafeSpotTeleport(plugin,event.getPlayer(),netherIsland);
return;
}
event.setCancelled(true);
new SafeSpotTeleport(plugin,event.getPlayer(),overworldIsland);
}
break;
default :
break;
}
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onPlayerPortal(PlayerPortalEvent event){
  if (DEBUG)   plugin.getLogger().info("String_Node_Str" + event.getCause());
  UUID playerUUID=event.getPlayer().getUniqueId();
  if (!Settings.createNether || ASkyBlock.getNetherWorld() == null) {
    return;
  }
  Location currentLocation=event.getFrom().clone();
  String currentWorld=currentLocation.getWorld().getName();
  if (!currentWorld.equalsIgnoreCase(Settings.worldName) && !currentWorld.equalsIgnoreCase(Settings.worldName + "String_Node_Str") && !currentWorld.equalsIgnoreCase(Settings.worldName + "String_Node_Str")) {
    return;
  }
  Island island=plugin.getGrid().getIslandAt(currentLocation);
  if ((island == null && !Settings.defaultWorldSettings.get(SettingsFlag.PORTAL)) || (island != null && !(island.getIgsFlag(SettingsFlag.PORTAL) || island.getMembers().contains(event.getPlayer().getUniqueId())))) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (!event.getPlayer().isOp() && !VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).islandProtected);
      event.setCancelled(true);
      return;
    }
  }
  if (DEBUG) {
    plugin.getLogger().info("String_Node_Str");
    if (island != null) {
      plugin.getLogger().info("String_Node_Str" + island.getIgsFlag(SettingsFlag.PORTAL));
      plugin.getLogger().info("String_Node_Str" + island.getMembers().contains(event.getPlayer().getUniqueId()));
      plugin.getLogger().info("String_Node_Str" + event.getPlayer().isOp());
      plugin.getLogger().info("String_Node_Str" + VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str"));
    }
 else {
      plugin.getLogger().info("String_Node_Str" + Settings.defaultWorldSettings.get(SettingsFlag.PORTAL));
      plugin.getLogger().info("String_Node_Str" + event.getPlayer().isOp());
      plugin.getLogger().info("String_Node_Str" + VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str"));
    }
  }
switch (event.getCause()) {
case END_PORTAL:
    if (!event.getFrom().getWorld().getEnvironment().equals(Environment.THE_END)) {
      if (plugin.getServer().getWorld(Settings.worldName + "String_Node_Str") != null) {
        event.setCancelled(true);
        Location end_place=plugin.getServer().getWorld(Settings.worldName + "String_Node_Str").getSpawnLocation();
        if (GridManager.isSafeLocation(end_place)) {
          event.getPlayer().teleport(end_place);
          return;
        }
 else {
          Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).warpserrorNotSafe);
          plugin.getGrid().homeTeleport(event.getPlayer());
          return;
        }
      }
    }
 else {
      event.setCancelled(true);
      plugin.getGrid().homeTeleport(event.getPlayer());
    }
  break;
case NETHER_PORTAL:
World homeWorld=ASkyBlock.getIslandWorld();
Location home=plugin.getPlayers().getHomeLocation(event.getPlayer().getUniqueId());
if (home != null) {
homeWorld=home.getWorld();
}
if (!Settings.newNether) {
if (event.getFrom().getWorld().getEnvironment().equals(Environment.NORMAL)) {
if (homeWorld.getEnvironment().equals(Environment.NORMAL)) {
event.setTo(ASkyBlock.getNetherWorld().getSpawnLocation());
event.useTravelAgent(true);
}
 else {
event.useTravelAgent(false);
Location dest=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (dest != null) {
  event.setTo(dest);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
}
}
}
 else {
if (homeWorld.getEnvironment().equals(Environment.NORMAL)) {
event.useTravelAgent(false);
Location dest=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (dest != null) {
  event.setTo(dest);
  Island islandTo=plugin.getGrid().getIslandAt(dest);
  final IslandEnterEvent event2=new IslandEnterEvent(event.getPlayer().getUniqueId(),islandTo,dest);
  plugin.getServer().getPluginManager().callEvent(event2);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
  Island islandTo=plugin.getGrid().getIslandAt(plugin.getPlayers().getIslandLocation(playerUUID));
  final IslandEnterEvent event2=new IslandEnterEvent(event.getPlayer().getUniqueId(),islandTo,plugin.getPlayers().getIslandLocation(playerUUID));
  plugin.getServer().getPluginManager().callEvent(event2);
}
}
 else {
event.setTo(ASkyBlock.getIslandWorld().getSpawnLocation());
event.useTravelAgent(true);
}
}
}
 else {
if (island == null) {
event.setCancelled(true);
return;
}
Location overworldIsland=island.getCenter().toVector().toLocation(ASkyBlock.getIslandWorld());
Location netherIsland=island.getCenter().toVector().toLocation(ASkyBlock.getNetherWorld());
if (event.getFrom().getWorld().getEnvironment().equals(Environment.NORMAL)) {
if (DEBUG) plugin.getLogger().info("String_Node_Str" + island.getCenter());
if (netherIsland.getBlock().getType() != Material.BEDROCK) {
if (plugin.getGrid().bigScan(netherIsland,20) == null) {
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  plugin.getLogger().warning("String_Node_Str" + event.getPlayer().getName() + "String_Node_Str");
  Schematic nether=IslandCmd.getSchematics().get("String_Node_Str");
  if (nether != null) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str" + island.getCenter().toVector());
    plugin.getIslandCmd().pasteSchematic(nether,netherIsland,event.getPlayer(),PasteReason.PARTNER);
    if (nether.isPlayerSpawn()) {
      plugin.getPlayers().setHomeLocation(event.getPlayer().getUniqueId(),nether.getPlayerSpawn(netherIsland),-2);
    }
  }
 else {
    plugin.getLogger().severe("String_Node_Str");
    event.setCancelled(true);
    Util.sendMessage(event.getPlayer(),ChatColor.RED + plugin.myLocale(event.getPlayer().getUniqueId()).warpserrorNotSafe);
    return;
  }
}
}
if (DEBUG) plugin.getLogger().info("String_Node_Str" + event.getFrom().toVector().toLocation(ASkyBlock.getNetherWorld()));
event.setCancelled(true);
new SafeSpotTeleport(plugin,event.getPlayer(),netherIsland);
return;
}
event.setCancelled(true);
new SafeSpotTeleport(plugin,event.getPlayer(),overworldIsland);
}
break;
default :
break;
}
}