diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 15f5a7b0d..4f20b62a1 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -176,9 +176,7 @@ public class HerbalismManager extends SkillManager { } public boolean isOneBlockPlant(Material material) { - return !(material == Material.CACTUS || material == Material.CHORUS_PLANT - || material == Material.SUGAR_CANE || material == Material.KELP_PLANT || material == Material.KELP - || material == Material.TALL_SEAGRASS || material == Material.TALL_GRASS || material == Material.BAMBOO); + return !mcMMO.getMaterialMapStore().isMultiBlock(material); } /** diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index e9a30066e..0b9278735 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -20,6 +20,7 @@ public class MaterialMapStore { private HashSet herbalismAbilityBlackList; private HashSet blockCrackerWhiteList; private HashSet canMakeShroomyWhiteList; + private HashSet multiBlockEntities; public MaterialMapStore() { @@ -30,10 +31,16 @@ public class MaterialMapStore { herbalismAbilityBlackList = new HashSet<>(); blockCrackerWhiteList = new HashSet<>(); canMakeShroomyWhiteList = new HashSet<>(); + multiBlockEntities = new HashSet<>(); fillHardcodedHashSets(); } + public boolean isMultiBlock(Material material) + { + return multiBlockEntities.contains(material.getKey().getKey()); + } + public boolean isAbilityActivationBlackListed(Material material) { return abilityBlackList.contains(material.getKey().getKey()); @@ -78,6 +85,19 @@ public class MaterialMapStore { fillHerbalismAbilityBlackList(); fillBlockCrackerWhiteList(); fillShroomyWhiteList(); + fillMultiBlockEntitiesList(); + } + + private void fillMultiBlockEntitiesList() + { + multiBlockEntities.add("cactus"); + multiBlockEntities.add("chorus_plant"); + multiBlockEntities.add("sugar_cane"); + multiBlockEntities.add("kelp_plant"); + multiBlockEntities.add("kelp"); + multiBlockEntities.add("tall_seagrass"); + multiBlockEntities.add("tall_grass"); + multiBlockEntities.add("bamboo"); } private void fillShroomyWhiteList()