mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Temporarily hold party settings in DSM (will be removed later)
This commit is contained in:
parent
86b98368bc
commit
6425cd18b8
@ -130,9 +130,6 @@ public final class ConfigManager {
|
|||||||
private SoundConfig soundConfig;
|
private SoundConfig soundConfig;
|
||||||
private RankConfig rankConfig;
|
private RankConfig rankConfig;
|
||||||
|
|
||||||
private HashMap<Material, Integer> partyItemWeights;
|
|
||||||
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
|
|
||||||
|
|
||||||
/* CONFIG ERRORS */
|
/* CONFIG ERRORS */
|
||||||
|
|
||||||
private ArrayList<String> configErrors; //Collect errors to whine about to server admins
|
private ArrayList<String> configErrors; //Collect errors to whine about to server admins
|
||||||
@ -150,17 +147,6 @@ public final class ConfigManager {
|
|||||||
|
|
||||||
//Serialized Data
|
//Serialized Data
|
||||||
initSerializedDataFiles();
|
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() {
|
private void initSerializedDataFiles() {
|
||||||
@ -343,10 +329,6 @@ public final class ConfigManager {
|
|||||||
return advancedConfig;
|
return advancedConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public PotionManager getPotionManager() {
|
|
||||||
// return potionManager;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public CoreSkillsConfig getCoreSkillsConfig() {
|
public CoreSkillsConfig getCoreSkillsConfig() {
|
||||||
return coreSkillsConfig;
|
return coreSkillsConfig;
|
||||||
}
|
}
|
||||||
@ -431,14 +413,6 @@ public final class ConfigManager {
|
|||||||
return configSuperAbilities.getConfig();
|
return configSuperAbilities.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<Material, Integer> getPartyItemWeights() {
|
|
||||||
return partyItemWeights;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<PartyFeature, Integer> getPartyFeatureUnlocks() {
|
|
||||||
return partyFeatureUnlocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConfigAdmin getConfigAdmin() {
|
public ConfigAdmin getConfigAdmin() {
|
||||||
return configAdmin.getConfig();
|
return configAdmin.getConfig();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.core;
|
package com.gmail.nossr50.core;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
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.Salvageable;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
||||||
import com.gmail.nossr50.util.experience.ExperienceMapManager;
|
import com.gmail.nossr50.util.experience.ExperienceMapManager;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DSM (Dynamic Settings Manager) is responsible for
|
* The DSM (Dynamic Settings Manager) is responsible for
|
||||||
@ -32,18 +35,29 @@ public class DynamicSettingsManager {
|
|||||||
private BonusDropManager bonusDropManager;
|
private BonusDropManager bonusDropManager;
|
||||||
private ExperienceMapManager experienceMapManager;
|
private ExperienceMapManager experienceMapManager;
|
||||||
|
|
||||||
|
/* Party Settings */
|
||||||
|
private HashMap<Material, Integer> partyItemWeights;
|
||||||
|
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
|
||||||
|
|
||||||
public DynamicSettingsManager() {
|
public DynamicSettingsManager() {
|
||||||
/*
|
/*
|
||||||
* Managers
|
* Managers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//Assign Maps
|
||||||
|
initPartySettings();
|
||||||
|
|
||||||
// Register Managers
|
// Register Managers
|
||||||
initSkillPropertiesManager();
|
initSkillPropertiesManager();
|
||||||
initMiscManagers();
|
initMiscManagers();
|
||||||
initCollectionManagers();
|
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() {
|
private void initSkillPropertiesManager() {
|
||||||
skillPropertiesManager = new SkillPropertiesManager();
|
skillPropertiesManager = new SkillPropertiesManager();
|
||||||
skillPropertiesManager.fillRegisters();
|
skillPropertiesManager.fillRegisters();
|
||||||
@ -121,6 +135,14 @@ public class DynamicSettingsManager {
|
|||||||
return bonusDropManager;
|
return bonusDropManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<Material, Integer> getPartyItemWeights() {
|
||||||
|
return partyItemWeights;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<PartyFeature, Integer> getPartyFeatureUnlocks() {
|
||||||
|
return partyFeatureUnlocks;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isBonusDropsEnabled(Material material) {
|
public boolean isBonusDropsEnabled(Material material) {
|
||||||
return getBonusDropManager().isBonusDropWhitelisted(material);
|
return getBonusDropManager().isBonusDropWhitelisted(material);
|
||||||
}
|
}
|
||||||
|
@ -560,7 +560,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update power level tag scoreboards
|
// Update power level tag scoreboards
|
||||||
new PowerLevelUpdatingTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
|
new PowerLevelUpdatingTask().runTaskTimer(this, 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
|
||||||
|
|
||||||
|
@ -42,10 +42,10 @@ public final class PartyManager {
|
|||||||
* @return the unlock level for the feature
|
* @return the unlock level for the feature
|
||||||
*/
|
*/
|
||||||
public static int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
|
public static int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
|
||||||
if (mcMMO.getConfigManager().getPartyFeatureUnlocks().get(partyFeature) == null)
|
if (mcMMO.getDynamicSettingsManager().getPartyFeatureUnlocks().get(partyFeature) == null)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return mcMMO.getConfigManager().getPartyFeatureUnlocks().get(partyFeature);
|
return mcMMO.getDynamicSettingsManager().getPartyFeatureUnlocks().get(partyFeature);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user