From 2a88964eac284dfc1502809127aaee4c9845b266 Mon Sep 17 00:00:00 2001 From: EpiCanard Date: Sat, 3 Oct 2020 01:15:16 +0200 Subject: [PATCH] Add support of 1.16 blocks --- src/main/java/net/gkid117/choptree/ChopTree.java | 8 ++++---- src/main/ressources/config.yml | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/gkid117/choptree/ChopTree.java b/src/main/java/net/gkid117/choptree/ChopTree.java index caac75f..ad7cde4 100644 --- a/src/main/java/net/gkid117/choptree/ChopTree.java +++ b/src/main/java/net/gkid117/choptree/ChopTree.java @@ -215,17 +215,17 @@ public void loadConfig() leafRadius = config.getInt("LeafRadius", 3); config.set("LeafRadius", Integer.valueOf(leafRadius)); - allowedWoodBlocks = filterConfigParams("AllowedWoodBlocks", "LOG"); - leavesForDecay = filterConfigParams("LeavesForDecay", "LEAVES"); + allowedWoodBlocks = filterConfigParams("AllowedWoodBlocks", Arrays.asList("LOG", "STEM")); + leavesForDecay = filterConfigParams("LeavesForDecay", Arrays.asList("LEAVES", "WART_BLOCK")); saveConfig(); } - private List filterConfigParams(String configVar, String contain) { + private List filterConfigParams(String configVar, List contain) { final List input = config.getStringList(configVar); final List notAllowed = new ArrayList<>(); final List output = input.stream().filter(block -> { - final Boolean ret = block.contains(contain); + final Boolean ret = contain.stream().anyMatch(word -> block.contains(word)); if (!ret) notAllowed.add(block); return ret; diff --git a/src/main/ressources/config.yml b/src/main/ressources/config.yml index 086925f..b7bd0c1 100644 --- a/src/main/ressources/config.yml +++ b/src/main/ressources/config.yml @@ -38,6 +38,8 @@ AllowedWoodBlocks: - JUNGLE_LOG - OAK_LOG - SPRUCE_LOG + - CRIMSON_STEM + - WARPED_STEM LeavesForDecay: - ACACIA_LEAVES - BIRCH_LEAVES @@ -45,3 +47,5 @@ LeavesForDecay: - JUNGLE_LEAVES - OAK_LEAVES - SPRUCE_LEAVES + - NETHER_WART_BLOCK + - WARPED_WART_BLOCK