protected void updateScanner() {
        int offset;
        double actualScanRange = player.ship.scanRange;

        if (disabled) return;

        if (player.ship.nebulaTarget != null)
            actualScanRange = 1000;

        if (showHelpScreen) {
            showHelpScreen();
            return;
        }

        if (this.showPlayerPage != 0) {
            showPlayers();
            return;
        }

        if (showStats) {
            showShipStats(targetShip);
            return;
        }

        if (showOptionScreen) {
            showOptionScreen();
            return;
        }


        if (showOdometer) {
            showOdometerPage();
            return;
        }

        if (showInventory) {
            showInventoryScreen();
            return;
        }

        if (!TrekMath.canScanShip(player.ship, player.ship.scanTarget)) {
            clearScanner();
        }

        if (player.ship.scanTarget == null) {
            return;
        }


        // correct NPE when currently scanned object has been removed from quadrant since last tick
        // ie, shot/expired drone/mine/buoy/obs device, or a player quitting, saving, etc.
        if (!player.ship.currentQuadrant.isInQuadrant(player.ship.scanTarget)) {
            player.ship.scanTarget = null;
            return;
        }

        try {

            // option is really only for updating your own ship's xyz; you always want to have
            // the up-to-date info on scanned objects/ships
            //if (player.playerOptions.getOption(TrekPlayerOptions.OPTION_XYZUPDATE) == 0) {
            setHudValue("ScanCurrentX", new Integer(new Double(player.ship.scanTarget.point.x).intValue()).toString());
            setHudValue("ScanCurrentY", new Integer(new Double(player.ship.scanTarget.point.y).intValue()).toString());
            setHudValue("ScanCurrentZ", new Integer(new Double(player.ship.scanTarget.point.z).intValue()).toString());
            //}
            //else {
            //	if ((tick % player.playerOptions.getOption(TrekPlayerOptions.OPTION_XYZUPDATE)) == 0) {
            //		setHudValue("ScanCurrentX", new Integer(new Double(player.ship.scanTarget.point.x).intValue()).toString());
            //		setHudValue("ScanCurrentY", new Integer(new Double(player.ship.scanTarget.point.y).intValue()).toString());
            //		setHudValue("ScanCurrentZ", new Integer(new Double(player.ship.scanTarget.point.z).intValue()).toString());
            //	}
            //}

            if (TrekUtilities.isObjectShip(player.ship.scanTarget)) {
                TrekShip thisShip = null;
                String scanName = "";
                boolean observerScan = false;

                if (TrekUtilities.isObjectShip(player.ship.scanTarget)) {
                    thisShip = (TrekShip) player.ship.scanTarget;
                    scanName = thisShip.name;
                }

                if (TrekUtilities.isObjectObserverDevice(player.ship.scanTarget)) {
                    observerScan = true;
                    TrekObserverDevice observer = (TrekObserverDevice) player.ship.scanTarget;

                    if (observer.isScanning()) {
                        thisShip = observer.scanTarget;
                        scanName = observer.scanTarget.name;

                        // update the observed ship's coord in ship spotted database
                        if (player.ship.scannedHistory.containsKey(thisShip.scanLetter)) {
                            player.ship.scannedHistory.remove(thisShip.scanLetter);
                        }

                        player.ship.scannedHistory.put(thisShip.scanLetter, new TrekCoordHistory(thisShip.scanLetter, thisShip.name, new Trek3DPoint(thisShip.point)));
                    }
                }

                if (thisShip != null) {
                    // Draw the object name.
                    drawScannerLine(3, format(scanName, "", 20));

                    boolean canSeeFull = false;
                    double distance = TrekMath.getDistance(player.ship, thisShip);

                    if (distance < (actualScanRange * .90))
                        canSeeFull = true;

                    String buffer = "", buffer1 = "", buffer2 = "";

                    buffer = format("Warp Energy:", new Integer(thisShip.getWarpEnergy()).toString(), 20);
                    drawScannerLine(4, buffer);

                    buffer = format("Impulse Energy:", new Integer(thisShip.impulseEnergy).toString(), 20);
                    drawScannerLine(5, buffer);

                    buffer = format("Power Unused:", new Integer(thisShip.getAvailablePower()).toString(), 20);
                    drawScannerLine(6, buffer);

                    buffer = format("Warp:", getFormattedWarpSpeed(thisShip.warpSpeed), 20);
                    drawScannerLine(7, buffer);

                    if (canSeeFull)
                        buffer = format("Shields:", new Integer(thisShip.shields).toString() + "%", 20);
                    else
                        buffer = format("Shields:", "---%", 20);

                    drawScannerLine(8, buffer);

                    buffer1 = format("Ph:", new Integer(thisShip.phasers).toString(), 7);
                    buffer2 = getHudValueString("ScanPhasers");

                    if (!buffer2.equals(buffer1)) {
                        offset = getOffset(buffer2, buffer1);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(9, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                        } else {
                            player.sendText(TrekAnsi.locate(9, 60, player) + buffer1);
                        }

                        setHudValue("ScanPhasers", buffer1);
                    }

                    buffer2 = format("Damage:", new Integer(thisShip.damage).toString(), 11);
                    buffer1 = getHudValueString("ScanDamage");

                    if (!buffer1.equals(buffer2)) {
                        offset = getOffset(buffer1, buffer2);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(9, 69 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                        } else {
                            player.sendText(TrekAnsi.locate(9, 69, player) + buffer2);
                        }

                        setHudValue("ScanDamage", buffer2);
                    }

                    setHudValue("MyScannerLine9", "Empty");

                    buffer1 = format("Tp:", new Integer(thisShip.torpedoes).toString(), 7);
                    buffer2 = getHudValueString("ScanTorpedoes");

                    if (!buffer2.equals(buffer1)) {
                        offset = getOffset(buffer2, buffer1);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(10, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                        } else {
                            player.sendText(TrekAnsi.locate(10, 60, player) + buffer1);
                        }

                        setHudValue("ScanTorpedoes", buffer1);
                    }

                    buffer2 = format("DmgCtl:", new Integer(thisShip.damageControl).toString(), 11);
                    buffer1 = getHudValueString("ScanDamageControl");

                    if (!buffer1.equals(buffer2)) {
                        offset = getOffset(buffer1, buffer2);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(10, 69 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                        } else {
                            player.sendText(TrekAnsi.locate(10, 69, player) + buffer2);
                        }

                        setHudValue("ScanDamageControl", buffer2);
                    }

                    setHudValue("MyScannerLine10", "Empty");

                    if (canSeeFull)
                        buffer = format("Life Support:", new Integer(thisShip.lifeSupport).toString() + "%", 20);
                    else
                        buffer = format("Life Support:", "---%", 20);

                    drawScannerLine(11, buffer);

                    buffer = format("Anti-Matter", new Integer(thisShip.antiMatter).toString(), 20);
                    drawScannerLine(12, buffer);

                    buffer1 = format("X:", getHudValueString("ScanCurrentX"), 9);
                    buffer2 = getHudValueString("ScanHudX");

                    if (!buffer2.equals(buffer1)) {
                        offset = getOffset(buffer2, buffer1);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(13, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                        } else {
                            player.sendText(TrekAnsi.locate(13, 60, player) + buffer1);
                        }

                        setHudValue("ScanHudX", buffer1);
                    }

                    if (thisShip.cloak) {
                        if (observerScan)
                            buffer2 = format("Cloak:", "" + thisShip.cloakTimeCurrent, 10);
                        else
                            buffer2 = format("Cloak:", "---", 10);
                    } else {
                        if (thisShip.drones) {
                            if (observerScan)
                                buffer2 = format("Drones:", "" + thisShip.droneCount, 10);
                            else
                                buffer2 = format("Drones:", "---", 10);

                        } else if (thisShip.mines) {
                            if (observerScan)
                                buffer2 = format("Mines:", "" + thisShip.mineCount, 10);
                            else
                                buffer2 = format("Mines:", "---", 10);
                        } else {
                            buffer2 = TrekAnsi.eraseToEndOfLine(player);
                        }
                    }

                    buffer1 = getHudValueString("ScanHudX2");

                    if (!buffer1.equals(buffer2)) {
                        offset = getOffset(buffer1, buffer2);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(13, 70 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                        } else {
                            player.sendText(TrekAnsi.locate(13, 70, player) + buffer2);
                        }

                        setHudValue("ScanHudX2", buffer2);
                    }

                    setHudValue("MyScannerLine13", "Empty");

                    buffer1 = format("Y:", getHudValueString("ScanCurrentY"), 9);
                    buffer2 = getHudValueString("ScanHudY");

                    if (!buffer2.equals(buffer1)) {
                        offset = getOffset(buffer2, buffer1);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(14, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                        } else {
                            player.sendText(TrekAnsi.locate(14, 60, player) + buffer1);
                        }

                        setHudValue("ScanHudY", buffer1);
                    }

                    if (thisShip.cloak) {
                        if (thisShip.drones) {
                            if (observerScan)
                                buffer2 = format("Drones:", "" + thisShip.droneCount, 10);
                            else
                                buffer2 = format("Drones:", "---", 10);
                        } else if (thisShip.mines) {
                            if (observerScan)
                                buffer2 = format("Mines:", "" + thisShip.mineCount, 10);
                            else
                                buffer2 = format("Mines:", "---", 10);
                        } else {
                            buffer2 = "          ";
                        }
                    } else {
                        if (thisShip.mines) {
                            if (thisShip.cloak || thisShip.drones) {
                                if (observerScan)
                                    buffer2 = format("Mines:", "" + thisShip.mineCount, 10);
                                else
                                    buffer2 = format("Mines:", "---", 10);
                            }
                        } else {
                            buffer2 = "          ";
                        }
                    }

                    buffer1 = getHudValueString("ScanHudY2");

                    if (!buffer1.equals(buffer2)) {
                        offset = getOffset(buffer1, buffer2);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(14, 70 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                        } else {
                            player.sendText(TrekAnsi.locate(14, 70, player) + buffer2);
                        }

                        setHudValue("ScanHudY2", buffer2);
                    }

                    setHudValue("MyScannerLine14", "Empty");

                    buffer1 = format("Z:", getHudValueString("ScanCurrentZ"), 9);
                    buffer2 = getHudValueString("ScanHudZ");

                    if (!buffer2.equals(buffer1)) {
                        offset = getOffset(buffer2, buffer1);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(15, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                        } else {
                            player.sendText(TrekAnsi.locate(15, 60, player) + buffer1);
                        }

                        setHudValue("ScanHudZ", buffer1);
                    }


                    if (player.playerOptions.getOption(TrekPlayerOptions.OPTION_BEARINGUPDATE) == 0) {
                        setHudValue("ScanCurrentHD", format("HD:", thisShip.getHeading() + "'" + thisShip.getPitch(), 10));
                    } else {
                        if ((tick % player.playerOptions.getOption(TrekPlayerOptions.OPTION_BEARINGUPDATE)) == 0) {
                            setHudValue("ScanCurrentHD", format("HD:", thisShip.getHeading() + "'" + thisShip.getPitch(), 10));
                        }
                    }


                    buffer2 = getHudValueString("ScanCurrentHD");
                    buffer1 = getHudValueString("ScanHudZ2");

                    if (!buffer1.equals(buffer2)) {
                        offset = getOffset(buffer1, buffer2);

                        if (offset != 0) {
                            player.sendText(TrekAnsi.locate(15, 70 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                        } else {
                            player.sendText(TrekAnsi.locate(15, 70, player) + buffer2);
                        }

                        setHudValue("ScanHudZ2", buffer2);
                    }

                    setHudValue("MyScannerLine15", "Empty");

                    if (thisShip.shipClass.equals("INTERCEPTOR")) {
                        buffer = format("Gold:" + new Integer(thisShip.gold).toString(), "INTRCPTR", 20);
                    } else {
                        buffer = format("Gold:" + new Integer(thisShip.gold).toString(), thisShip.shipClass, 20);
                    }
                    drawScannerLine(16, buffer);

                    return;
                }
            }

            // Default lines for all other objects.
            // Draw the object name.
            drawScannerLine(3, format(player.ship.scanTarget.name, "", 20));

            String distance = new Integer(new Double(Math.round(TrekMath.getDistance(player.ship, player.ship.scanTarget))).intValue()).toString();
            String blankScannerLine = TrekAnsi.eraseToEndOfLine(player);

            boolean canSeeFull = false;

            if (TrekMath.getDistance(player.ship, player.ship.scanTarget) < (player.ship.scanRange * .90))
                canSeeFull = true;

            if (player.playerOptions.getOption(TrekPlayerOptions.OPTION_RANGEUPDATE) == 0) {
                setHudValue("ScanCurrentRange", distance);
            } else {
                if ((tick % player.playerOptions.getOption(TrekPlayerOptions.OPTION_RANGEUPDATE)) == 0) {
                    setHudValue("ScanCurrentRange", distance);
                }
            }

            drawScannerLine(6, format("Distance:", getHudValueString("ScanCurrentRange"), 20));

            // don't display common xyz aspects if the scanTarget is an observer device that is scanning a target
            if ((!TrekUtilities.isObjectObserverDevice(player.ship.scanTarget)) ||
                    ((TrekUtilities.isObjectObserverDevice(player.ship.scanTarget)) &&
                            !((TrekObserverDevice) player.ship.scanTarget).isScanning())) {
                drawScannerLine(13, format("X:" + format("", getHudValueString("ScanCurrentX"), 7), "", 20));
                drawScannerLine(14, format("Y:" + format("", getHudValueString("ScanCurrentY"), 7), "", 20));
                // don't display common z line, if the object is a drone (so that we can display drone heading/pitch)
                // ditto with comet
                if (!TrekUtilities.isObjectDrone(player.ship.scanTarget) &&
                        !TrekUtilities.isObjectComet(player.ship.scanTarget))
                    drawScannerLine(15, format("Z:" + format("", getHudValueString("ScanCurrentZ"), 7), "", 20));
            }

            // If it is a Starbase.
            if (TrekUtilities.isObjectStarbase(player.ship.scanTarget)) {
                TrekStarbase base = (TrekStarbase) player.ship.scanTarget;
                String buffer1 = "";

                buffer1 += (base.fixesLifeSupport) ? "L " : "";
                buffer1 += (base.givesMines) ? "M " : "";
                buffer1 += (base.givesDrones) ? "D " : "";
                buffer1 += (base.givesTorps) ? "T " : "";

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);

                if (canSeeFull) {
                    drawScannerLine(7, format("Damage:", "" + base.damage, 20));
                    drawScannerLine(8, format("Gold:", "" + base.gold, 20));
                } else {
                    drawScannerLine(7, format("Damage:", "----", 20));
                    drawScannerLine(8, format("Gold:", "------", 20));
                }

                drawScannerLine(9, format("Code: " + buffer1, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);
            }

            if (TrekUtilities.isObjectPlanet(player.ship.scanTarget)) {
                TrekPlanet planet = (TrekPlanet) player.ship.scanTarget;
                String buffer1 = "";

                buffer1 = "";
                buffer1 += (planet.givesCrystals(player.ship)) ? "C " : "";
                buffer1 += (planet.repairsLifeSupport(player.ship)) ? "L " : "";
                buffer1 += (planet.givesMines(player.ship)) ? "M " : "";
                buffer1 += (planet.givesDrones(player.ship)) ? "D " : "";
                buffer1 += (planet.givesTorps(player.ship)) ? "T " : "";
                buffer1 += (planet.givesAntimatter(player.ship)) ? "A " : "";
                buffer1 += (planet.fixesCloak(player.ship)) ? "FC " : "";
                buffer1 += (planet.fixesTransmitter(player.ship)) ? "FR " : "";
                buffer1 += (planet.installsTranswarp(player.ship)) ? "TW " : "";
                buffer1 += (planet.givesCorbomite(player.ship)) ? "CM " : "";
                buffer1 += (planet.givesNeutron(player.ship)) ? "N " : "";
                buffer1 += (planet.givesIridium(player.ship)) ? "I " : "";
                buffer1 += (planet.givesMagnabuoy(player.ship)) ? "MB " : "";

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);

                if (canSeeFull) {
                    drawScannerLine(7, format("Damage:", "" + planet.damage, 20));
                    drawScannerLine(8, format("Gold:", "" + planet.gold, 20));
                } else {
                    drawScannerLine(7, format("Damage:", "----", 20));
                    drawScannerLine(8, format("Gold:", "------", 20));
                }

                drawScannerLine(9, format("Code: " + buffer1, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);
            }

            if (TrekUtilities.isObjectDrone(player.ship.scanTarget)) {
                TrekDrone drone = (TrekDrone) player.ship.scanTarget;
                String buffer1, buffer2 = "";

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, format("Energy:", "" + drone.strength, 20));
                drawScannerLine(8, format("Warp:", getFormattedWarpSpeed(drone.warpSpeed), 20));
                drawScannerLine(9, format("Creator:", "", 20));
                drawScannerLine(10, format(drone.owner.name, "", 20));
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                buffer1 = format("Z:", getHudValueString("ScanCurrentZ"), 9);
                buffer2 = getHudValueString("ScanHudZ");

                if (!buffer2.equals(buffer1)) {
                    offset = getOffset(buffer2, buffer1);

                    if (offset != 0) {
                        player.sendText(TrekAnsi.locate(15, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                    } else {
                        player.sendText(TrekAnsi.locate(15, 60, player) + buffer1);
                    }

                    setHudValue("ScanHudZ", buffer1);
                }

                buffer2 = format("HD:", drone.getYaw() + "'" + drone.getPitch(), 10);
                buffer1 = getHudValueString("ScanHudZ2");

                if (!buffer1.equals(buffer2)) {
                    offset = getOffset(buffer1, buffer2);

                    if (offset != 0) {
                        player.sendText(TrekAnsi.locate(15, 70 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                    } else {
                        player.sendText(TrekAnsi.locate(15, 70, player) + buffer2);
                    }

                    setHudValue("ScanHudZ2", buffer2);
                }
                setHudValue("MyScannerLine15", "Empty");

                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectObserverDevice(player.ship.scanTarget)) {
                TrekObserverDevice observer = (TrekObserverDevice) player.ship.scanTarget;
                if (observer.isScanning()) {
                    TrekShip obsScannedShip = observer.scanTarget;
                    drawScannerLine(4, format("[" + observer.scanTarget.name + "]", "", 20));
                    StringBuffer curLine = new StringBuffer();
                    curLine.append(format("WE:", new Integer(obsScannedShip.warpEnergy + obsScannedShip.currentCrystalCount).toString(), 7));
                    curLine.append(format("   Warp:", getFormattedWarpSpeed(obsScannedShip.warpSpeed), 13));
                    drawScannerLine(7, curLine.toString());
                    curLine = new StringBuffer();
                    curLine.append(format("IE:", new Integer(obsScannedShip.impulseEnergy).toString(), 7));
                    curLine.append(format("  Shlds:", new Integer(obsScannedShip.shields).toString() + "%", 13));
                    drawScannerLine(8, curLine.toString());
                    curLine = new StringBuffer();
                    curLine.append(format("Pwr:", new Integer(obsScannedShip.getAvailablePower()).toString(), 7));
                    curLine.append(format(" Damage:", new Integer(obsScannedShip.damage).toString(), 13));
                    drawScannerLine(9, curLine.toString());
                    curLine = new StringBuffer();
                    curLine.append(format("T:", new Integer(obsScannedShip.torpedoCount).toString(), 7));
                    curLine.append(format("  D:", new Integer(obsScannedShip.droneCount).toString(), 7));
                    curLine.append(format(" M:", new Integer(obsScannedShip.mineCount).toString(), 6));
                    drawScannerLine(10, curLine.toString());
                    curLine = new StringBuffer();
                    curLine.append(format("AM:", new Integer(obsScannedShip.antiMatter).toString(), 7));
                    curLine.append(format("     LS:", new Integer(obsScannedShip.lifeSupport).toString() + "%", 13));
                    drawScannerLine(11, curLine.toString());
                    curLine = new StringBuffer();
                    curLine.append(format("HD:", obsScannedShip.getHeading() + "'" + obsScannedShip.getPitch(), 10));
                    if (obsScannedShip.shipClass.equals("INTERCEPTOR")) {
                        curLine.append(format("", "INTRCPTR", 10));
                    } else {
                        curLine.append(format("", obsScannedShip.shipClass, 10));
                    }
                    drawScannerLine(12, curLine.toString());

                    drawScannerLine(13, format(format("X:", getHudValueString("ScanCurrentX"), 9),
                            format("[X:", obsScannedShip.point.getXString() + "]", 11), 20));
                    drawScannerLine(14, format(format("Y:", getHudValueString("ScanCurrentY"), 9),
                            format("[Y", obsScannedShip.point.getYString() + "]", 11), 20));
                    drawScannerLine(15, format(format("Z:", getHudValueString("ScanCurrentZ"), 9),
                            format("[Z:", obsScannedShip.point.getZString() + "]", 11), 20));

                    // update the observed ship's coord in ship spotted database
                    if (player.ship.scannedHistory.containsKey(obsScannedShip.scanLetter)) {
                        player.ship.scannedHistory.remove(obsScannedShip.scanLetter);
                    }
                    player.ship.scannedHistory.put(obsScannedShip.scanLetter, new TrekCoordHistory(obsScannedShip.scanLetter, obsScannedShip.name, new Trek3DPoint(obsScannedShip.point)));

                } else {
                    drawScannerLine(4, blankScannerLine);
                    drawScannerLine(7, format("Warp:", getFormattedWarpSpeed(observer.warpSpeed), 20));
                    drawScannerLine(8, blankScannerLine);
                    drawScannerLine(9, blankScannerLine);
                    drawScannerLine(10, blankScannerLine);
                    drawScannerLine(11, blankScannerLine);
                    drawScannerLine(12, blankScannerLine);
                }
                // common elements regardless of whether obs has scan target
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectTorpedo(player.ship.scanTarget)) {
                TrekTorpedo torpedo = (TrekTorpedo) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                if (torpedo.torpType == TrekShip.TORPEDO_WARHEAD) {
                    drawScannerLine(5, format("Damage:", "" + torpedo.damage, 20));
                } else {
                    drawScannerLine(5, blankScannerLine);
                }
                drawScannerLine(7, format("Energy:", "" + torpedo.strength, 20));
                drawScannerLine(8, format("Warp:", getFormattedWarpSpeed(torpedo.warpSpeed), 20));
                drawScannerLine(9, format("Creator:", "", 20));
                drawScannerLine(10, format(torpedo.owner.name, "", 20));
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectMine(player.ship.scanTarget)) {
                TrekMine mine = (TrekMine) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, format("Energy:", "" + mine.strength, 20));
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(mine.owner.name, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectBuoy(player.ship.scanTarget)) {
                TrekBuoy buoy = (TrekBuoy) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, blankScannerLine);
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(buoy.owner.name, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                if (player.ship instanceof ShipQ)
                    drawScannerLine(16, format("Ownr Cnctn:", new Long(buoy.buoyConn).toString(), 20));
                else
                    drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectCorbomite(player.ship.scanTarget)) {
                TrekCorbomite corbomite = (TrekCorbomite) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, format("Energy:", corbomite.energy, 20));
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(corbomite.owner.name, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectIridium(player.ship.scanTarget)) {
                TrekIridium iridium = (TrekIridium) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, blankScannerLine);
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(iridium.owner.name, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectMagnabuoy(player.ship.scanTarget)) {
                TrekMagnabuoy magnabuoy = (TrekMagnabuoy) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, blankScannerLine);
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(magnabuoy.owner.name, "", 20));
                drawScannerLine(10, format("Locked On:", "", 20));
                drawScannerLine(11, format(magnabuoy.target.name, "", 20));
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectNeutron(player.ship.scanTarget)) {
                TrekNeutron neutron = (TrekNeutron) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, blankScannerLine);
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, format(neutron.owner.name, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectShipDebris(player.ship.scanTarget)) {
                TrekShipDebris debris = (TrekShipDebris) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);

                if (debris.gold > 0) {
                    drawScannerLine(7, format("Gold:", new Integer(debris.gold).toString(), 20));
                } else {
                    drawScannerLine(7, format("Gold:", "0", 20));
                }

                drawScannerLine(8, format("Remains of:", "", 20));
                drawScannerLine(9, format(debris.whos, "", 20));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);
                drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectGold(player.ship.scanTarget)) {
                TrekGold gold = (TrekGold) player.ship.scanTarget;

                drawScannerLine(4, blankScannerLine);
                drawScannerLine(5, blankScannerLine);
                drawScannerLine(7, format("Amount:", gold.amount, 20));
                drawScannerLine(8, format("Creator:", "", 20));
                drawScannerLine(9, gold.ownerName + TrekAnsi.eraseToEndOfLine(player));
                drawScannerLine(10, blankScannerLine);
                drawScannerLine(11, blankScannerLine);
                drawScannerLine(12, blankScannerLine);

                if (player.ship instanceof ShipQ)
                    drawScannerLine(16, format("Lifetime:", gold.goldTimeout, 20));
                else
                    drawScannerLine(16, blankScannerLine);

                return;
            }

            if (TrekUtilities.isObjectComet(player.ship.scanTarget)) {
                String buffer1, buffer2;
                TrekComet comet = (TrekComet) player.ship.scanTarget;
                drawScannerLine(7, format("Warp:", getFormattedWarpSpeed(comet.warpSpeed), 20));
                buffer1 = format("Z:", getHudValueString("ScanCurrentZ"), 9);
                buffer2 = getHudValueString("ScanHudZ");

                if (!buffer2.equals(buffer1)) {
                    offset = getOffset(buffer2, buffer1);

                    if (offset != 0) {
                        player.sendText(TrekAnsi.locate(15, 60 + offset, player) + getOptimizedOutput(buffer2, buffer1));
                    } else {
                        player.sendText(TrekAnsi.locate(15, 60, player) + buffer1);
                    }

                    setHudValue("ScanHudZ", buffer1);
                }

                buffer2 = format("HD:", comet.getYaw() + "'" + comet.getPitch(), 10);
                buffer1 = getHudValueString("ScanHudZ2");

                if (!buffer1.equals(buffer2)) {
                    offset = getOffset(buffer1, buffer2);

                    if (offset != 0) {
                        player.sendText(TrekAnsi.locate(15, 70 + offset, player) + getOptimizedOutput(buffer1, buffer2));
                    } else {
                        player.sendText(TrekAnsi.locate(15, 70, player) + buffer2);
                    }

                    setHudValue("ScanHudZ2", buffer2);
                }
                setHudValue("MyScannerLine15", "Empty");

            }

            if (TrekUtilities.isObjectFlag(player.ship.scanTarget)) {
                TrekFlag flag = player.ship.scanTarget.currentQuadrant.getFlag();

                drawScannerLine(4, "[ Payout: " + flag.getPayoutSeconds() + " ]");
                drawScannerLine(5, blankScannerLine);
            }
        } catch (NullPointerException npe) {
            //TrekLog.logException(npe);
        }
    }