mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-30 07:27:49 +02:00
dc4d9961c1
- Fixed LWC, Lockette and Default protections - Added restricted signs (Changed how they work) - Added an option to use another name - Fixed a bug where default protection was initialized too many times - Disallowed players to place another chest near a shop chest - Speeded up and fixed enchantment and durability in itemstacks - Changed /iteminfo a bit - Added /chestshop reload - Added many default permission kits - Fixed dye colors - Added an option to allow towny residents place shops in their town
48 lines
1.3 KiB
Java
48 lines
1.3 KiB
Java
package com.Acrobot.ChestShop.Config;
|
|
|
|
import com.nijikokun.register.payment.forChestShop.Methods;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class Config {
|
|
public static ConfigObject config;
|
|
|
|
public static void setup(ConfigObject cfg) {
|
|
config = cfg;
|
|
Methods.setPreferred(Config.getString(Property.PREFERRED_ECONOMY_PLUGIN));
|
|
}
|
|
|
|
public static boolean getBoolean(Property value) {
|
|
return (Boolean) getValue(value.name());
|
|
}
|
|
|
|
public static float getFloat(Property value) {
|
|
return new Float(getValue(value.name()).toString());
|
|
}
|
|
|
|
public static String getString(Property value) {
|
|
return (String) getValue(value.name());
|
|
}
|
|
|
|
public static int getInteger(Property value) {
|
|
return Integer.parseInt(getValue(value.name()).toString());
|
|
}
|
|
|
|
public static double getDouble(Property value) {
|
|
return Double.parseDouble(getValue(value.name()).toString());
|
|
}
|
|
|
|
private static String getColored(String msg) {
|
|
return msg.replaceAll("&([0-9a-f])", "\u00A7$1");
|
|
}
|
|
|
|
public static String getLocal(Language lang) {
|
|
return getColored(config.getLanguageConfig().getString(Language.prefix.name()) + config.getLanguageConfig().getString(lang.name()));
|
|
}
|
|
|
|
private static Object getValue(String node) {
|
|
return config.getProperty(node);
|
|
}
|
|
}
|