Program: 33927
Project: 33927
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))) {
    if (event.getPlayer().isOp() || VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      return;
    }
    event.getPlayer().sendMessage(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 {
          event.getPlayer().sendMessage(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);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
}
}
 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());
  }
 else {
    plugin.getLogger().severe("String_Node_Str");
    event.setCancelled(true);
    event.getPlayer().sendMessage(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 (!event.getPlayer().isOp() && !VaultHelper.checkPerm(event.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
      event.getPlayer().sendMessage(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 {
          event.getPlayer().sendMessage(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);
}
 else {
  event.setCancelled(true);
  new SafeSpotTeleport(plugin,event.getPlayer(),plugin.getPlayers().getIslandLocation(playerUUID),1);
}
}
 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());
  }
 else {
    plugin.getLogger().severe("String_Node_Str");
    event.setCancelled(true);
    event.getPlayer().sendMessage(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;
}
}