Use ascending order for the Quest Journal. Bump version number

This commit is contained in:
PikaMug 2020-02-10 00:57:05 -05:00
parent 209a874a61
commit baf0cdbf56
7 changed files with 15 additions and 10 deletions

2
dist/pom.xml vendored
View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<artifactId>quests-dist</artifactId>
<packaging>pom</packaging>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<artifactId>quests-main</artifactId>

View File

@ -16,6 +16,7 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
@ -27,6 +28,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.DyeColor;
@ -359,7 +361,10 @@ public class Quester {
int currentLength = 0;
int currentLines = 0;
String page = "";
for (Quest quest : currentQuests.keySet()) {
List<Quest> sortedList = currentQuests.keySet().stream()
.sorted(Comparator.comparing(Quest::getName))
.collect(Collectors.toList());
for (Quest quest : sortedList) {
if ((currentLength + quest.getName().length() > 240) || (currentLines
+ ((quest.getName().length() % 19) == 0 ? (quest.getName().length() / 19)
: ((quest.getName().length() / 19) + 1))) > 13) {
@ -373,8 +378,8 @@ public class Quester {
currentLength += quest.getName().length();
currentLines += (quest.getName().length() / 19);
}
if (getObjectives(quest, false) != null) {
for (String obj : getObjectives(quest, false)) {
if (getCurrentObjectives(quest, false) != null) {
for (String obj : getCurrentObjectives(quest, false)) {
// Length/Line check
if ((currentLength + obj.length() > 240) || (currentLines + ((obj.length() % 19)
== 0 ? (obj.length() / 19) : ((obj.length() / 19) + 1))) > 13) {

View File

@ -6,12 +6,12 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
<name>quests</name>
<url>https://github.com/PikaMug/Quests/</url>
<properties>
<revision>3.8.6</revision>
<revision>3.8.7</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<properties>