for (Enumeration i = getEntity().getWeapons(); i.hasMoreElements();) { Mounted mo = (Mounted)i.nextElement();
for (Mounted mo : getEntity().getWeaponList()) {
    public float getWeightMiscEquip(MiscType mt) {        if (mt.hasFlag(MiscType.F_HEAT_SINK)                || mt.hasFlag(MiscType.F_DOUBLE_HEAT_SINK))            return 0f;        if (mt.hasFlag(MiscType.F_FERRO_FIBROUS))            return 0f;        if (mt.hasFlag(MiscType.F_ENDO_STEEL))            return 0f;        if (mt.hasFlag(MiscType.F_JUMP_JET)) {            return mt.getTonnage(getEntity());        } else if (mt.hasFlag(MiscType.F_CLUB)                && (mt.hasSubType(MiscType.S_HATCHET)                || mt.hasSubType(MiscType.S_MACE_THB))) {            return ceil(getWeight() / 15.0f, getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_SWORD)) {            return ceilMaxHalf(getWeight() / 20.0f,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_MACE)) {            return ceilMaxHalf(getWeight() / 10.0f,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_PILE_DRIVER)) {            return ceilMaxHalf(10,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_CHAINSAW)) {            return ceilMaxHalf(5,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_DUAL_SAW)) {            return ceilMaxHalf(7,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_CLUB)                && mt.hasSubType(MiscType.S_BACKHOE)) {            return ceilMaxHalf(5,                    getWeightCeilingWeapons());        } else if (mt.hasFlag(MiscType.F_MASC)) {            if (mt.getInternalName().equals("ISMASC"))                return Math.round(getWeight() / 20.0f);            else if (mt.getInternalName().equals("CLMASC"))                return Math.round(getWeight() / 25.0f);        } else if (mt.hasFlag(MiscType.F_TARGCOMP)) {            float fTons = 0.0f;            for (Enumeration i = getEntity().getWeapons(); i.hasMoreElements();) {                Mounted mo = (Mounted)i.nextElement();                WeaponType wt = (WeaponType)mo.getType();                if (wt.hasFlag(WeaponType.F_DIRECT_FIRE))                    fTons += wt.getTonnage(getEntity());            }            if (mt.getInternalName().equals("ISTargeting Computer"))                return ceil(fTons / 4.0f, getWeightCeilingTargComp());            else if (mt.getInternalName().equals("CLTargeting Computer"))                return ceil(fTons / 5.0f, getWeightCeilingTargComp());        } else if (mt.hasFlag(MiscType.F_VACUUM_PROTECTION)) {            return Math.round(getWeight() / 10.0f);        } else            return mt.getTonnage(getEntity());        return 0f;    }