Entity c3master = entity.getC3Master(); Vector c3members = new Vector(); Enumeration playerUnits = c.game.getPlayerEntities(c.getLocalPlayer()).elements(); while (playerUnits.hasMoreElements()) { Entity unit = (Entity) playerUnits.nextElement(); if (!entity.equals(unit) && entity.onSameC3NetworkAs(unit)) { c3members.addElement(unit); } }   CustomMechDialog cmd = new CustomMechDialog(clientgui, c, entity, editable); cmd.refreshOptions(); cmd.setTitle(entity.getShortName()); cmd.setVisible(true); if (editable && cmd.isOkay()) {  c.sendUpdateEntity(entity);   if ((c3master != null && !c3master.equals(entity.getC3Master())) || (c3master == null && entity.getC3Master() != null)) { playerUnits = c3members.elements(); while (playerUnits.hasMoreElements()) { Entity unit = (Entity) playerUnits.nextElement(); c.sendUpdateEntity(unit); } } }
Entity entity = client.game.getEntity(entityCorrespondance[lisEntities.getSelectedIndex()]); customizeMech (entity);
    public void customizeMech(Entity entity) {        boolean editable = clientgui.getBots().get(entity.getOwner().getName()) != null;        Client c = null;        if (editable) {            c = (Client)clientgui.getBots().get(entity.getOwner().getName());        } else {            editable |= entity.getOwnerId() == client.getLocalPlayer().getId();            c = client;        }        // When we customize a single entity's C3 network setting,        // **ALL** members of the network may get changed.        Entity c3master = entity.getC3Master();        Vector c3members = new Vector();        Enumeration playerUnits = c.game.getPlayerEntities(c.getLocalPlayer()).elements();        while (playerUnits.hasMoreElements()) {            Entity unit = (Entity) playerUnits.nextElement();            if (!entity.equals(unit) && entity.onSameC3NetworkAs(unit)) {                c3members.addElement(unit);            }        }        // display dialog        CustomMechDialog cmd = new CustomMechDialog(clientgui, c, entity, editable);        cmd.refreshOptions();        cmd.setTitle(entity.getShortName());        cmd.setVisible(true);        if (editable && cmd.isOkay()) {            // send changes            c.sendUpdateEntity(entity);            // Do we need to update the members of our C3 network?            if ((c3master != null && !c3master.equals(entity.getC3Master()))                || (c3master == null && entity.getC3Master() != null)) {                playerUnits = c3members.elements();                while (playerUnits.hasMoreElements()) {                    Entity unit = (Entity) playerUnits.nextElement();                    c.sendUpdateEntity(unit);                }            }        }    }