From 5ce08a2294626fb0f5b53c6c85ab7891a05763f4 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 19 Feb 2019 07:40:29 -0800 Subject: [PATCH] Kill the upgrade manager --- src/main/java/com/gmail/nossr50/mcMMO.java | 2 +- .../nossr50/util/upgrade/UpgradeManager.java | 130 +++++++++--------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index fd6eee011..87bdeb27a 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -121,7 +121,7 @@ public class mcMMO extends JavaPlugin { PluginManager pluginManager = getServer().getPluginManager(); healthBarPluginEnabled = pluginManager.getPlugin("HealthBar") != null; - upgradeManager = new UpgradeManager(); + //upgradeManager = new UpgradeManager(); setupFilePaths(); diff --git a/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java b/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java index 082376c0e..70ff9769b 100644 --- a/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java +++ b/src/main/java/com/gmail/nossr50/util/upgrade/UpgradeManager.java @@ -1,65 +1,65 @@ -package com.gmail.nossr50.util.upgrade; - -import com.gmail.nossr50.config.ConfigLoader; -import com.gmail.nossr50.datatypes.database.UpgradeType; - -import java.util.Arrays; -import java.util.EnumSet; -import java.util.Set; - -public class UpgradeManager extends ConfigLoader { - private final Set setNeededUpgrades; - - public UpgradeManager() { - super("upgrades.yml"); - - setNeededUpgrades = EnumSet.allOf(UpgradeType.class); - - loadKeys(); - } - - /** - * Check if the given {@link UpgradeType} is necessary. - * - * @param type Upgrade type to check - * - * @return true if plugin data needs to have the given upgrade - */ - public boolean shouldUpgrade(final UpgradeType type) { - return setNeededUpgrades.contains(type); - } - - /** - * Set the given {@link UpgradeType} as completed. Does nothing if - * the upgrade was applied previously. - * - * @param type Upgrade type to set as complete - */ - public void setUpgradeCompleted(final UpgradeType type) { - if (!setNeededUpgrades.remove(type)) { - return; - } - - plugin.debug("Saving upgrade status for type " + type.toString() + "..."); - - config.set("Upgrades_Finished." + type.toString(), true); - - try { - config.save(getFile()); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void loadKeys() { - for (UpgradeType type : UpgradeType.values()) { - if (config.getBoolean("Upgrades_Finished." + type.toString())) { - setNeededUpgrades.remove(type); - } - } - - plugin.debug("Needed upgrades: " + Arrays.toString(setNeededUpgrades.toArray(new UpgradeType[setNeededUpgrades.size()]))); - } -} +//package com.gmail.nossr50.util.upgrade; +// +//import com.gmail.nossr50.config.ConfigLoader; +//import com.gmail.nossr50.datatypes.database.UpgradeType; +// +//import java.util.Arrays; +//import java.util.EnumSet; +//import java.util.Set; +// +//public class UpgradeManager extends ConfigLoader { +// private final Set setNeededUpgrades; +// +// public UpgradeManager() { +// super("upgrades.yml"); +// +// setNeededUpgrades = EnumSet.allOf(UpgradeType.class); +// +// loadKeys(); +// } +// +// /** +// * Check if the given {@link UpgradeType} is necessary. +// * +// * @param type Upgrade type to check +// * +// * @return true if plugin data needs to have the given upgrade +// */ +// public boolean shouldUpgrade(final UpgradeType type) { +// return setNeededUpgrades.contains(type); +// } +// +// /** +// * Set the given {@link UpgradeType} as completed. Does nothing if +// * the upgrade was applied previously. +// * +// * @param type Upgrade type to set as complete +// */ +// public void setUpgradeCompleted(final UpgradeType type) { +// if (!setNeededUpgrades.remove(type)) { +// return; +// } +// +// plugin.debug("Saving upgrade status for type " + type.toString() + "..."); +// +// config.set("Upgrades_Finished." + type.toString(), true); +// +// try { +// config.save(getFile()); +// } +// catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// @Override +// protected void loadKeys() { +// for (UpgradeType type : UpgradeType.values()) { +// if (config.getBoolean("Upgrades_Finished." + type.toString())) { +// setNeededUpgrades.remove(type); +// } +// } +// +// plugin.debug("Needed upgrades: " + Arrays.toString(setNeededUpgrades.toArray(new UpgradeType[setNeededUpgrades.size()]))); +// } +//}