From 3158ba591bc49ca0e4796c8022d3ddbc5a4197bc Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 23 Feb 2019 20:24:00 -0800 Subject: [PATCH] Hylian Treasure pt 2 --- .../treasure/HerbalismTreasureConfig.java | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/treasure/HerbalismTreasureConfig.java b/src/main/java/com/gmail/nossr50/config/treasure/HerbalismTreasureConfig.java index 2bdbe3e34..007751979 100644 --- a/src/main/java/com/gmail/nossr50/config/treasure/HerbalismTreasureConfig.java +++ b/src/main/java/com/gmail/nossr50/config/treasure/HerbalismTreasureConfig.java @@ -3,13 +3,14 @@ package com.gmail.nossr50.config.treasure; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Registers; import com.gmail.nossr50.config.UnsafeValueValidation; -import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.datatypes.treasure.HylianTreasure; import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.StringUtils; import com.google.common.reflect.TypeToken; import ninja.leaping.configurate.ConfigurationNode; import ninja.leaping.configurate.objectmapping.ObjectMappingException; import org.bukkit.Material; +import org.bukkit.Tag; import java.util.ArrayList; import java.util.HashMap; @@ -140,10 +141,35 @@ public class HerbalismTreasureConfig extends Config implements UnsafeValueValida */ for(String dropBlock : dropsFrom) { - if(hylianMap.get(dropBlock) == null) - hylianMap.put(dropBlock, new ArrayList<>()); + if (dropBlock.equals("Bushes")) { + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.FERN), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.TALL_GRASS), hylianTreasure); + for (Material species : Tag.SAPLINGS.getValues()) + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(species), hylianTreasure); - hylianMap.get(dropBlock).add(hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.DEAD_BUSH), hylianTreasure); + continue; + } + if (dropBlock.equals("Flowers")) { + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.POPPY), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.DANDELION), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.BLUE_ORCHID), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.ALLIUM), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.AZURE_BLUET), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.ORANGE_TULIP), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.PINK_TULIP), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.RED_TULIP), hylianTreasure); + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(Material.WHITE_TULIP), hylianTreasure); + continue; + } + if (dropBlock.equals("Pots")) { + for (Material species : Tag.FLOWER_POTS.getValues()) + addHylianTreasure(StringUtils.getFriendlyConfigMaterialString(species), hylianTreasure); + continue; + } + + + addHylianTreasure(dropBlock, hylianTreasure); } } else { @@ -175,9 +201,10 @@ public class HerbalismTreasureConfig extends Config implements UnsafeValueValida return 1; } - private void AddHylianTreasure(String dropper, HylianTreasure treasure) { + private void addHylianTreasure(String dropper, HylianTreasure treasure) { if (!hylianMap.containsKey(dropper)) hylianMap.put(dropper, new ArrayList()); + hylianMap.get(dropper).add(treasure); } }