mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Fix groupColorPriority list automatically; resolves #174
This commit is contained in:
parent
15a7e586dd
commit
babe7acd80
@ -8,6 +8,6 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<resources>
|
||||
|
@ -24,11 +24,14 @@ import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.dungeonsxl.util.DColor;
|
||||
import static io.github.dre2n.dungeonsxl.util.DColor.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
/**
|
||||
@ -506,10 +509,23 @@ public class MainConfig extends BRConfig {
|
||||
}
|
||||
|
||||
if (config.contains("groupColorPriority")) {
|
||||
groupColorPriority.clear();
|
||||
for (String color : config.getStringList("groupColorPriority")) {
|
||||
if (EnumUtil.isValidEnum(DColor.class, color)) {
|
||||
groupColorPriority.add(DColor.valueOf(color));
|
||||
if (config.getStringList("groupColorPriority").size() < 15) {
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
for (DColor color : groupColorPriority) {
|
||||
strings.add(color.toString());
|
||||
}
|
||||
config.set("groupColorPriority", strings);
|
||||
try {
|
||||
config.save(file);
|
||||
} catch (IOException exception) {
|
||||
}
|
||||
|
||||
} else {
|
||||
groupColorPriority.clear();
|
||||
for (String color : config.getStringList("groupColorPriority")) {
|
||||
if (EnumUtil.isValidEnum(DColor.class, color)) {
|
||||
groupColorPriority.add(DColor.valueOf(color));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>DungeonsXL</name>
|
||||
<url>https://dre2n.github.io</url>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.15.1-SNAPSHOT</version>
|
||||
<version>0.15.1</version>
|
||||
</parent>
|
||||
<build>
|
||||
<finalName>dungeonsxl-${project.version}${buildNo}</finalName>
|
||||
|
Loading…
Reference in New Issue
Block a user