mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-04 17:50:13 +01:00
d6bdb0486a
- Formatting - Warning about old Bukkit version - Renamed "TOWNY_CANNOT_CREATE_SHOP_HERE" to "CANNOT_CREATE_SHOP_HERE" to avoid confusion - Renamed "NOT_ENOUGH_LWC_PROTECTIONS" to "NOT_ENOUGH_PROTECTIONS" and changed its message - Fixed armour enchantments - Logging shop location - Fixed Heroes for the newest version - Removed redutant plugin object - Added dev-url for CraftBukkitUpToDate - Removed redutant plugins from softdepend - Fixed a bug when the player interacts with a shop with a sign in hand
56 lines
1.5 KiB
Java
56 lines
1.5 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 float getFloat(String value) {
|
|
return new Float(getValue(value).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()));
|
|
}
|
|
|
|
public static boolean exists(String value) {
|
|
return getValue(value) != null;
|
|
}
|
|
|
|
private static Object getValue(String node) {
|
|
return config.getProperty(node);
|
|
}
|
|
}
|