Fix 1.12 support (Fixes #119)

This commit is contained in:
games647 2017-06-04 20:06:38 +02:00 committed by zml
parent 28718bb5f1
commit 0917a6b4d6
2 changed files with 21 additions and 13 deletions

23
pom.xml
View File

@ -30,10 +30,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<version>3.6.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
@ -63,22 +63,29 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-R0.1-SNAPSHOT</version>
<version>1.12-pre2-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>ru.tehkode</groupId>
<artifactId>PermissionsEx</artifactId>
<version>1.22</version>
<version>1.23.1</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<version>1.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
@ -89,11 +96,11 @@
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>pex-repo</id>
<url>http://pex-repo.aoeu.xyz</url>
<url>https://pex-repo.aoeu.xyz/</url>
</repository>
</repositories>
<properties>

View File

@ -18,6 +18,7 @@
*/
package ru.tehkode.modifyworld.bukkit;
import java.io.InputStreamReader;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
@ -132,7 +133,7 @@ public class Modifyworld extends JavaPlugin {
if (load != null) {
YamlConfiguration conf = new YamlConfiguration();
conf.options().copyDefaults(true);
conf.load(load);
conf.load(new InputStreamReader(load));
YamlConfiguration def = loadUnlocalized(path);
if (def != null) {
conf.setDefaults(def);
@ -146,7 +147,7 @@ public class Modifyworld extends JavaPlugin {
InputStream load = getResource(path);
if (load != null) {
YamlConfiguration conf = new YamlConfiguration();
conf.load(load);
conf.load(new InputStreamReader(load));
return conf;
}
return null;
@ -160,7 +161,7 @@ public class Modifyworld extends JavaPlugin {
YamlConfiguration base = new YamlConfiguration();
InputStream load = getResource("lang/" + locale.toString() + "/" + path); // Country-specific
if (load != null) {
base.load(load);
base.load(new InputStreamReader(load));
base.options().copyDefaults(true);
YamlConfiguration def = loadBaseLanguage(path, locale);
if (def == null) {
@ -208,7 +209,7 @@ public class Modifyworld extends JavaPlugin {
InputStream defConfigStream = getLocalizedResource("config.yml");
if (defConfigStream != null) {
try {
this.config.load(defConfigStream);
this.config.load(new InputStreamReader(defConfigStream));
} catch (Exception de) {
this.getLogger().severe("Default config file is broken. Please tell this to Modifyworld author.");
}
@ -219,7 +220,7 @@ public class Modifyworld extends JavaPlugin {
InputStream defConfigStream = getLocalizedResource("config.yml");
if (defConfigStream != null) {
this.config.setDefaults(YamlConfiguration.loadConfiguration(defConfigStream));
this.config.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(defConfigStream)));
}
}
}