diff --git a/.gitignore b/.gitignore index 8018575..a5563e6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ buildNumber.properties !/.mvn/wrapper/maven-wrapper.jar .vscode -.settings \ No newline at end of file +.settings +.idea +.classpath +*.iml diff --git a/src/main/java/net/gkid117/choptree/ChopTree.java b/src/main/java/net/gkid117/choptree/ChopTree.java index 192c1ac..caac75f 100644 --- a/src/main/java/net/gkid117/choptree/ChopTree.java +++ b/src/main/java/net/gkid117/choptree/ChopTree.java @@ -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)); @@ -222,7 +222,7 @@ public void loadConfig() } private List filterConfigParams(String configVar, String contain) { - final List input = Arrays.asList(config.getString(configVar).split(",")); + final List input = config.getStringList(configVar); final List notAllowed = new ArrayList<>(); final List output = input.stream().filter(block -> { final Boolean ret = block.contains(contain); diff --git a/src/main/ressources/config.yml b/src/main/ressources/config.yml index 717eec1..086925f 100644 --- a/src/main/ressources/config.yml +++ b/src/main/ressources/config.yml @@ -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 \ No newline at end of file +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 diff --git a/src/main/ressources/plugin.yml b/src/main/ressources/plugin.yml index 81c672a..708168c 100644 --- a/src/main/ressources/plugin.yml +++ b/src/main/ressources/plugin.yml @@ -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