bunnyi116 / fabric-bedrock-miner

一个用于挖掘基岩的Fabric客户端模组!A fabric client mod to mine bedrock!
GNU General Public License v3.0
184 stars 15 forks source link

[suggestion] add option to bypass requirements if they are met in other ways #32

Closed jamuwu closed 5 months ago

jamuwu commented 5 months ago

I have mods that make it possible to achieve instant mining of blocks without haste, but this mod makes haste II a requirement. Could you add the option to bypass this?

bunnyi116 commented 5 months ago
yan.lx.bedrockminer.task.TaskManager.reverseCheckInventoryItemConditionsAllow           

if (!InventoryManagerUtils.canInstantlyMinePiston()) {
      msg = BedrockMinerLang.FAIL_MISSING_INSTANTMINE;
}

remove


yan.lx.bedrockminer.utils.InventoryManagerUtils#canPlayerInventoryAllItemIsInstantlyMinePiston

    public static boolean canPlayerInventoryAllItemIsInstantlyMinePiston() {
        var client = MinecraftClient.getInstance();
        var player = client.player;
        if (player == null) return false;
        var playerInventory = player.getInventory();
        for (int i = 0; i < playerInventory.size(); i++) {
            if (isInstantBreakingBlock(Blocks.PISTON.getDefaultState(), playerInventory.getStack(i))) {
                return true;
            }
        }
        return false;
    }
public static boolean canPlayerInventoryAllItemIsInstantlyMinePiston() {
    return true;
}

return true