From c324f11a96f55c5bd511fdbbfd6c50016cb46bf7 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 24 Dec 2018 12:15:11 -0600 Subject: [PATCH] Fix bad block breaking that NCP doesn't agree with --- src/api/java/baritone/api/Settings.java | 4 ---- src/api/java/baritone/api/utils/IPlayerController.java | 2 -- src/main/java/baritone/utils/BlockBreakHelper.java | 10 ---------- .../baritone/utils/player/PrimaryPlayerController.java | 5 ----- 4 files changed, 21 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 9df80d2f..1b4f62e0 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -452,10 +452,6 @@ public class Settings { /** * {@code true}: can mine blocks when in inventory, chat, or tabbed away in ESC menu - *

- * {@code false}: works on cosmic prisons - *

- * LOL */ public Setting leftClickWorkaround = new Setting<>(true); diff --git a/src/api/java/baritone/api/utils/IPlayerController.java b/src/api/java/baritone/api/utils/IPlayerController.java index 8ecc7e11..dd63a41b 100644 --- a/src/api/java/baritone/api/utils/IPlayerController.java +++ b/src/api/java/baritone/api/utils/IPlayerController.java @@ -30,8 +30,6 @@ import net.minecraft.world.GameType; */ public interface IPlayerController { - boolean clickBlock(BlockPos pos, EnumFacing side); - boolean onPlayerDamageBlock(BlockPos pos, EnumFacing side); void resetBlockRemoving(); diff --git a/src/main/java/baritone/utils/BlockBreakHelper.java b/src/main/java/baritone/utils/BlockBreakHelper.java index 9f5b970d..36f31c6d 100644 --- a/src/main/java/baritone/utils/BlockBreakHelper.java +++ b/src/main/java/baritone/utils/BlockBreakHelper.java @@ -31,11 +31,6 @@ import net.minecraft.util.math.RayTraceResult; */ public final class BlockBreakHelper implements Helper { - /** - * The last block that we tried to break, if this value changes - * between attempts, then we re-initialize the breaking process. - */ - private BlockPos lastBlock; private boolean didBreakLastTick; private IPlayerContext playerContext; @@ -45,13 +40,9 @@ public final class BlockBreakHelper implements Helper { } public void tryBreakBlock(BlockPos pos, EnumFacing side) { - if (!pos.equals(lastBlock)) { - playerContext.playerController().clickBlock(pos, side); - } if (playerContext.playerController().onPlayerDamageBlock(pos, side)) { playerContext.player().swingArm(EnumHand.MAIN_HAND); } - lastBlock = pos; } public void stopBreakingBlock() { @@ -59,7 +50,6 @@ public final class BlockBreakHelper implements Helper { if (playerContext.player() != null) { playerContext.playerController().resetBlockRemoving(); } - lastBlock = null; } private boolean fakeBreak() { diff --git a/src/main/java/baritone/utils/player/PrimaryPlayerController.java b/src/main/java/baritone/utils/player/PrimaryPlayerController.java index fa4ced9d..7b998bb5 100644 --- a/src/main/java/baritone/utils/player/PrimaryPlayerController.java +++ b/src/main/java/baritone/utils/player/PrimaryPlayerController.java @@ -34,11 +34,6 @@ public enum PrimaryPlayerController implements IPlayerController, Helper { INSTANCE; - @Override - public boolean clickBlock(BlockPos pos, EnumFacing side) { - return mc.playerController.clickBlock(pos, side); - } - @Override public boolean onPlayerDamageBlock(BlockPos pos, EnumFacing side) { return mc.playerController.onPlayerDamageBlock(pos, side);