public void setLevel(final int newLevel, final PlayerCharacter aPC) { final int curLevel = aPC.getLevel(this); if (newLevel >= 0) { aPC.setLevelWithoutConsequence(this, newLevel); } if (newLevel == 1) { if (newLevel > curLevel || aPC.isImporting()) { addFeatPoolBonus(aPC); } } if (!aPC.isImporting()) { aPC.calcActiveBonuses(); // Need to do this again if caching is re-integrated // aPC.getSpellTracker().buildSpellLevelMap(newLevel); } if ((newLevel == 1) && !aPC.isImporting() && (curLevel == 0)) { SubClassApplication.checkForSubClass(aPC, this); aPC.setSpellLists(this); } if (!aPC.isImporting() && (curLevel < newLevel)) { SubstitutionClassApplication.checkForSubstitutionClass(this, newLevel, aPC); } for (PCClass pcClass : aPC.getClassSet()) { aPC.calculateKnownSpellsForClassLevel(this); } }