Fixing 1.13.2 bamboo material errors

This commit is contained in:
BuildTools 2019-04-26 23:26:00 -07:00
parent 3c08af363f
commit f904ac7019
2 changed files with 21 additions and 3 deletions

View File

@ -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);
}
/**

View File

@ -20,6 +20,7 @@ public class MaterialMapStore {
private HashSet<String> herbalismAbilityBlackList;
private HashSet<String> blockCrackerWhiteList;
private HashSet<String> canMakeShroomyWhiteList;
private HashSet<String> 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()