potion config pt 1 (wip)

This commit is contained in:
nossr50 2019-02-20 22:33:21 -08:00
parent bd74d6e4f1
commit cef1bf6c8c

View File

@ -3,6 +3,8 @@ package com.gmail.nossr50.config.skills.alchemy;
import com.gmail.nossr50.config.ConfigCollection; import com.gmail.nossr50.config.ConfigCollection;
import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion; import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
import org.bukkit.ChatColor;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -16,6 +18,15 @@ import java.util.Map;
public class PotionConfig extends ConfigCollection { public class PotionConfig extends ConfigCollection {
public static final String CONCOCTIONS = "Concoctions";
public static final String TIER_ONE_INGREDIENTS = "Tier_One_Ingredients";
public static final String TIER_TWO_INGREDIENTS = "Tier_Two_Ingredients";
public static final String TIER_THREE_INGREDIENTS = "Tier_Three_Ingredients";
public static final String TIER_FOUR_INGREDIENTS = "Tier_Four_Ingredients";
public static final String TIER_FIVE_INGREDIENTS = "Tier_Five_Ingredients";
public static final String TIER_SIX_INGREDIENTS = "Tier_Six_Ingredients";
public static final String TIER_SEVEN_INGREDIENTS = "Tier_Seven_Ingredients";
public static final String TIER_EIGHT_INGREDIENTS = "Tier_Eight_Ingredients";
private List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>(); private List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<ItemStack>(); private List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<ItemStack>();
private List<ItemStack> concoctionsIngredientsTierThree = new ArrayList<ItemStack>(); private List<ItemStack> concoctionsIngredientsTierThree = new ArrayList<ItemStack>();
@ -49,16 +60,15 @@ public class PotionConfig extends ConfigCollection {
} }
private void loadConcoctions() { private void loadConcoctions() {
ConfigurationSection concoctionSection = config.getConfigurationSection("Concoctions"); try {
loadConcoctionsTier(concoctionsIngredientsTierOne, getStringValueList(CONCOCTIONS, TIER_ONE_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierOne, concoctionSection.getStringList("Tier_One_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierTwo, getStringValueList(CONCOCTIONS, TIER_TWO_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierTwo, concoctionSection.getStringList("Tier_Two_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierThree, getStringValueList(CONCOCTIONS, TIER_THREE_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierThree, concoctionSection.getStringList("Tier_Three_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierFour, getStringValueList(CONCOCTIONS, TIER_FOUR_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierFour, concoctionSection.getStringList("Tier_Four_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierFive, getStringValueList(CONCOCTIONS, TIER_FIVE_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierFive, concoctionSection.getStringList("Tier_Five_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierSix, getStringValueList(CONCOCTIONS, TIER_SIX_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierSix, concoctionSection.getStringList("Tier_Six_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierSeven, getStringValueList(CONCOCTIONS, TIER_SEVEN_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierSeven, concoctionSection.getStringList("Tier_Seven_Ingredients")); loadConcoctionsTier(concoctionsIngredientsTierEight, getStringValueList(CONCOCTIONS, TIER_EIGHT_INGREDIENTS));
loadConcoctionsTier(concoctionsIngredientsTierEight, concoctionSection.getStringList("Tier_Eight_Ingredients"));
concoctionsIngredientsTierTwo.addAll(concoctionsIngredientsTierOne); concoctionsIngredientsTierTwo.addAll(concoctionsIngredientsTierOne);
concoctionsIngredientsTierThree.addAll(concoctionsIngredientsTierTwo); concoctionsIngredientsTierThree.addAll(concoctionsIngredientsTierTwo);
@ -67,6 +77,9 @@ public class PotionConfig extends ConfigCollection {
concoctionsIngredientsTierSix.addAll(concoctionsIngredientsTierFive); concoctionsIngredientsTierSix.addAll(concoctionsIngredientsTierFive);
concoctionsIngredientsTierSeven.addAll(concoctionsIngredientsTierSix); concoctionsIngredientsTierSeven.addAll(concoctionsIngredientsTierSix);
concoctionsIngredientsTierEight.addAll(concoctionsIngredientsTierSeven); concoctionsIngredientsTierEight.addAll(concoctionsIngredientsTierSeven);
} catch (ObjectMappingException e) {
e.printStackTrace();
}
} }
private void loadConcoctionsTier(List<ItemStack> ingredientList, List<String> ingredientStrings) { private void loadConcoctionsTier(List<ItemStack> ingredientList, List<String> ingredientStrings) {