From 7285277707d25d27edcb2b98737a3543536cf7bf Mon Sep 17 00:00:00 2001 From: Martin Brom Date: Fri, 9 Jul 2021 23:59:27 +0200 Subject: [PATCH] Add the option to prevent IndustrialMiner from mining deepslate ores --- .../items/multiblocks/miner/IndustrialMiner.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java index dec2ebd5f..37ba21a27 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java @@ -52,6 +52,7 @@ public class IndustrialMiner extends MultiBlockMachine { protected final List fuelTypes = new ArrayList<>(); private final ItemSetting canMineAncientDebris = new ItemSetting<>(this, "can-mine-ancient-debris", false); + private final ItemSetting canMineDeepslateOres = new ItemSetting<>(this, "can-mine-deepslate-ores", false); private final boolean silkTouch; private final int range; @@ -64,6 +65,7 @@ public class IndustrialMiner extends MultiBlockMachine { registerDefaultFuelTypes(); addItemSetting(canMineAncientDebris); + addItemSetting(canMineDeepslateOres); } /** @@ -217,14 +219,15 @@ public class IndustrialMiner extends MultiBlockMachine { * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} */ public boolean canMine(@Nonnull Material type) { - if (SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type)) { - return true; - } else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - return type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue(); - + if (type == Material.ANCIENT_DEBRIS) { + return canMineAncientDebris.getValue() && SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16); } - return false; + if (SlimefunTag.DEEPSLATE_ORES.isTagged(type)) { + return canMineDeepslateOres.getValue() && SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17); + } + + return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type); } }