/**
* Update the quest slot to the current version.
* @param player
*/
public static void updateQuests(final Player player) {
final EntityManager entityMgr = SingletonRepository.getEntityManager();
// rename old quest slot "Valo_concoct_potion" to "valo_concoct_potion"
// We avoid to lose potion in case there is an entry with the old and the new name at the same
// time by combining them by calculating the minimum of the two times and the sum of the two amounts.
migrateSumTimedQuestSlot(player, "Valo_concoct_potion", "valo_concoct_potion");
// From 0.66 to 0.67
// update quest slot content,
// replace "_" with " ", for item/creature names
for (final String questSlot : player.getQuests()) {
if (player.hasQuest(questSlot)) {
final String itemString = player.getQuest(questSlot);
final String[] parts = itemString.split(";");
final StringBuilder buffer = new StringBuilder();
boolean first = true;
for (int i = 0; i < parts.length; ++i) {
final String oldName = parts[i];
// Convert old item names to their new representation with correct grammar
// and without underscores.
String newName = UpdateConverter.updateItemName(oldName);
// check for valid item and creature names if the update converter changed the name
if (!newName.equals(oldName)) {
if (!entityMgr.isCreature(newName) && !entityMgr.isItem(newName)) {
newName = oldName;
}
}
if (first) {