1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35: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.utils.tags.SlimefunTag;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
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 block
* The {@link Block} to check
*
* @param type
* The {@link Material} 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();
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS) {
return canMineAncientDebris.getValue();
} else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(type)) {
return canMineDeepslateOres.getValue();
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && block.getType() == Material.ANCIENT_DEBRIS) {
return canMineAncientDebris.getValue() && !BlockStorage.hasBlockInfo(block);
} else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(block.getType())) {
return canMineDeepslateOres.getValue() && !BlockStorage.hasBlockInfo(block);
} else {
return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type);
return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(block.getType()) && !BlockStorage.hasBlockInfo(block);
}
}