1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Do not print out exception about invalid configuration, we only need the line of the file

This commit is contained in:
montlikadani 2020-10-26 17:38:04 +01:00
parent 35fb74e2e3
commit aebcd6bffc
3 changed files with 30 additions and 30 deletions

48
pom.xml
View File

@ -21,13 +21,6 @@
<version>1.16.3-R0.1-SNAPSHOT</version> <version>1.16.3-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- MyPet -->
<dependency>
<groupId>de.keyle</groupId>
<artifactId>mypet</artifactId>
<version>3.10</version>
<scope>provided</scope>
</dependency>
<!-- McMMO --> <!-- McMMO -->
<dependency> <dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
@ -39,8 +32,8 @@
<!-- Vault --> <!-- Vault -->
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId> <artifactId>VaultAPI</artifactId>
<version>1.7.3</version> <version>1.7</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -136,6 +129,7 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- PlaceholderAPI -->
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>
@ -148,23 +142,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- WildStacker -->
<dependency> <dependency>
<groupId>com.github.OmerBenGera</groupId> <groupId>com.github.OmerBenGera</groupId>
<artifactId>WildStackerAPI</artifactId> <artifactId>WildStackerAPI</artifactId>
<version>master-SNAPSHOT</version> <version>master-SNAPSHOT</version>
</dependency> </dependency>
<!-- StackMob -->
<dependency> <dependency>
<groupId>com.github.Nathat23</groupId> <groupId>com.github.Nathat23</groupId>
<artifactId>StackMob-5</artifactId> <artifactId>StackMob-5</artifactId>
<version>master-SNAPSHOT</version> <version>master-SNAPSHOT</version>
</dependency> </dependency>
<!-- MyPet -->
<dependency>
<groupId>de.keyle</groupId>
<artifactId>mypet</artifactId>
<version>3.10</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<!-- WorldGuard & WorldEdit -->
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<!-- Spigot --> <!-- Spigot -->
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
@ -175,7 +173,17 @@
<id>vault-repo</id> <id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases/</url> <url>http://nexus.hc.to/content/repositories/pub_releases/</url>
</repository> </repository>
<!-- bStats --> <!-- MythicMobs -->
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
<!-- WorldGuard & WorldEdit -->
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
@ -194,17 +202,7 @@
<repository> <repository>
<id>mypet-repo</id> <id>mypet-repo</id>
<url>http://repo.keyle.de/</url> <url>http://repo.keyle.de/</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository> </repository>
<!-- MythicMobs -->
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
</repositories> </repositories>
<!-- Builds Plugin --> <!-- Builds Plugin -->
<build> <build>

View File

@ -226,9 +226,8 @@ public class ConfigReader extends YamlConfiguration {
str.close(); str.close();
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
} catch (InvalidConfigurationException | IOException e) { } catch (InvalidConfigurationException | IOException e) {
e.printStackTrace();
saveToBackup(); saveToBackup();
throw e; System.out.println(e.getLocalizedMessage());
} finally { } finally {
if (fileinputstream != null) if (fileinputstream != null)
try { try {

View File

@ -392,9 +392,12 @@ public class ConfigManager {
if (myKey.contains("-")) { if (myKey.contains("-")) {
// uses subType // uses subType
subType = ":" + myKey.split("-")[1]; String[] split = myKey.split("-");
meta = myKey.split("-")[1]; if (split.length == 2) {
myKey = myKey.split("-")[0]; subType = ":" + split[1];
meta = split[1];
myKey = split[0];
}
} else if (myKey.contains(":")) { // when we uses tipped arrow effect types } else if (myKey.contains(":")) { // when we uses tipped arrow effect types
String[] split = myKey.split(":"); String[] split = myKey.split(":");
meta = split.length > 1 ? split[1] : myKey; meta = split.length > 1 ? split[1] : myKey;