mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 03:55:35 +01:00
Improve incrementation of quest IDs
This commit is contained in:
parent
577f4d13ce
commit
7e42ec5ecb
@ -867,15 +867,14 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
ConfigurationSection newSection = null;
|
||||
if (context.getSessionData(Key.Q_ID) == null) {
|
||||
// Creating
|
||||
int num = 1;
|
||||
final Locale locale = Locale.US;
|
||||
final int padding = 6;
|
||||
final String customNum = String.format(Locale.US, "%0" + padding + "d", num);
|
||||
while (true) {
|
||||
if (questSection.contains(customNum)) {
|
||||
String format = "%0" + padding + "d";
|
||||
int num = 1;
|
||||
String customNum = String.format(locale, format, num);
|
||||
while (questSection.contains(customNum)) {
|
||||
num++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
customNum = String.format(locale, format, num);
|
||||
}
|
||||
newSection = questSection.createSection(customNum);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user