1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Update IndustrialMiner.java

This commit is contained in:
FN-FAL113 2022-08-05 09:03:30 +08:00 committed by GitHub
parent de5e17533e
commit 25ced40d33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel;
/** /**
@ -202,22 +203,22 @@ public class IndustrialMiner extends MultiBlockMachine {
} }
/** /**
* This returns whether this {@link IndustrialMiner} can mine the given {@link Material}. * This returns whether this {@link IndustrialMiner} can mine the given {@link Block}.
* *
* @param type * @param block
* The {@link Material} to check * The {@link Block} to check
* *
* @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Block}
*/ */
public boolean canMine(@Nonnull Material type) { public boolean canMine(@Nonnull Block block) {
MinecraftVersion version = Slimefun.getMinecraftVersion(); MinecraftVersion version = Slimefun.getMinecraftVersion();
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS) { if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && block.getType() == Material.ANCIENT_DEBRIS) {
return canMineAncientDebris.getValue(); return canMineAncientDebris.getValue() && !BlockStorage.hasBlockInfo(block);
} else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(type)) { } else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(block.getType())) {
return canMineDeepslateOres.getValue(); return canMineDeepslateOres.getValue() && !BlockStorage.hasBlockInfo(block);
} else { } else {
return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type); return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(block.getType()) && !BlockStorage.hasBlockInfo(block);
} }
} }