diff --git a/build/resources/main/config.yml b/build/resources/main/config.yml new file mode 100644 index 0000000..aaf9df9 --- /dev/null +++ b/build/resources/main/config.yml @@ -0,0 +1,82 @@ +# The overall settings for the plugin itself +plugin_settings: + + # The permission required to use the assist feature. + permission: "toolassist.activate" + + # How many blocks outwards should be scanned + search_radius: 15 + + # Whether a user must be sneaking to activate + sneak_activation: true + + # Whether to use the respective tool to trigger activation, or to use the groupings listed below. + no_config: false + +# The block material that can be targeted by the respective tool grouping +tool_settings: + + # Blocks which are affected by pickaxes + pickaxe: + - COAL_ORE + - COPPER_ORE + - IRON_ORE + - GOLD_ORE + - REDSTONE_ORE + - LAPIS_LAZULI_ORE + - EMERALD_ORE + - DIAMOND_ORE + - DEEPSLATE_COAL_ORE + - DEEPSLATE_IRON_ORE + - DEEPSLATE_GOLD_ORE + - DEEPSLATE_REDSTONE_ORE + - DEEPSLATE_LAPIS_ORE + - DEEPSLATE_EMERALD_ORE + - DEEPSLATE_DIAMOND_ORE + - DEEPSLATE_COPPER_ORE + - NETHER_QUARTZ_ORE + - NETHER_GOLD_ORE + + # Blocks which are affected by axes + axe: + - OAK_LOG + - DARK_OAK_LOG + - BIRCH_LOG + - SPRUCE_LOG + - JUNGLE_LOG + - ACACIA_LOG + - STRIPPED_OAK_LOG + - STRIPPED_DARK_OAK_LOG + - STRIPPED_BIRCH_LOG + - STRIPPED_SPRUCE_LOG + - STRIPPED_JUNGLE_LOG + - STRIPPED_ACACIA_LOG + + # Blocks which are affected by shovels + shovel: + - SAND + - GRAVEL + + # Blocks which are affected by hoes + hoe: + - WARPED_WART_BLOCK + - NETHER_WART_BLOCK + - SPONGE + - WET_SPONGE + + # Blocks which are affected by swords + sword: + - COBWEB + + # Blocks which are affected by shears + shears: + - OAK_LEAVES + - DARK_OAK_LEAVES + - BIRCH_LEAVES + - JUNGLE_LEAVES + - ACACIA_LEAVES + - SPRUCE_LEAVES + - VINE + - CAVE_VINES_PLANT + - WEEPING_VINES_PLANT + - TWISTING_VINES_PLANT \ No newline at end of file diff --git a/build/resources/main/plugin.yml b/build/resources/main/plugin.yml new file mode 100644 index 0000000..00b332e --- /dev/null +++ b/build/resources/main/plugin.yml @@ -0,0 +1,6 @@ +name: ToolAssist +version: 'v1.0-Alpha' +main: io.github.simplex.toolassist.ToolAssist +api-version: 1.18 +authors: [ SimplexDevelopment ] +description: A lightweight vein-mining plugin. diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..44b2dd3 Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/build/tmp/jar/MANIFEST.MF b/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/main/java/io/github/simplex/toolassist/data/BlockIdentifier.java b/src/main/java/io/github/simplex/toolassist/data/BlockIdentifier.java index b60365f..494b663 100644 --- a/src/main/java/io/github/simplex/toolassist/data/BlockIdentifier.java +++ b/src/main/java/io/github/simplex/toolassist/data/BlockIdentifier.java @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.List; public class BlockIdentifier { - private final List blockList = new ArrayList<>(); private final ToolAssist plugin; boolean isValid = false; @@ -18,9 +17,9 @@ public class BlockIdentifier { } public List populateAndRetrieve(Block block, ItemStack requiredItem) { + List surroundingBlocks = new ArrayList<>(); Location start = block.getLocation().clone(); int radius = plugin.getConfig().getSettings().radius(); - List surroundingBlocks = new ArrayList<>(); for (double x = start.getX() - radius; x <= start.getX() + radius; x++) { for (double y = start.getY() - radius; y <= start.getY() + radius; y++) { for (double z = start.getZ() - radius; z <= start.getZ() + radius; z++) { @@ -31,9 +30,7 @@ public class BlockIdentifier { } } } - blockList.addAll(surroundingBlocks); - - return blockList; + return surroundingBlocks; } public boolean checkBlock(Block block, ItemStack targetItem) {