Skip to content

Commit

Permalink
Update string parsed to list and add description
Browse files Browse the repository at this point in the history
  • Loading branch information
EpiCanard committed Aug 11, 2020
1 parent c075917 commit e92e1a5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ buildNumber.properties
!/.mvn/wrapper/maven-wrapper.jar

.vscode
.settings
.settings
.idea
.classpath
*.iml
4 changes: 2 additions & 2 deletions src/main/java/net/gkid117/choptree/ChopTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void loadConfig()
config.set("ActiveByDefault", Boolean.valueOf(defaultActive));
useAnything = config.getBoolean("UseAnything", false);
config.set("UseAnything", Boolean.valueOf(useAnything));
allowedTools = config.getString("AllowedTools").split(",");
allowedTools = config.getStringList("AllowedTools").toArray(new String[0]);
config.set("AllowedTools", arrayToString(allowedTools, ","));
moreDamageToTools = config.getBoolean("MoreDamageToTools", false);
config.set("MoreDamageToTools", Boolean.valueOf(moreDamageToTools));
Expand All @@ -222,7 +222,7 @@ public void loadConfig()
}

private List<String> filterConfigParams(String configVar, String contain) {
final List<String> input = Arrays.asList(config.getString(configVar).split(","));
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);
Expand Down
19 changes: 16 additions & 3 deletions src/main/ressources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,25 @@

ActiveByDefault: true
UseAnything: false
AllowedTools: WOODEN_AXE,STONE_AXE,IRON_AXE,GOLDEN_AXE,DIAMOND_AXE
AllowedTools:
- GOLDEN_AXE
MoreDamgeToTools: false
InterruptIfToolBreaks: false
LogsMoveDown: false
OnlyTrees: true
PopLeaves: false
LeafRadius: 3
AllowedWoodBlocks: ACACIA_LOG,BIRCH_LOG,DARK_OAK_LOG,JUNGLE_LOG,OAK_LOG,SPRUCE_LOG,STRIPPED_ACACIA_LOG,STRIPPED_BIRCH_LOG,STRIPPED_DARK_OAK_LOG,STRIPPED_JUNGLE_LOG,STRIPPED_OAK_LOG,STRIPPED_SPRUCE_LOG
LeavesForDecay: ACACIA_LEAVES,BIRCH_LEAVES,DARK_OAK_LEAVES,JUNGLE_LEAVES,OAK_LEAVES,SPRUCE_LEAVES
AllowedWoodBlocks:
- ACACIA_LOG
- BIRCH_LOG
- DARK_OAK_LOG
- JUNGLE_LOG
- OAK_LOG
- SPRUCE_LOG
LeavesForDecay:
- ACACIA_LEAVES
- BIRCH_LEAVES
- DARK_OAK_LEAVES
- JUNGLE_LEAVES
- OAK_LEAVES
- SPRUCE_LEAVES
1 change: 1 addition & 0 deletions src/main/ressources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: ChopTree
description: Plugin that cut tree in one hit with axe
main: net.gkid117.choptree.ChopTree
version: 5.0.0
author: gkid117 and EpiCanard
Expand Down

0 comments on commit e92e1a5

Please sign in to comment.