Temporarily hold party settings in DSM (will be removed later)

This commit is contained in:
nossr50 2019-05-13 02:05:44 -07:00
parent 86b98368bc
commit 6425cd18b8
4 changed files with 24 additions and 29 deletions

View File

@ -130,9 +130,6 @@ public final class ConfigManager {
private SoundConfig soundConfig;
private RankConfig rankConfig;
private HashMap<Material, Integer> partyItemWeights;
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
/* CONFIG ERRORS */
private ArrayList<String> configErrors; //Collect errors to whine about to server admins
@ -150,17 +147,6 @@ public final class ConfigManager {
//Serialized Data
initSerializedDataFiles();
//Assign Maps
partyItemWeights = Maps.newHashMap(configParty.getConfig().getPartyItemShare().getItemShareMap()); //Item Share Weights
partyFeatureUnlocks = Maps.newHashMap(configParty.getConfig().getPartyXP().getPartyLevel().getPartyFeatureUnlockMap()); //Party Progression
//YAML Configs
initYAMLConfigs();
}
private void initYAMLConfigs() {
}
private void initSerializedDataFiles() {
@ -343,10 +329,6 @@ public final class ConfigManager {
return advancedConfig;
}
// public PotionManager getPotionManager() {
// return potionManager;
// }
public CoreSkillsConfig getCoreSkillsConfig() {
return coreSkillsConfig;
}
@ -431,14 +413,6 @@ public final class ConfigManager {
return configSuperAbilities.getConfig();
}
public HashMap<Material, Integer> getPartyItemWeights() {
return partyItemWeights;
}
public HashMap<PartyFeature, Integer> getPartyFeatureUnlocks() {
return partyFeatureUnlocks;
}
public ConfigAdmin getConfigAdmin() {
return configAdmin.getConfig();
}

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.core;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
@ -7,9 +8,11 @@ import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
import com.gmail.nossr50.util.experience.ExperienceMapManager;
import com.google.common.collect.Maps;
import org.bukkit.Material;
import java.util.ArrayList;
import java.util.HashMap;
/**
* The DSM (Dynamic Settings Manager) is responsible for
@ -32,18 +35,29 @@ public class DynamicSettingsManager {
private BonusDropManager bonusDropManager;
private ExperienceMapManager experienceMapManager;
/* Party Settings */
private HashMap<Material, Integer> partyItemWeights;
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
public DynamicSettingsManager() {
/*
* Managers
*/
//Assign Maps
initPartySettings();
// Register Managers
initSkillPropertiesManager();
initMiscManagers();
initCollectionManagers();
}
private void initPartySettings() {
partyItemWeights = Maps.newHashMap(mcMMO.getConfigManager().getConfigParty().getPartyItemShare().getItemShareMap()); //Item Share Weights
partyFeatureUnlocks = Maps.newHashMap(mcMMO.getConfigManager().getConfigParty().getPartyXP().getPartyLevel().getPartyFeatureUnlockMap()); //Party Progression
}
private void initSkillPropertiesManager() {
skillPropertiesManager = new SkillPropertiesManager();
skillPropertiesManager.fillRegisters();
@ -121,6 +135,14 @@ public class DynamicSettingsManager {
return bonusDropManager;
}
public HashMap<Material, Integer> getPartyItemWeights() {
return partyItemWeights;
}
public HashMap<PartyFeature, Integer> getPartyFeatureUnlocks() {
return partyFeatureUnlocks;
}
public boolean isBonusDropsEnabled(Material material) {
return getBonusDropManager().isBonusDropWhitelisted(material);
}

View File

@ -560,7 +560,6 @@ public class mcMMO extends JavaPlugin {
}
}
// Update power level tag scoreboards
new PowerLevelUpdatingTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);

View File

@ -42,10 +42,10 @@ public final class PartyManager {
* @return the unlock level for the feature
*/
public static int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
if (mcMMO.getConfigManager().getPartyFeatureUnlocks().get(partyFeature) == null)
if (mcMMO.getDynamicSettingsManager().getPartyFeatureUnlocks().get(partyFeature) == null)
return 0;
else
return mcMMO.getConfigManager().getPartyFeatureUnlocks().get(partyFeature);
return mcMMO.getDynamicSettingsManager().getPartyFeatureUnlocks().get(partyFeature);
}
/**