Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 1: */ package me.thomasice.ZiPECON;
- /* 5: */ import java.util.Map.Entry;
- /* 9: */ import org.bukkit.configuration.Configuration;
- /* 13: */ import org.bukkit.plugin.java.JavaPlugin;
- /* 14: */
- /* 15: */ public class ZiPECON
- /* 16: */ extends JavaPlugin
- /* 17: */ {
- /* 18: */ public double startamount;
- /* 19: */ private Configuration config;
- /* 20: */
- /* 21: */ public void onEnable()
- /* 22: */ {
- /* 23:15 */ getLogger().info("ZiPECON 1.0 has been enabled!");
- /* 24:16 */ getServer().getPluginManager().registerEvents(new PlayerLogin(), this);
- /* 25:17 */ getServer().getPluginCommand("money").setExecutor(new CommandMoney());
- /* 26: */
- /* 27:19 */ this.config = getConfig();
- /* 28:20 */ this.startamount = this.config.getInt("start-amount", 0);
- /* 29:21 */ this.config.set("start-amount", Double.valueOf(this.startamount));
- /* 30:22 */ saveConfig();
- /* 31:23 */ loadAmounts();
- /* 38: */ }
- /* 39: */
- /* 40: */ public void onDisable()
- /* 41: */ {
- /* 42:34 */ getLogger().info("ZiPECON 1.0 has been disabled.");
- /* 43:35 */ saveAmounts();
- /* 44:36 */ saveConfig();
- /* 45: */ }
- /* 46: */
- /* 47: */ public void saveAmounts()
- /* 48: */ {
- /* 49:40 */ this.config = getConfig();
- /* 50:41 */ for (Entry<String, Double> entry : Money.money.entrySet()) {
- /* 51:42 */ getConfig().set("money." + (String)entry.getKey(), entry.getValue());
- /* 52: */ }
- /* 53: */ }
- /* 54: */
- /* 55: */ public void loadAmounts()
- /* 56: */ {
- /* 57:47 */ for (String key : getConfig().getConfigurationSection("money.").getKeys(false)) {
- /* 58:48 */ Money.money.put(key, Double.valueOf(getConfig().getInt("money." + key)));
- /* 59: */ }
- /* 60: */ }
- /* 61: */ }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement