Program: 172821
Project: 172821
Buggy source:
@Listener public void onPlayerInteract(HandInteractEvent event,@Root Player player){
  if (!EagleFactions.AdminList.contains(player.getUniqueId())) {
    if (event.getInteractionPoint().isPresent()) {
      World world=player.getWorld();
      if (MainLogic.getSafeZoneWorldNames().contains(world.getName()) && player.hasPermission(PluginPermissions.SAFE_ZONE_INTERACT)) {
        return;
      }
      if (MainLogic.getWarZoneWorldNames().contains(world.getName()) && player.hasPermission(PluginPermissions.WAR_ZONE_INTERACT)) {
        return;
      }
      Vector3d vector3d=event.getInteractionPoint().get();
      Location location=new Location(world,vector3d);
      Vector3i claim=location.getChunkPosition();
      Optional<Faction> optionalPlayerFaction=FactionLogic.getFactionByPlayerUUID(player.getUniqueId());
      Optional<Faction> optionalChunkFaction=FactionLogic.getFactionByChunk(world.getUniqueId(),claim);
      if (optionalChunkFaction.isPresent()) {
        if (optionalChunkFaction.get().Name.equals("String_Node_Str") && player.hasPermission(PluginPermissions.SAFE_ZONE_INTERACT)) {
          return;
        }
 else         if (optionalChunkFaction.get().Name.equals("String_Node_Str") && player.hasPermission(PluginPermissions.WAR_ZONE_INTERACT)) {
          return;
        }
 else         if (optionalPlayerFaction.isPresent()) {
          if (!FlagManager.canInteract(player,optionalPlayerFaction.get(),optionalChunkFaction.get())) {
            player.sendMessage(Text.of(PluginInfo.ErrorPrefix,PluginMessages.YOU_DONT_HAVE_PRIVILEGES_TO_INTERACT_HERE));
            event.setCancelled(true);
          }
        }
 else {
          event.setCancelled(true);
          player.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.YOU_DONT_HAVE_ACCESS_TO_DO_THIS));
          return;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Listener public void onPlayerInteract(HandInteractEvent event,@Root Player player){
  if (!EagleFactions.AdminList.contains(player.getUniqueId())) {
    if (event.getInteractionPoint().isPresent()) {
      World world=player.getWorld();
      if (MainLogic.getSafeZoneWorldNames().contains(world.getName()) && player.hasPermission(PluginPermissions.SAFE_ZONE_INTERACT)) {
        return;
      }
      if (MainLogic.getWarZoneWorldNames().contains(world.getName()) && player.hasPermission(PluginPermissions.WAR_ZONE_INTERACT)) {
        return;
      }
      Vector3d vector3d=event.getInteractionPoint().get();
      Location location=new Location(world,vector3d);
      Vector3i claim=location.getChunkPosition();
      Optional<Faction> optionalPlayerFaction=FactionLogic.getFactionByPlayerUUID(player.getUniqueId());
      Optional<Faction> optionalChunkFaction=FactionLogic.getFactionByChunk(world.getUniqueId(),claim);
      if (optionalChunkFaction.isPresent()) {
        if (optionalChunkFaction.get().Name.equals("String_Node_Str") && player.hasPermission(PluginPermissions.SAFE_ZONE_INTERACT)) {
          return;
        }
 else         if (optionalChunkFaction.get().Name.equals("String_Node_Str") && player.hasPermission(PluginPermissions.WAR_ZONE_INTERACT)) {
          return;
        }
 else         if (optionalPlayerFaction.isPresent()) {
          if (!FlagManager.canInteract(player,optionalPlayerFaction.get(),optionalChunkFaction.get())) {
            player.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.YOU_DONT_HAVE_PRIVILEGES_TO_INTERACT_HERE));
            event.setCancelled(true);
          }
        }
 else {
          event.setCancelled(true);
          player.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.YOU_DONT_HAVE_ACCESS_TO_DO_THIS));
          return;
        }
      }
    }
  }
}