From 714d9c0ca7cae8638b7c152f03005147d6ba6529 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 26 Feb 2019 20:22:30 -0800 Subject: [PATCH] init potion ingredient lists in constructor --- .../config/skills/alchemy/PotionConfig.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java b/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java index 64d974e91..bf2218a42 100644 --- a/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java +++ b/src/main/java/com/gmail/nossr50/config/skills/alchemy/PotionConfig.java @@ -51,22 +51,35 @@ public class PotionConfig extends ConfigCollection { /* INGREDIENTS */ - private List concoctionsIngredientsTierOne = new ArrayList(); - private List concoctionsIngredientsTierTwo = new ArrayList(); - private List concoctionsIngredientsTierThree = new ArrayList(); - private List concoctionsIngredientsTierFour = new ArrayList(); - private List concoctionsIngredientsTierFive = new ArrayList(); - private List concoctionsIngredientsTierSix = new ArrayList(); - private List concoctionsIngredientsTierSeven = new ArrayList(); - private List concoctionsIngredientsTierEight = new ArrayList(); + private List concoctionsIngredientsTierOne; + private List concoctionsIngredientsTierTwo; + private List concoctionsIngredientsTierThree; + private List concoctionsIngredientsTierFour; + private List concoctionsIngredientsTierFive; + private List concoctionsIngredientsTierSix; + private List concoctionsIngredientsTierSeven; + private List concoctionsIngredientsTierEight; private Map potionMap = new HashMap(); public PotionConfig() { super(mcMMO.p.getDataFolder().getAbsoluteFile(), "potions.yml", true, true, true); + initIngredientLists(); register(); } + private void initIngredientLists() + { + concoctionsIngredientsTierOne = new ArrayList<>(); + concoctionsIngredientsTierTwo = new ArrayList<>(); + concoctionsIngredientsTierThree = new ArrayList<>(); + concoctionsIngredientsTierFour = new ArrayList<>(); + concoctionsIngredientsTierFive = new ArrayList<>(); + concoctionsIngredientsTierSix = new ArrayList<>(); + concoctionsIngredientsTierSeven = new ArrayList<>(); + concoctionsIngredientsTierEight = new ArrayList<>(); + } + /** * This grabs an instance of this config class from the Config Manager * This method is deprecated and will be removed in the future