| 
														
															@@ -1,12 +1,15 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package com.gmail.nossr50.config.treasure; 
														 | 
														
														 | 
														
															 package com.gmail.nossr50.config.treasure; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.gmail.nossr50.config.Config; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.config.ConfigCollection; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.config.ConfigCollection; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.gmail.nossr50.config.Registers; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.config.UnsafeValueValidation; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.config.UnsafeValueValidation; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.datatypes.treasure.*; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.datatypes.treasure.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.mcMMO; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.mcMMO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.util.EnchantmentUtils; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.util.EnchantmentUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.gmail.nossr50.util.StringUtils; 
														 | 
														
														 | 
														
															 import com.gmail.nossr50.util.StringUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.google.common.reflect.TypeToken; 
														 | 
														
														 | 
														
															 import com.google.common.reflect.TypeToken; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import ninja.leaping.configurate.ConfigurationNode; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import ninja.leaping.configurate.objectmapping.ObjectMappingException; 
														 | 
														
														 | 
														
															 import ninja.leaping.configurate.objectmapping.ObjectMappingException; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.bukkit.Material; 
														 | 
														
														 | 
														
															 import org.bukkit.Material; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.bukkit.Tag; 
														 | 
														
														 | 
														
															 import org.bukkit.Tag; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -23,7 +26,15 @@ import java.util.ArrayList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.HashMap; 
														 | 
														
														 | 
														
															 import java.util.HashMap; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-public class TreasureConfig extends ConfigCollection implements UnsafeValueValidation { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//TODO: Need to rewrite this too 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+public class TreasureConfig extends Config implements UnsafeValueValidation, Registers { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String ENCHANTMENT_DROP_RATES = "Enchantment_Drop_Rates"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String ITEM_DROP_RATES = "Item_Drop_Rates"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String FISHING = "Fishing"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String EXCAVATION = "Excavation"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String SHAKE = "Shake"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public static final String HYLIAN_LUCK = "Hylian_Luck"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public HashMap<String, List<ExcavationTreasure>> excavationMap = new HashMap<String, List<ExcavationTreasure>>(); 
														 | 
														
														 | 
														
															     public HashMap<String, List<ExcavationTreasure>> excavationMap = new HashMap<String, List<ExcavationTreasure>>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -36,6 +47,7 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public TreasureConfig() { 
														 | 
														
														 | 
														
															     public TreasureConfig() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"treasures.yml"); 
														 | 
														
														 | 
														
															         //super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"treasures.yml"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         super(mcMMO.p.getDataFolder().getAbsoluteFile(), "treasures.yml", false, true, false); 
														 | 
														
														 | 
														
															         super(mcMMO.p.getDataFolder().getAbsoluteFile(), "treasures.yml", false, true, false); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        register(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         validateEntries(); 
														 | 
														
														 | 
														
															         validateEntries(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -61,38 +73,59 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return 1; 
														 | 
														
														 | 
														
															         return 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public void unload() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        excavationMap.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        shakeMap.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        hylianMap.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        fishingRewards.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        fishingEnchantments.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public List<String> validateKeys() { 
														 | 
														
														 | 
														
															     public List<String> validateKeys() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         // Validate all the settings! 
														 | 
														
														 | 
														
															         // Validate all the settings! 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<String> errorMessages = new ArrayList<String>(); 
														 | 
														
														 | 
														
															         List<String> errorMessages = new ArrayList<String>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         try { 
														 | 
														
														 | 
														
															         try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            for (String tier : getUserRootNode().getNode("Enchantment_Drop_Rates").getList(TypeToken.of(String.class))) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                double totalEnchantDropRate = 0; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                double totalItemDropRate = 0; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (String tier : getUserRootNode().getNode(ENCHANTMENT_DROP_RATES).getList(TypeToken.of(String.class))) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                /*double totalEnchantDropRate = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                double totalItemDropRate = 0;*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 for (Rarity rarity : Rarity.values()) { 
														 | 
														
														 | 
														
															                 for (Rarity rarity : Rarity.values()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    double enchantDropRate = getDoubleValue("Enchantment_Drop_Rates." + tier + "." + rarity.toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    double itemDropRate = getDoubleValue("Item_Drop_Rates." + tier + "." + rarity.toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    double enchantDropRate = getDoubleValue(ENCHANTMENT_DROP_RATES, tier, rarity.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    double itemDropRate = getDoubleValue(ITEM_DROP_RATES, tier, rarity.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if ((enchantDropRate < 0.0 || enchantDropRate > 100.0) && rarity != Rarity.RECORD) { 
														 | 
														
														 | 
														
															                     if ((enchantDropRate < 0.0 || enchantDropRate > 100.0) && rarity != Rarity.RECORD) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         errorMessages.add("The enchant drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); 
														 | 
														
														 | 
														
															                         errorMessages.add("The enchant drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //Bound Values 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        /*enchantDropRate = boundValues(enchantDropRate, 0.0D, 100.0D);*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if (itemDropRate < 0.0 || itemDropRate > 100.0) { 
														 | 
														
														 | 
														
															                     if (itemDropRate < 0.0 || itemDropRate > 100.0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         errorMessages.add("The item drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); 
														 | 
														
														 | 
														
															                         errorMessages.add("The item drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        //Bound Values 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        /*itemDropRate = boundValues(itemDropRate, 0.0D, 100.0D);*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    totalEnchantDropRate += enchantDropRate; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    totalItemDropRate += itemDropRate; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    /*totalEnchantDropRate += enchantDropRate; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    totalItemDropRate += itemDropRate;*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if (totalEnchantDropRate < 0 || totalEnchantDropRate > 100.0) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                //TODO: Why does it matter what the total item/enchant drop rate is? 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                /*if (totalEnchantDropRate < 0 || totalEnchantDropRate > 100.0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     errorMessages.add("The total enchant drop rate for " + tier + " should be between 0.0 and 100.0!"); 
														 | 
														
														 | 
														
															                     errorMessages.add("The total enchant drop rate for " + tier + " should be between 0.0 and 100.0!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (totalItemDropRate < 0 || totalItemDropRate > 100.0) { 
														 | 
														
														 | 
														
															                 if (totalItemDropRate < 0 || totalItemDropRate > 100.0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     errorMessages.add("The total item drop rate for " + tier + " should be between 0.0 and 100.0!"); 
														 | 
														
														 | 
														
															                     errorMessages.add("The total item drop rate for " + tier + " should be between 0.0 and 100.0!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                }*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } catch (ObjectMappingException e) { 
														 | 
														
														 | 
														
															         } catch (ObjectMappingException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             e.printStackTrace(); 
														 | 
														
														 | 
														
															             e.printStackTrace(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -101,34 +134,62 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return errorMessages; 
														 | 
														
														 | 
														
															         return errorMessages; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    @Override 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    protected void register() { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (config.getConfigurationSection("Treasures") != null) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            backup(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            return; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private double boundValues(double valueRef, double min, double max) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(valueRef < min) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            valueRef = min; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        else if(valueRef > max) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            valueRef = max; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        loadTreasures("Fishing"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return valueRef; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public void register() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        /*loadTreasures("Fishing"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         loadTreasures("Excavation"); 
														 | 
														
														 | 
														
															         loadTreasures("Excavation"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        loadTreasures("Hylian_Luck"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        loadTreasures("Hylian_Luck");*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        initRegisters(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        loadFishing(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        loadExcavation(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        loadHerbalism(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         loadEnchantments(); 
														 | 
														
														 | 
														
															         loadEnchantments(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for (EntityType entity : EntityType.values()) { 
														 | 
														
														 | 
														
															         for (EntityType entity : EntityType.values()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (entity.isAlive()) { 
														 | 
														
														 | 
														
															             if (entity.isAlive()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                loadTreasures("Shake." + entity.toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                loadShake(entity); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    private void loadTreasures(String type) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        boolean isFishing = type.equals("Fishing"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        boolean isShake = type.contains("Shake"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        boolean isExcavation = type.equals("Excavation"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        boolean isHylian = type.equals("Hylian_Luck"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void initRegisters() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(excavationMap == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            excavationMap = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(shakeMap == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            shakeMap = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(hylianMap == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            hylianMap = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(fishingRewards == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            fishingRewards = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        ConfigurationSection treasureSection = config.getConfigurationSection(type); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(fishingEnchantments == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            fishingEnchantments = new HashMap<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void loadFishing() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ConfigurationNode fishingTreasureNode = getUserRootNode().getNode(FISHING); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (treasureSection == null) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(fishingTreasureNode == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            mcMMO.p.getLogger().info("Fishing treasures in treasures config not defined"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return; 
														 | 
														
														 | 
														
															             return; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -139,9 +200,80 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        for (String treasureName : treasureSection.getKeys(false)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (String treasureName : fishingTreasureNode.getList(TypeToken.of(String.class))) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } catch (ObjectMappingException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            e.printStackTrace(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void loadExcavation() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ConfigurationNode excavationTreasureNode = getUserRootNode().getNode(EXCAVATION); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(excavationTreasureNode == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            mcMMO.p.getLogger().info("Excavation treasures in treasures config not defined"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (String treasureName : excavationTreasureNode.getList(TypeToken.of(String.class))) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } catch (ObjectMappingException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            e.printStackTrace(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void loadHerbalism() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ConfigurationNode herbalismTreasureNode = getUserRootNode().getNode(HYLIAN_LUCK); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(herbalismTreasureNode == null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            mcMMO.p.getLogger().info("Hylian_Luck in treasures config not defined"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (String treasureName : herbalismTreasureNode.getList(TypeToken.of(String.class))) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } catch (ObjectMappingException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            e.printStackTrace(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void loadShake(EntityType entityType) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ConfigurationNode shakeTreasureNode = getUserRootNode().getNode(SHAKE, entityType.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(shakeTreasureNode != null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (String treasureName : shakeTreasureNode.getList(TypeToken.of(String.class))) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } catch (ObjectMappingException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            e.printStackTrace(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private void loadTreasures(ConfigurationNode treasureChildNode) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (treasureChildNode == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (String treasureName : treasureChildNode.getKeys(false)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             // Validate all the things! 
														 | 
														
														 | 
														
															             // Validate all the things! 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            List<String> reason = new ArrayList<String>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            List<String> errorMessages = new ArrayList<String>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String[] treasureInfo = treasureName.split("[|]"); 
														 | 
														
														 | 
														
															             String[] treasureInfo = treasureName.split("[|]"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String materialName = treasureInfo[0]; 
														 | 
														
														 | 
														
															             String materialName = treasureInfo[0]; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -161,39 +293,39 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 material = Material.matchMaterial(materialName); 
														 | 
														
														 | 
														
															                 material = Material.matchMaterial(materialName); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            int amount = getIntValue(type + "." + treasureName + ".Amount"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            short data = (treasureInfo.length == 2) ? Short.parseShort(treasureInfo[1]) : (short) getIntValue(type + "." + treasureName + ".Data"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            int amount = getIntValue(treasureChildNodeAddress + "." + treasureName + ".Amount"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            short data = (treasureInfo.length == 2) ? Short.parseShort(treasureInfo[1]) : (short) getIntValue(treasureChildNodeAddress + "." + treasureName + ".Data"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (material == null) { 
														 | 
														
														 | 
														
															             if (material == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add("Invalid material: " + materialName); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add("Invalid material: " + materialName); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (amount <= 0) { 
														 | 
														
														 | 
														
															             if (amount <= 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add("Amount of " + treasureName + " must be greater than 0! " + amount); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add("Amount of " + treasureName + " must be greater than 0! " + amount); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (material != null && material.isBlock() && (data > 127 || data < -128)) { 
														 | 
														
														 | 
														
															             if (material != null && material.isBlock() && (data > 127 || data < -128)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add("Data of " + treasureName + " is invalid! " + data); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add("Data of " + treasureName + " is invalid! " + data); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             /* 
														 | 
														
														 | 
														
															             /* 
														 | 
													
												
											
												
													
														| 
														 | 
														
															              * XP, Drop Chance, and Drop Level 
														 | 
														
														 | 
														
															              * XP, Drop Chance, and Drop Level 
														 | 
													
												
											
												
													
														| 
														 | 
														
															              */ 
														 | 
														
														 | 
														
															              */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            int xp = getIntValue(type + "." + treasureName + ".XP"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            double dropChance = getDoubleValue(type + "." + treasureName + ".Drop_Chance"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            int dropLevel = getIntValue(type + "." + treasureName + ".Drop_Level"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            int xp = getIntValue(treasureChildNodeAddress + "." + treasureName + ".XP"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            double dropChance = getDoubleValue(treasureChildNodeAddress + "." + treasureName + ".Drop_Chance"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            int dropLevel = getIntValue(treasureChildNodeAddress + "." + treasureName + ".Drop_Level"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (xp < 0) { 
														 | 
														
														 | 
														
															             if (xp < 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add(treasureName + " has an invalid XP value: " + xp); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add(treasureName + " has an invalid XP value: " + xp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (dropChance < 0.0D) { 
														 | 
														
														 | 
														
															             if (dropChance < 0.0D) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add(treasureName + " has an invalid Drop_Chance: " + dropChance); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add(treasureName + " has an invalid Drop_Chance: " + dropChance); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (dropLevel < 0) { 
														 | 
														
														 | 
														
															             if (dropLevel < 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                reason.add(treasureName + " has an invalid Drop_Level: " + dropLevel); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                errorMessages.add(treasureName + " has an invalid Drop_Level: " + dropLevel); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             /* 
														 | 
														
														 | 
														
															             /* 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -202,10 +334,10 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Rarity rarity = null; 
														 | 
														
														 | 
														
															             Rarity rarity = null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (isFishing) { 
														 | 
														
														 | 
														
															             if (isFishing) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                rarity = Rarity.getRarity(getStringValue(type + "." + treasureName + ".Rarity")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                rarity = Rarity.getRarity(getStringValue(treasureChildNodeAddress + "." + treasureName + ".Rarity")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (rarity == null) { 
														 | 
														
														 | 
														
															                 if (rarity == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    reason.add("Invalid Rarity for item: " + treasureName); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    errorMessages.add("Invalid Rarity for item: " + treasureName); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -217,28 +349,28 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (materialName.contains("POTION")) { 
														 | 
														
														 | 
														
															             if (materialName.contains("POTION")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 Material mat = Material.matchMaterial(materialName); 
														 | 
														
														 | 
														
															                 Material mat = Material.matchMaterial(materialName); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (mat == null) { 
														 | 
														
														 | 
														
															                 if (mat == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    reason.add("Potion format for Treasures.yml has changed"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    errorMessages.add("Potion format for Treasures.yml has changed"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else { 
														 | 
														
														 | 
														
															                 } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     item = new ItemStack(mat, amount, data); 
														 | 
														
														 | 
														
															                     item = new ItemStack(mat, amount, data); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     PotionMeta itemMeta = (PotionMeta) item.getItemMeta(); 
														 | 
														
														 | 
														
															                     PotionMeta itemMeta = (PotionMeta) item.getItemMeta(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     PotionType potionType = null; 
														 | 
														
														 | 
														
															                     PotionType potionType = null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     try { 
														 | 
														
														 | 
														
															                     try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        potionType = PotionType.valueOf(getStringValue(type + "." + treasureName + ".PotionData.PotionType", "WATER")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        potionType = PotionType.valueOf(getStringValue(treasureChildNodeAddress + "." + treasureName + ".PotionData.PotionType", "WATER")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } catch (IllegalArgumentException ex) { 
														 | 
														
														 | 
														
															                     } catch (IllegalArgumentException ex) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        reason.add("Invalid Potion_Type: " + getStringValue(type + "." + treasureName + ".PotionData.PotionType", "WATER")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        errorMessages.add("Invalid Potion_Type: " + getStringValue(treasureChildNodeAddress + "." + treasureName + ".PotionData.PotionType", "WATER")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    boolean extended = getBooleanValue(type + "." + treasureName + ".PotionData.Extended", false); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    boolean upgraded = getBooleanValue(type + "." + treasureName + ".PotionData.Upgraded", false); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    boolean extended = getBooleanValue(treasureChildNodeAddress + "." + treasureName + ".PotionData.Extended", false); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    boolean upgraded = getBooleanValue(treasureChildNodeAddress + "." + treasureName + ".PotionData.Upgraded", false); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     itemMeta.setBasePotionData(new PotionData(potionType, extended, upgraded)); 
														 | 
														
														 | 
														
															                     itemMeta.setBasePotionData(new PotionData(potionType, extended, upgraded)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if (config.contains(type + "." + treasureName + ".Custom_Name")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(type + "." + treasureName + ".Custom_Name"))); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if (config.contains(treasureChildNodeAddress + "." + treasureName + ".Custom_Name")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(treasureChildNodeAddress + "." + treasureName + ".Custom_Name"))); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if (config.contains(type + "." + treasureName + ".Lore")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if (config.contains(treasureChildNodeAddress + "." + treasureName + ".Lore")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         List<String> lore = new ArrayList<String>(); 
														 | 
														
														 | 
														
															                         List<String> lore = new ArrayList<String>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        for (String s : getStringValueList(type + "." + treasureName + ".Lore")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        for (String s : getStringValueList(treasureChildNodeAddress + "." + treasureName + ".Lore")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             lore.add(ChatColor.translateAlternateColorCodes('&', s)); 
														 | 
														
														 | 
														
															                             lore.add(ChatColor.translateAlternateColorCodes('&', s)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         } 
														 | 
														
														 | 
														
															                         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         itemMeta.setLore(lore); 
														 | 
														
														 | 
														
															                         itemMeta.setLore(lore); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -248,16 +380,16 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } else if (material != null) { 
														 | 
														
														 | 
														
															             } else if (material != null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 item = new ItemStack(material, amount, data); 
														 | 
														
														 | 
														
															                 item = new ItemStack(material, amount, data); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if (config.contains(type + "." + treasureName + ".Custom_Name")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (config.contains(treasureChildNodeAddress + "." + treasureName + ".Custom_Name")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ItemMeta itemMeta = item.getItemMeta(); 
														 | 
														
														 | 
														
															                     ItemMeta itemMeta = item.getItemMeta(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(type + "." + treasureName + ".Custom_Name"))); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getStringValue(treasureChildNodeAddress + "." + treasureName + ".Custom_Name"))); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     item.setItemMeta(itemMeta); 
														 | 
														
														 | 
														
															                     item.setItemMeta(itemMeta); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if (config.contains(type + "." + treasureName + ".Lore")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (config.contains(treasureChildNodeAddress + "." + treasureName + ".Lore")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ItemMeta itemMeta = item.getItemMeta(); 
														 | 
														
														 | 
														
															                     ItemMeta itemMeta = item.getItemMeta(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     List<String> lore = new ArrayList<String>(); 
														 | 
														
														 | 
														
															                     List<String> lore = new ArrayList<String>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    for (String s : getStringValueList(type + "." + treasureName + ".Lore")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    for (String s : getStringValueList(treasureChildNodeAddress + "." + treasureName + ".Lore")) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         lore.add(ChatColor.translateAlternateColorCodes('&', s)); 
														 | 
														
														 | 
														
															                         lore.add(ChatColor.translateAlternateColorCodes('&', s)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     itemMeta.setLore(lore); 
														 | 
														
														 | 
														
															                     itemMeta.setLore(lore); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -265,19 +397,19 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if (noErrorsInConfig(reason)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (noErrorsInConfig(errorMessages)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (isFishing) { 
														 | 
														
														 | 
														
															                 if (isFishing) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     fishingRewards.get(rarity).add(new FishingTreasure(item, xp)); 
														 | 
														
														 | 
														
															                     fishingRewards.get(rarity).add(new FishingTreasure(item, xp)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else if (isShake) { 
														 | 
														
														 | 
														
															                 } else if (isShake) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ShakeTreasure shakeTreasure = new ShakeTreasure(item, xp, dropChance, dropLevel); 
														 | 
														
														 | 
														
															                     ShakeTreasure shakeTreasure = new ShakeTreasure(item, xp, dropChance, dropLevel); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    EntityType entityType = EntityType.valueOf(type.substring(6)); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    EntityType entityType = EntityType.valueOf(treasureChildNodeAddress.substring(6)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if (!shakeMap.containsKey(entityType)) 
														 | 
														
														 | 
														
															                     if (!shakeMap.containsKey(entityType)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         shakeMap.put(entityType, new ArrayList<ShakeTreasure>()); 
														 | 
														
														 | 
														
															                         shakeMap.put(entityType, new ArrayList<ShakeTreasure>()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     shakeMap.get(entityType).add(shakeTreasure); 
														 | 
														
														 | 
														
															                     shakeMap.get(entityType).add(shakeTreasure); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else if (isExcavation) { 
														 | 
														
														 | 
														
															                 } else if (isExcavation) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ExcavationTreasure excavationTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel); 
														 | 
														
														 | 
														
															                     ExcavationTreasure excavationTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    List<String> dropList = getStringValueList(type + "." + treasureName + ".Drops_From"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    List<String> dropList = getStringValueList(treasureChildNodeAddress + "." + treasureName + ".Drops_From"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     for (String blockType : dropList) { 
														 | 
														
														 | 
														
															                     for (String blockType : dropList) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         if (!excavationMap.containsKey(blockType)) 
														 | 
														
														 | 
														
															                         if (!excavationMap.containsKey(blockType)) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -286,7 +418,7 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else if (isHylian) { 
														 | 
														
														 | 
														
															                 } else if (isHylian) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     HylianTreasure hylianTreasure = new HylianTreasure(item, xp, dropChance, dropLevel); 
														 | 
														
														 | 
														
															                     HylianTreasure hylianTreasure = new HylianTreasure(item, xp, dropChance, dropLevel); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    List<String> dropList = getStringValueList(type + "." + treasureName + ".Drops_From"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    List<String> dropList = getStringValueList(treasureChildNodeAddress + "." + treasureName + ".Drops_From"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     for (String dropper : dropList) { 
														 | 
														
														 | 
														
															                     for (String dropper : dropList) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         if (dropper.equals("Bushes")) { 
														 | 
														
														 | 
														
															                         if (dropper.equals("Bushes")) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -375,7 +507,7 @@ public class TreasureConfig extends ConfigCollection implements UnsafeValueValid 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public double getItemDropRate(int tier, Rarity rarity) { 
														 | 
														
														 | 
														
															     public double getItemDropRate(int tier, Rarity rarity) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return getDoubleValue("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return getDoubleValue(ITEM_DROP_RATES + ".Tier_" + tier + "." + rarity.toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public double getEnchantmentDropRate(int tier, Rarity rarity) { 
														 | 
														
														 | 
														
															     public double getEnchantmentDropRate(int tier, Rarity rarity) { 
														 |