compactCriticals(mech);
    public Entity getEntity() throws EntityLoadingException {        try {            Mech mech;            if (creatorName == "Unknown"                || !creatorName.equals("The Drawing Board")                || Integer.parseInt(creatorVersion) != 2) {                // MegaMek no longer supports older versions of The                //  Drawing Board (pre 2.0.23) due to incomplete xml                //  file information in those versions.                throw new EntityLoadingException("This xml file is not a valid Drawing Board mech.  Make sure you are using version 2.0.23 or later of The Drawing Board.");            }            if (chassisConfig.equals("Quad")) {                mech = new QuadMech();            } else {                mech = new BipedMech();            }            // aarg!  those stupid sub-names in parenthesis screw everything up            // we may do something different in the future, but for now, I'm            // going to strip them out            int pindex = name.indexOf("(");            if (pindex == -1) {                mech.setChassis(name);            } else {                mech.setChassis(name.substring(0, pindex - 1));            }            if (variant != null) {                mech.setModel(variant);            } else if (model != null) {                mech.setModel(model);            } else {                // Do mechs need a model?                mech.setModel("");            }            mech.setYear(Integer.parseInt(techYear));            mech.setOmni(isOmni);            if (LAMTonnage != null) {                throw new EntityLoadingException("Unsupported tech: LAM?");            }            if (techBase.equals("Inner Sphere")) {                switch (Integer.parseInt(rulesLevel)) {                case 1 :                    mech.setTechLevel(TechConstants.T_IS_LEVEL_1);                    break;                case 2 :                    mech.setTechLevel(TechConstants.T_IS_LEVEL_2);                    break;                default :                    throw new EntityLoadingException("Unsupported tech level: " + rulesLevel);                }            } else if (techBase.equals("Clan")) {                if (Integer.parseInt(rulesLevel) == 2)                    mech.setTechLevel(TechConstants.T_CLAN_LEVEL_2);                else                    throw new EntityLoadingException("Unsupported tech level: " + rulesLevel);            } else if (techBase.equals("Mixed (IS Chassis)") ||                       techBase.equals("Inner Sphere 'C'")) {                mech.setTechLevel(TechConstants.T_MIXED_BASE_IS_LEVEL_2);            } else if (techBase.equals("Mixed (Clan Chassis)")) {                mech.setTechLevel(TechConstants.T_MIXED_BASE_CLAN_LEVEL_2);            } else {                throw new EntityLoadingException("Unsupported tech base: " + techBase);            }            mech.setWeight((float)Integer.parseInt(tonnage));            mech.setOriginalWalkMP(Integer.parseInt(walkMP));            if (jumpMP != null)                mech.setOriginalJumpMP(Integer.parseInt(jumpMP));            int expectedSinks = Integer.parseInt(heatSinks);            mech.autoSetInternal();            mech.initializeArmor(larmArmor, Mech.LOC_LARM);            mech.initializeArmor(rarmArmor, Mech.LOC_RARM);            mech.initializeArmor(ltArmor, Mech.LOC_LT);            mech.initializeArmor(rtArmor, Mech.LOC_RT);            mech.initializeArmor(ctArmor, Mech.LOC_CT);            mech.initializeArmor(headArmor, Mech.LOC_HEAD);            mech.initializeArmor(llegArmor, Mech.LOC_LLEG);            mech.initializeArmor(rlegArmor, Mech.LOC_RLEG);            mech.initializeRearArmor(ltrArmor, Mech.LOC_LT);            mech.initializeRearArmor(rtrArmor, Mech.LOC_RT);            mech.initializeRearArmor(ctrArmor, Mech.LOC_CT);            // oog, crits.            // we do these in reverse order to get the outermost locations first,            // which is necessary for split crits to work            for (int i = mech.locations() - 1; i >= 0; i--) {                parseCrits(mech, i);            }            if (mech.isClan()) {                mech.addClanCase();            }            // add any heat sinks not allocated            mech.addEngineSinks(expectedSinks - mech.heatSinks(), dblSinks);            return mech;        } catch (NumberFormatException ex) {            throw new EntityLoadingException("NumberFormatException parsing file");        } catch (NullPointerException ex) {            throw new EntityLoadingException("NullPointerException parsing file");        } catch (StringIndexOutOfBoundsException ex) {            throw new EntityLoadingException("StringIndexOutOfBoundsException parsing file");        }    }