2011-04-16 00:42:43 +00:00
|
|
|
package com.earth2me.essentials;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
|
|
|
|
public class Worth implements IConf
|
|
|
|
{
|
|
|
|
private static final Logger logger = Logger.getLogger("Minecraft");
|
2011-04-16 05:57:16 +00:00
|
|
|
private EssentialsConf config;
|
2011-04-16 00:42:43 +00:00
|
|
|
|
|
|
|
public Worth(File dataFolder)
|
|
|
|
{
|
|
|
|
config = new EssentialsConf(new File(dataFolder, "worth.yml"));
|
|
|
|
config.setTemplateName("/worth.yml");
|
|
|
|
config.load();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getPrice(String id)
|
|
|
|
{
|
|
|
|
return config.getInt("worth-" + id, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPrice(String id, int price)
|
|
|
|
{
|
|
|
|
config.setProperty("worth-" + id, price);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void reloadConfig()
|
|
|
|
{
|
|
|
|
config.load();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|