Skip to content

Commit

Permalink
Add support of 1.16 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
EpiCanard committed Oct 2, 2020
1 parent 48c046f commit 2a88964
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/gkid117/choptree/ChopTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> filterConfigParams(String configVar, String contain) {
private List<String> filterConfigParams(String configVar, List<String> contain) {
final List<String> input = config.getStringList(configVar);
final List<String> notAllowed = new ArrayList<>();
final List<String> 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;
Expand Down
4 changes: 4 additions & 0 deletions src/main/ressources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ AllowedWoodBlocks:
- JUNGLE_LOG
- OAK_LOG
- SPRUCE_LOG
- CRIMSON_STEM
- WARPED_STEM
LeavesForDecay:
- ACACIA_LEAVES
- BIRCH_LEAVES
- DARK_OAK_LEAVES
- JUNGLE_LEAVES
- OAK_LEAVES
- SPRUCE_LEAVES
- NETHER_WART_BLOCK
- WARPED_WART_BLOCK

0 comments on commit 2a88964

Please sign in to comment.