Program: 33941
Project: 33941
Buggy source:
/** 
 * Prevents teleporting when falling based on setting and teleporting to locked islands
 * @param e
 */
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=false) public void onPlayerTeleport(final PlayerTeleportEvent e){
  if (DEBUG) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info("String_Node_Str" + e.getTo());
    plugin.getLogger().info("String_Node_Str" + e.getFrom());
  }
  if (e.getTo() == null || e.getFrom() == null) {
    return;
  }
  if (!IslandGuard.inWorld(e.getTo()) && !IslandGuard.inWorld(e.getFrom())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    return;
  }
  if (plugin.getGrid() == null) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    return;
  }
  if (!Settings.allowTeleportWhenFalling && e.getPlayer().getGameMode().equals(GameMode.SURVIVAL) && !e.getPlayer().isOp()) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (plugin.getPlayers().isInTeleport(e.getPlayer().getUniqueId())) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      unsetFalling(e.getPlayer().getUniqueId());
    }
 else     if (isFalling(e.getPlayer().getUniqueId())) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).islandcannotTeleport);
      e.setCancelled(true);
      if (e.getPlayer().getLocation().getBlockY() < 0) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.getPlayer().setHealth(0D);
        unsetFalling(e.getPlayer().getUniqueId());
      }
      return;
    }
  }
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  Island islandFrom=plugin.getGrid().getProtectedIslandAt(e.getFrom());
  if (DEBUG && islandFrom != null)   plugin.getLogger().info("String_Node_Str");
  Island islandTo=plugin.getGrid().getProtectedIslandAt(e.getTo());
  if (DEBUG && islandTo != null)   plugin.getLogger().info("String_Node_Str");
  if (e.getCause() != null) {
    if (e.getCause().equals(TeleportCause.ENDER_PEARL)) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (islandTo == null) {
        if (Settings.allowEnderPearls) {
          return;
        }
      }
 else {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        if (islandTo.isSpawn()) {
          if (DEBUG)           plugin.getLogger().info("String_Node_Str");
          if (Settings.allowSpawnEnderPearls) {
            if (DEBUG)             plugin.getLogger().info("String_Node_Str");
            return;
          }
        }
 else {
          if (DEBUG)           plugin.getLogger().info("String_Node_Str");
          if (islandTo.getIgsFlag(Flags.allowEnderPearls) || islandTo.getMembers().contains(e.getPlayer().getUniqueId())) {
            if (DEBUG)             plugin.getLogger().info("String_Node_Str");
            return;
          }
        }
      }
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
      e.setCancelled(true);
      return;
    }
 else     if (!plugin.getServer().getVersion().contains("String_Node_Str") && !plugin.getServer().getVersion().contains("String_Node_Str")) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (e.getCause().equals(TeleportCause.CHORUS_FRUIT)) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        boolean cancel=false;
        if (islandTo == null) {
          if (!Settings.allowChorusFruit) {
            cancel=true;
          }
        }
 else {
          if (islandTo.isSpawn()) {
            if (!Settings.allowSpawnChorusFruit) {
              cancel=true;
            }
          }
 else {
            if (!islandTo.getIgsFlag(Flags.allowChorusFruit) && !islandTo.getMembers().contains(e.getPlayer().getUniqueId())) {
              cancel=true;
            }
          }
        }
        if (islandFrom == null) {
          if (!Settings.allowChorusFruit) {
            cancel=true;
          }
        }
 else {
          if (islandFrom.isSpawn()) {
            if (!Settings.allowSpawnChorusFruit) {
              cancel=true;
            }
          }
 else {
            if (!islandFrom.getIgsFlag(Flags.allowChorusFruit) && !islandFrom.getMembers().contains(e.getPlayer().getUniqueId())) {
              cancel=true;
            }
          }
        }
        if (cancel) {
          e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
          e.setCancelled(true);
        }
        return;
      }
    }
  }
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  if (islandTo != null && islandFrom == null && (islandTo.getOwner() != null || islandTo.isSpawn())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).lockIslandLocked);
      if (!plugin.getGrid().locationIsOnIsland(e.getPlayer(),e.getTo()) && !e.getPlayer().isOp() && !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")&& !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.setCancelled(true);
        return;
      }
    }
    if (islandTo.isSpawn()) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn);
      }
    }
 else {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.replace("String_Node_Str",plugin.getGrid().getIslandName(islandTo.getOwner())));
      }
    }
    final IslandEnterEvent event=new IslandEnterEvent(e.getPlayer().getUniqueId(),islandTo,e.getTo());
    plugin.getServer().getPluginManager().callEvent(event);
  }
 else   if (islandTo == null && islandFrom != null && (islandFrom.getOwner() != null || islandFrom.isSpawn())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandFrom.isSpawn()) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn);
      }
    }
 else {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.replace("String_Node_Str",plugin.getGrid().getIslandName(islandFrom.getOwner())));
      }
    }
    final IslandExitEvent event=new IslandExitEvent(e.getPlayer().getUniqueId(),islandFrom,e.getFrom());
    plugin.getServer().getPluginManager().callEvent(event);
  }
 else   if (islandTo != null && islandFrom != null && !islandTo.equals(islandFrom)) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).lockIslandLocked);
      if (!plugin.getGrid().locationIsOnIsland(e.getPlayer(),e.getTo()) && !e.getPlayer().isOp() && !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")&& !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.setCancelled(true);
        return;
      }
    }
    if (islandFrom.isSpawn()) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn);
    }
 else     if (islandFrom.getOwner() != null) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.replace("String_Node_Str",plugin.getGrid().getIslandName(islandFrom.getOwner())));
    }
    if (islandTo.isSpawn()) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn);
    }
 else     if (islandTo.getOwner() != null) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.replace("String_Node_Str",plugin.getGrid().getIslandName(islandTo.getOwner())));
    }
    final IslandExitEvent event=new IslandExitEvent(e.getPlayer().getUniqueId(),islandTo,e.getTo());
    plugin.getServer().getPluginManager().callEvent(event);
    final IslandEnterEvent event2=new IslandEnterEvent(e.getPlayer().getUniqueId(),islandFrom,e.getFrom());
    plugin.getServer().getPluginManager().callEvent(event2);
  }
}

Fixed version (ground truth):
/** 
 * Prevents teleporting when falling based on setting and teleporting to locked islands
 * @param e
 */
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onPlayerTeleport(final PlayerTeleportEvent e){
  if (DEBUG) {
    plugin.getLogger().info(e.getEventName());
    plugin.getLogger().info("String_Node_Str" + e.getTo());
    plugin.getLogger().info("String_Node_Str" + e.getFrom());
  }
  if (e.getTo() == null || e.getFrom() == null) {
    return;
  }
  if (!IslandGuard.inWorld(e.getTo()) && !IslandGuard.inWorld(e.getFrom())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    return;
  }
  if (plugin.getGrid() == null) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    return;
  }
  if (!Settings.allowTeleportWhenFalling && e.getPlayer().getGameMode().equals(GameMode.SURVIVAL) && !e.getPlayer().isOp()) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (plugin.getPlayers().isInTeleport(e.getPlayer().getUniqueId())) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      unsetFalling(e.getPlayer().getUniqueId());
    }
 else     if (isFalling(e.getPlayer().getUniqueId())) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).islandcannotTeleport);
      e.setCancelled(true);
      if (e.getPlayer().getLocation().getBlockY() < 0) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.getPlayer().setHealth(0D);
        unsetFalling(e.getPlayer().getUniqueId());
      }
      return;
    }
  }
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  Island islandFrom=plugin.getGrid().getProtectedIslandAt(e.getFrom());
  if (DEBUG && islandFrom != null)   plugin.getLogger().info("String_Node_Str");
  Island islandTo=plugin.getGrid().getProtectedIslandAt(e.getTo());
  if (DEBUG && islandTo != null)   plugin.getLogger().info("String_Node_Str");
  if (e.getCause() != null) {
    if (e.getCause().equals(TeleportCause.ENDER_PEARL)) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (islandTo == null) {
        if (Settings.allowEnderPearls) {
          return;
        }
      }
 else {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        if (islandTo.isSpawn()) {
          if (DEBUG)           plugin.getLogger().info("String_Node_Str");
          if (Settings.allowSpawnEnderPearls) {
            if (DEBUG)             plugin.getLogger().info("String_Node_Str");
            return;
          }
        }
 else {
          if (DEBUG)           plugin.getLogger().info("String_Node_Str");
          if (islandTo.getIgsFlag(Flags.allowEnderPearls) || islandTo.getMembers().contains(e.getPlayer().getUniqueId())) {
            if (DEBUG)             plugin.getLogger().info("String_Node_Str");
            return;
          }
        }
      }
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
      e.setCancelled(true);
      return;
    }
 else     if (!plugin.getServer().getVersion().contains("String_Node_Str") && !plugin.getServer().getVersion().contains("String_Node_Str")) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (e.getCause().equals(TeleportCause.CHORUS_FRUIT)) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        boolean cancel=false;
        if (islandTo == null) {
          if (!Settings.allowChorusFruit) {
            cancel=true;
          }
        }
 else {
          if (islandTo.isSpawn()) {
            if (!Settings.allowSpawnChorusFruit) {
              cancel=true;
            }
          }
 else {
            if (!islandTo.getIgsFlag(Flags.allowChorusFruit) && !islandTo.getMembers().contains(e.getPlayer().getUniqueId())) {
              cancel=true;
            }
          }
        }
        if (islandFrom == null) {
          if (!Settings.allowChorusFruit) {
            cancel=true;
          }
        }
 else {
          if (islandFrom.isSpawn()) {
            if (!Settings.allowSpawnChorusFruit) {
              cancel=true;
            }
          }
 else {
            if (!islandFrom.getIgsFlag(Flags.allowChorusFruit) && !islandFrom.getMembers().contains(e.getPlayer().getUniqueId())) {
              cancel=true;
            }
          }
        }
        if (cancel) {
          e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
          e.setCancelled(true);
        }
        return;
      }
    }
  }
  if (DEBUG)   plugin.getLogger().info("String_Node_Str");
  if (islandTo != null && islandFrom == null && (islandTo.getOwner() != null || islandTo.isSpawn())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).lockIslandLocked);
      if (!plugin.getGrid().locationIsOnIsland(e.getPlayer(),e.getTo()) && !e.getPlayer().isOp() && !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")&& !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.setCancelled(true);
        return;
      }
    }
    if (islandTo.isSpawn()) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn);
      }
    }
 else {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.replace("String_Node_Str",plugin.getGrid().getIslandName(islandTo.getOwner())));
      }
    }
    final IslandEnterEvent event=new IslandEnterEvent(e.getPlayer().getUniqueId(),islandTo,e.getTo());
    plugin.getServer().getPluginManager().callEvent(event);
  }
 else   if (islandTo == null && islandFrom != null && (islandFrom.getOwner() != null || islandFrom.isSpawn())) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandFrom.isSpawn()) {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn);
      }
    }
 else {
      if (DEBUG)       plugin.getLogger().info("String_Node_Str");
      if (!plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.isEmpty()) {
        e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.replace("String_Node_Str",plugin.getGrid().getIslandName(islandFrom.getOwner())));
      }
    }
    final IslandExitEvent event=new IslandExitEvent(e.getPlayer().getUniqueId(),islandFrom,e.getFrom());
    plugin.getServer().getPluginManager().callEvent(event);
  }
 else   if (islandTo != null && islandFrom != null && !islandTo.equals(islandFrom)) {
    if (DEBUG)     plugin.getLogger().info("String_Node_Str");
    if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
      e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).lockIslandLocked);
      if (!plugin.getGrid().locationIsOnIsland(e.getPlayer(),e.getTo()) && !e.getPlayer().isOp() && !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")&& !VaultHelper.checkPerm(e.getPlayer(),Settings.PERMPREFIX + "String_Node_Str")) {
        if (DEBUG)         plugin.getLogger().info("String_Node_Str");
        e.setCancelled(true);
        return;
      }
    }
    if (islandFrom.isSpawn()) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockLeavingSpawn);
    }
 else     if (islandFrom.getOwner() != null) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowLeaving.replace("String_Node_Str",plugin.getGrid().getIslandName(islandFrom.getOwner())));
    }
    if (islandTo.isSpawn()) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockEnteringSpawn);
    }
 else     if (islandTo.getOwner() != null) {
      e.getPlayer().sendMessage(plugin.myLocale(e.getPlayer().getUniqueId()).lockNowEntering.replace("String_Node_Str",plugin.getGrid().getIslandName(islandTo.getOwner())));
    }
    final IslandExitEvent event=new IslandExitEvent(e.getPlayer().getUniqueId(),islandTo,e.getTo());
    plugin.getServer().getPluginManager().callEvent(event);
    final IslandEnterEvent event2=new IslandEnterEvent(e.getPlayer().getUniqueId(),islandFrom,e.getFrom());
    plugin.getServer().getPluginManager().callEvent(event2);
  }
}