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> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>3.8.6</version> <version>3.8.7</version>
</parent> </parent>
<artifactId>quests-dist</artifactId> <artifactId>quests-dist</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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