2012-05-19 04:01:15 +02:00
|
|
|
package com.gmail.nossr50.config;
|
|
|
|
|
|
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
|
2012-06-07 00:02:22 +02:00
|
|
|
import com.gmail.nossr50.mcMMO;
|
2012-05-19 04:01:15 +02:00
|
|
|
|
2012-07-03 21:57:24 +02:00
|
|
|
public class HiddenConfig {
|
2012-05-19 04:01:15 +02:00
|
|
|
private static HiddenConfig instance;
|
2012-07-03 21:57:24 +02:00
|
|
|
private static String fileName;
|
2012-05-19 04:01:15 +02:00
|
|
|
private static YamlConfiguration config;
|
|
|
|
private static boolean chunkletsEnabled;
|
2012-11-04 22:36:57 +01:00
|
|
|
private static int conversionRate;
|
2013-02-16 20:36:46 +01:00
|
|
|
private static boolean useEnchantmentBuffs;
|
2013-03-29 23:29:31 +01:00
|
|
|
private static boolean resendChunksAfterBlockAbility;
|
2012-05-19 04:01:15 +02:00
|
|
|
|
2012-07-03 21:57:24 +02:00
|
|
|
public HiddenConfig(String fileName) {
|
2012-05-19 04:01:15 +02:00
|
|
|
HiddenConfig.fileName = fileName;
|
2012-07-03 21:57:24 +02:00
|
|
|
load();
|
2012-05-19 04:01:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static HiddenConfig getInstance() {
|
|
|
|
if (instance == null) {
|
2012-07-03 21:57:24 +02:00
|
|
|
instance = new HiddenConfig("hidden.yml");
|
2012-05-19 04:01:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
2012-05-23 19:52:33 +02:00
|
|
|
public void load() {
|
2012-07-03 21:57:24 +02:00
|
|
|
if (mcMMO.p.getResource(fileName) != null) {
|
|
|
|
config = YamlConfiguration.loadConfiguration(mcMMO.p.getResource(fileName));
|
|
|
|
chunkletsEnabled = config.getBoolean("Options.Chunklets", true);
|
2012-11-06 03:02:53 +01:00
|
|
|
conversionRate = config.getInt("Options.ConversionRate", 1);
|
2013-02-16 20:36:46 +01:00
|
|
|
useEnchantmentBuffs = config.getBoolean("Options.EnchantmentBuffs", true);
|
2013-03-29 23:29:31 +01:00
|
|
|
resendChunksAfterBlockAbility = config.getBoolean("Options.RefreshChunks", false);
|
2012-05-23 19:52:33 +02:00
|
|
|
}
|
2012-05-19 04:01:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean getChunkletsEnabled() {
|
|
|
|
return chunkletsEnabled;
|
|
|
|
}
|
2012-11-04 22:36:57 +01:00
|
|
|
|
|
|
|
public int getConversionRate() {
|
|
|
|
return conversionRate;
|
|
|
|
}
|
2013-02-16 20:36:46 +01:00
|
|
|
|
|
|
|
public boolean useEnchantmentBuffs() {
|
|
|
|
return useEnchantmentBuffs;
|
|
|
|
}
|
2013-03-29 23:29:31 +01:00
|
|
|
|
|
|
|
public boolean resendChunksAfterBlockAbility() {
|
|
|
|
return resendChunksAfterBlockAbility;
|
|
|
|
}
|
2012-05-19 04:01:15 +02:00
|
|
|
}
|