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;
|
2014-08-12 17:51:34 +02:00
|
|
|
private String fileName;
|
|
|
|
private YamlConfiguration config;
|
|
|
|
private boolean chunkletsEnabled;
|
|
|
|
private int conversionRate;
|
|
|
|
private boolean useEnchantmentBuffs;
|
|
|
|
private int uuidConvertAmount;
|
|
|
|
private int mojangRateLimit;
|
|
|
|
private long mojangLimitPeriod;
|
2012-05-19 04:01:15 +02:00
|
|
|
|
2012-07-03 21:57:24 +02:00
|
|
|
public HiddenConfig(String fileName) {
|
2014-08-12 17:51:34 +02:00
|
|
|
this.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);
|
2014-08-01 20:17:15 +02:00
|
|
|
uuidConvertAmount = config.getInt("Options.UUIDConvertAmount", 5);
|
2014-08-12 17:51:34 +02:00
|
|
|
mojangRateLimit = config.getInt("Options.MojangRateLimit", 50000);
|
|
|
|
mojangLimitPeriod = config.getLong("Options.MojangLimitPeriod", 600000);
|
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
|
|
|
|
2014-08-01 20:17:15 +02:00
|
|
|
public int getUUIDConvertAmount() {
|
|
|
|
return uuidConvertAmount;
|
|
|
|
}
|
2014-08-12 17:51:34 +02:00
|
|
|
|
|
|
|
public int getMojangRateLimit() {
|
|
|
|
return mojangRateLimit;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getMojangLimitPeriod() {
|
|
|
|
return mojangLimitPeriod;
|
|
|
|
}
|
2012-05-19 04:01:15 +02:00
|
|
|
}
|