mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-21 18:15:32 +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)) {
|
||||
num++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
String format = "%0" + padding + "d";
|
||||
int num = 1;
|
||||
String customNum = String.format(locale, format, num);
|
||||
while (questSection.contains(customNum)) {
|
||||
num++;
|
||||
customNum = String.format(locale, format, num);
|
||||
}
|
||||
newSection = questSection.createSection(customNum);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user