mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fix for removed methods in Bukkit 1.12
This commit is contained in:
parent
7d05c9d8e6
commit
789b51fd05
2
pom.xml
2
pom.xml
@ -135,7 +135,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.11.2-R0.1-SNAPSHOT</version>
|
<version>1.12-pre2-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -25,7 +25,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
|
|||||||
@Override
|
@Override
|
||||||
protected void loadFile() {
|
protected void loadFile() {
|
||||||
super.loadFile();
|
super.loadFile();
|
||||||
FileConfiguration internalConfig = YamlConfiguration.loadConfiguration(plugin.getResource(fileName));
|
FileConfiguration internalConfig = YamlConfiguration.loadConfiguration(plugin.getResourceAsReader(fileName));
|
||||||
|
|
||||||
Set<String> configKeys = config.getKeys(true);
|
Set<String> configKeys = config.getKeys(true);
|
||||||
Set<String> internalConfigKeys = internalConfig.getKeys(true);
|
Set<String> internalConfigKeys = internalConfig.getKeys(true);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.config;
|
package com.gmail.nossr50.config;
|
||||||
|
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
@ -29,8 +31,9 @@ public class HiddenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void load() {
|
public void load() {
|
||||||
if (mcMMO.p.getResource(fileName) != null) {
|
InputStreamReader reader = mcMMO.p.getResourceAsReader(fileName);
|
||||||
config = YamlConfiguration.loadConfiguration(mcMMO.p.getResource(fileName));
|
if (reader != null) {
|
||||||
|
config = YamlConfiguration.loadConfiguration(reader);
|
||||||
chunkletsEnabled = config.getBoolean("Options.Chunklets", true);
|
chunkletsEnabled = config.getBoolean("Options.Chunklets", true);
|
||||||
conversionRate = config.getInt("Options.ConversionRate", 1);
|
conversionRate = config.getInt("Options.ConversionRate", 1);
|
||||||
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
|
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
|
||||||
|
@ -2,6 +2,8 @@ package com.gmail.nossr50;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -64,6 +66,7 @@ import com.gmail.nossr50.util.experience.FormulaManager;
|
|||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||||
import com.gmail.nossr50.util.upgrade.UpgradeManager;
|
import com.gmail.nossr50.util.upgrade.UpgradeManager;
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
|
|
||||||
import net.shatteredlands.shatt.backup.ZipLibrary;
|
import net.shatteredlands.shatt.backup.ZipLibrary;
|
||||||
|
|
||||||
@ -508,4 +511,9 @@ public class mcMMO extends JavaPlugin {
|
|||||||
getLogger().info("To enable, set Mods.Entity_Mods_Enabled to TRUE in config.yml.");
|
getLogger().info("To enable, set Mods.Entity_Mods_Enabled to TRUE in config.yml.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InputStreamReader getResourceAsReader(String fileName) {
|
||||||
|
InputStream in = getResource(fileName);
|
||||||
|
return in == null ? null : new InputStreamReader(in, Charsets.UTF_8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
config.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResource("child.yml")));
|
config.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResourceAsReader("child.yml")));
|
||||||
|
|
||||||
FamilyTree.clearRegistrations(); // when reloading, need to clear statics
|
FamilyTree.clearRegistrations(); // when reloading, need to clear statics
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user