mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Changing iteration over a nodes children to be based on a list of its children rather than a returned type of String
This commit is contained in:
		@@ -55,7 +55,9 @@ public class ExcavationTreasureConfig extends Config implements UnsafeValueValid
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            for (String treasureName : excavationTreasureNode.getList(TypeToken.of(String.class))) {
 | 
					            for (ConfigurationNode treasureNode : excavationTreasureNode.getChildrenList()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                String treasureName = treasureNode.getString();
 | 
				
			||||||
                //Treasure Material Definition
 | 
					                //Treasure Material Definition
 | 
				
			||||||
                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
					                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,9 @@ public class FishingTreasureConfig extends Config implements UnsafeValueValidati
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            for (String treasureName : fishingTreasureNode.getList(TypeToken.of(String.class))) {
 | 
					            for (ConfigurationNode treasureNode : fishingTreasureNode.getChildrenList()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                String treasureName = treasureNode.getString();
 | 
				
			||||||
                //Treasure Material Definition
 | 
					                //Treasure Material Definition
 | 
				
			||||||
                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
					                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -190,7 +192,9 @@ public class FishingTreasureConfig extends Config implements UnsafeValueValidati
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            for (String treasureName : shakeTreasureNode.getList(TypeToken.of(String.class))) {
 | 
					            for (ConfigurationNode treasureNode : shakeTreasureNode.getChildrenList()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                String treasureName = treasureNode.getString();
 | 
				
			||||||
                //Treasure Material Definition
 | 
					                //Treasure Material Definition
 | 
				
			||||||
                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
					                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -302,8 +306,9 @@ public class FishingTreasureConfig extends Config implements UnsafeValueValidati
 | 
				
			|||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            try {
 | 
					            for (ConfigurationNode enchantmentNode : enchantmentSection.getChildrenList()) {
 | 
				
			||||||
                for (String enchantmentName : enchantmentSection.getList(TypeToken.of(String.class))) {
 | 
					
 | 
				
			||||||
 | 
					                String enchantmentName = enchantmentNode.getString();
 | 
				
			||||||
                int level = getIntValue(ENCHANTMENTS_RARITY, rarity.toString(), enchantmentName);
 | 
					                int level = getIntValue(ENCHANTMENTS_RARITY, rarity.toString(), enchantmentName);
 | 
				
			||||||
                Enchantment enchantment = EnchantmentUtils.getByName(enchantmentName);
 | 
					                Enchantment enchantment = EnchantmentUtils.getByName(enchantmentName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -314,9 +319,7 @@ public class FishingTreasureConfig extends Config implements UnsafeValueValidati
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                fishingEnchantments.get(rarity).add(new EnchantmentTreasure(enchantment, level));
 | 
					                fishingEnchantments.get(rarity).add(new EnchantmentTreasure(enchantment, level));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            } catch (ObjectMappingException e) {
 | 
					
 | 
				
			||||||
                e.printStackTrace();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,9 @@ public class HerbalismTreasureConfig extends Config implements UnsafeValueValida
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            for (String treasureName : herbalismTreasureNode.getList(TypeToken.of(String.class))) {
 | 
					            for (ConfigurationNode treasureNode : herbalismTreasureNode.getChildrenList()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                String treasureName = treasureNode.getString();
 | 
				
			||||||
                //Treasure Material Definition
 | 
					                //Treasure Material Definition
 | 
				
			||||||
                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
					                Material treasureMaterial = Material.matchMaterial(treasureName.toUpperCase());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user