From 67fa91abe8c1e53651b286e07b3bdfad5efbe7ab Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 7 Feb 2019 15:55:39 -0800 Subject: [PATCH 01/42] fixes to descend, and goto coords --- .../movement/movements/MovementDescend.java | 7 +- .../baritone/pathing/path/PathExecutor.java | 2 +- .../utils/ExampleBaritoneControl.java | 72 +++++++++++-------- 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDescend.java b/src/main/java/baritone/pathing/movement/movements/MovementDescend.java index 4f1bce4d6..914a2993e 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDescend.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDescend.java @@ -245,7 +245,7 @@ public class MovementDescend extends Movement { // (dest - src) + dest is offset 1 more in the same direction // so it's the block we'd need to worry about running into if we decide to sprint straight through this descend BlockPos into = dest.subtract(src.down()).add(dest); - if (!MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into)) && MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into).up()) && MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into).up(2))) { + if (skipToAscend()) { // if dest extends into can't walk through, but the two above are can walk through, then we can overshoot and glitch in that weird way return true; } @@ -256,4 +256,9 @@ public class MovementDescend extends Movement { } return false; } + + public boolean skipToAscend() { + BlockPos into = dest.subtract(src.down()).add(dest); + return !MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into)) && MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into).up()) && MovementHelper.canWalkThrough(ctx, new BetterBlockPos(into).up(2)); + } } diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 1b59f8e32..fffae13fb 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -398,7 +398,7 @@ public class PathExecutor implements IPathExecutor, Helper { IMovement current = path.movements().get(pathPosition); if (current instanceof MovementDescend) { - if (((MovementDescend) current).safeMode()) { + if (((MovementDescend) current).safeMode() && !((MovementDescend) current).skipToAscend()) { logDebug("Sprinting would be unsafe"); return false; } diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index a5b2b57e1..97282a636 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -163,36 +163,19 @@ public class ExampleBaritoneControl extends Behavior implements Helper { } if (msg.startsWith("goal")) { - String[] params = msg.substring(4).trim().split(" "); - if (params[0].equals("")) { - params = new String[]{}; - } + String rest = msg.substring(4).trim(); Goal goal; - try { - switch (params.length) { - case 0: - goal = new GoalBlock(ctx.playerFeet()); - break; - case 1: - if (params[0].equals("clear") || params[0].equals("none")) { - goal = null; - } else { - goal = new GoalYLevel(Integer.parseInt(params[0])); - } - break; - case 2: - goal = new GoalXZ(Integer.parseInt(params[0]), Integer.parseInt(params[1])); - break; - case 3: - goal = new GoalBlock(new BlockPos(Integer.parseInt(params[0]), Integer.parseInt(params[1]), Integer.parseInt(params[2]))); - break; - default: - logDirect("unable to understand lol"); - return true; + if (rest.equals("clear") || rest.equals("none")) { + goal = null; + } else { + String[] params = rest.split(" "); + if (params[0].equals("")) { + params = new String[]{}; + } + goal = parseGoal(params); + if (goal == null) { + return true; } - } catch (NumberFormatException ex) { - logDirect("unable to parse integer " + ex); - return true; } customGoalProcess.setGoal(goal); logDirect("Goal: " + goal); @@ -469,7 +452,11 @@ public class ExampleBaritoneControl extends Behavior implements Helper { if (block == null) { waypoint = baritone.getWorldProvider().getCurrentWorld().getWaypoints().getAllWaypoints().stream().filter(w -> w.getName().equalsIgnoreCase(mining)).max(Comparator.comparingLong(IWaypoint::getCreationTimestamp)).orElse(null); if (waypoint == null) { - logDirect("No locations for " + mining + " known, cancelling"); + Goal goal = parseGoal(waypointType.split(" ")); + if (goal != null) { + logDirect("Going to " + goal); + customGoalProcess.setGoalAndPath(goal); + } return true; } } else { @@ -548,4 +535,31 @@ public class ExampleBaritoneControl extends Behavior implements Helper { } } } + + private Goal parseGoal(String[] params) { + Goal goal; + try { + switch (params.length) { + case 0: + goal = new GoalBlock(ctx.playerFeet()); + break; + case 1: + goal = new GoalYLevel(Integer.parseInt(params[0])); + break; + case 2: + goal = new GoalXZ(Integer.parseInt(params[0]), Integer.parseInt(params[1])); + break; + case 3: + goal = new GoalBlock(new BlockPos(Integer.parseInt(params[0]), Integer.parseInt(params[1]), Integer.parseInt(params[2]))); + break; + default: + logDirect("unable to understand lol"); + return null; + } + } catch (NumberFormatException ex) { + logDirect("unable to parse integer " + ex); + return null; + } + return goal; + } } From 42513e4b56847ae4ff561e4f324cabb308e78e5d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 7 Feb 2019 16:12:34 -0800 Subject: [PATCH 02/42] better check --- src/main/java/baritone/behavior/PathingBehavior.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 3776f55e7..c0c21e92f 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -441,7 +441,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, Optional executor = calcResult.getPath().map(p -> new PathExecutor(PathingBehavior.this, p)); if (current == null) { if (executor.isPresent()) { - if (executor.get().getPath().getSrc().equals(expectedSegmentStart)) { + if (executor.get().getPath().positions().contains(expectedSegmentStart)) { queuePathEvent(PathEvent.CALC_FINISHED_NOW_EXECUTING); current = executor.get(); } else { From 9a29f9ce573dd1f73c026de108c9611921e2e88f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 7 Feb 2019 16:39:15 -0800 Subject: [PATCH 03/42] better behavior on arrival and failure --- src/main/java/baritone/process/GetToBlockProcess.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index c3ac0616d..a6e2e68b8 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -82,12 +82,13 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl } return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL); } + Goal goal = new GoalComposite(knownLocations.stream().map(this::createGoal).toArray(Goal[]::new)); if (calcFailed) { logDirect("Unable to find any path to " + gettingTo + ", canceling GetToBlock"); if (isSafeToCancel) { onLostControl(); } - return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL); + return new PathingCommand(goal, PathingCommandType.CANCEL_AND_SET_GOAL); } int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get(); if (mineGoalUpdateInterval != 0 && tickCount++ % mineGoalUpdateInterval == 0) { // big brain @@ -95,15 +96,16 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl CalculationContext context = new CalculationContext(baritone, true); Baritone.getExecutor().execute(() -> rescan(current, context)); } - Goal goal = new GoalComposite(knownLocations.stream().map(this::createGoal).toArray(Goal[]::new)); if (goal.isInGoal(ctx.playerFeet()) && isSafeToCancel) { // we're there if (rightClickOnArrival(gettingTo)) { if (rightClick()) { onLostControl(); + return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL); } } else { onLostControl(); + return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL); } } return new PathingCommand(goal, PathingCommandType.REVALIDATE_GOAL_AND_PATH); From d0d8b12fb8d645bc0a2427fcc7bfa7a1e0970083 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 7 Feb 2019 17:18:14 -0800 Subject: [PATCH 04/42] add clickCancel, fixes #326 --- src/api/java/baritone/api/Settings.java | 5 +++++ src/launch/java/baritone/launch/mixins/MixinKeyBinding.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index ecadb5711..85d823ea1 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -378,6 +378,11 @@ public final class Settings { */ public final Setting pruneRegionsFromRAM = new Setting<>(false); + /** + * Cancel baritone on left click, as a form of "panic button" + */ + public final Setting clickCancel = new Setting<>(false); + /** * Remember the contents of containers (chests, echests, furnaces) *

diff --git a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java index 9ef080bf4..4db240e3d 100644 --- a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java +++ b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java @@ -20,6 +20,7 @@ package baritone.launch.mixins; import baritone.Baritone; import baritone.api.BaritoneAPI; import baritone.utils.Helper; +import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -61,6 +62,9 @@ public class MixinKeyBinding { private void isPressed(CallbackInfoReturnable cir) { // only the primary baritone forces keys Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this); + if (pressTime > 0 && (KeyBinding) (Object) this == Minecraft.getMinecraft().gameSettings.keyBindAttack && Baritone.settings().clickCancel.get()) { + BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything(); + } if (force != null && !force && Baritone.settings().suppressClicks.get()) { // <-- cursed if (pressTime > 0) { Helper.HELPER.logDirect("You're trying to press this mouse button but I won't let you."); From e37a09a1c80ced7bc5540c0112f40da81fce665a Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 8 Feb 2019 12:08:34 -0800 Subject: [PATCH 05/42] makes mining faster, fixes #330 --- src/main/java/baritone/process/MineProcess.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 806774561..e345c8b8a 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -250,6 +250,14 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro public static List prune(CalculationContext ctx, List locs2, List mining, int max) { List dropped = droppedItemsScan(mining, ctx.world); + dropped.removeIf(drop -> { + for (BlockPos pos : locs2) { + if (mining.contains(ctx.getBlock(pos.getX(), pos.getY(), pos.getZ())) && MineProcess.plausibleToBreak(ctx.bsi, pos) && pos.distanceSq(drop) <= 9) { // TODO maybe drop also has to be supported? no lava below? + return true; + } + } + return false; + }); List locs = locs2 .stream() .distinct() From 1a430dc2cf4b2d5d719c9a6d0378eef0bbfc4f5c Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 9 Feb 2019 17:38:42 -0800 Subject: [PATCH 06/42] explain --- src/main/java/baritone/utils/InputOverrideHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/InputOverrideHandler.java b/src/main/java/baritone/utils/InputOverrideHandler.java index 30ec84091..c6db6dc57 100755 --- a/src/main/java/baritone/utils/InputOverrideHandler.java +++ b/src/main/java/baritone/utils/InputOverrideHandler.java @@ -115,7 +115,7 @@ public final class InputOverrideHandler extends Behavior implements IInputOverri ctx.player().movementInput = new PlayerMovementInput(this); } } else { - if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) { + if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) { // allow other movement inputs that arent this one, e.g. for a freecam ctx.player().movementInput = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings); } } From 9d1d4fe0d9e3680be59ad0a8cfe2c7f0e4f80b1f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 10:44:04 -0800 Subject: [PATCH 07/42] typo --- src/main/java/baritone/utils/InputOverrideHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/InputOverrideHandler.java b/src/main/java/baritone/utils/InputOverrideHandler.java index c6db6dc57..f32bdaa46 100755 --- a/src/main/java/baritone/utils/InputOverrideHandler.java +++ b/src/main/java/baritone/utils/InputOverrideHandler.java @@ -115,7 +115,7 @@ public final class InputOverrideHandler extends Behavior implements IInputOverri ctx.player().movementInput = new PlayerMovementInput(this); } } else { - if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) { // allow other movement inputs that arent this one, e.g. for a freecam + if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) { // allow other movement inputs that aren't this one, e.g. for a freecam ctx.player().movementInput = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings); } } From a18eb90702a5f1d71a728efe8f207ddce88d5daf Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 13:49:28 -0800 Subject: [PATCH 08/42] address glaring inconsistency --- src/api/java/baritone/api/Settings.java | 2 +- src/main/java/baritone/behavior/PathingBehavior.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 85d823ea1..2e1115acf 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -277,7 +277,7 @@ public final class Settings { /** * Start planning the next path once the remaining movements tick estimates sum up to less than this value */ - public final Setting planningTickLookAhead = new Setting<>(150); + public final Setting planningTickLookahead = new Setting<>(150); /** * Default size of the Long2ObjectOpenHashMap used in pathing diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index c0c21e92f..004f149fa 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -196,7 +196,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, // and this path doesn't get us all the way there return; } - if (ticksRemainingInSegment(false).get() < Baritone.settings().planningTickLookAhead.get()) { + if (ticksRemainingInSegment(false).get() < Baritone.settings().planningTickLookahead.get()) { // and this path has 7.5 seconds or less left // don't include the current movement so a very long last movement (e.g. descend) doesn't trip it up // if we actually included current, it wouldn't start planning ahead until the last movement was done, if the last movement took more than 7.5 seconds on its own From 7017e9e2eac11b0739b0aac97fb7b6c277b577c9 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 15:10:44 -0800 Subject: [PATCH 09/42] crucial performance optimization --- src/main/java/baritone/process/MineProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index e345c8b8a..513caed04 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -252,7 +252,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro List dropped = droppedItemsScan(mining, ctx.world); dropped.removeIf(drop -> { for (BlockPos pos : locs2) { - if (mining.contains(ctx.getBlock(pos.getX(), pos.getY(), pos.getZ())) && MineProcess.plausibleToBreak(ctx.bsi, pos) && pos.distanceSq(drop) <= 9) { // TODO maybe drop also has to be supported? no lava below? + if (pos.distanceSq(drop) <= 9 && mining.contains(ctx.getBlock(pos.getX(), pos.getY(), pos.getZ())) && MineProcess.plausibleToBreak(ctx.bsi, pos)) { // TODO maybe drop also has to be supported? no lava below? return true; } } From 4868ed75606badb0f726005c9dc971ccd17ee9e9 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 15:12:52 -0800 Subject: [PATCH 10/42] explain whats going on --- src/launch/java/baritone/launch/mixins/MixinKeyBinding.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java index 4db240e3d..6814b6d62 100644 --- a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java +++ b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java @@ -63,7 +63,9 @@ public class MixinKeyBinding { // only the primary baritone forces keys Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this); if (pressTime > 0 && (KeyBinding) (Object) this == Minecraft.getMinecraft().gameSettings.keyBindAttack && Baritone.settings().clickCancel.get()) { + Helper.HELPER.logDirect("Cancelling path on left click since the clickCancel setting is enabled!"); BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything(); + return; } if (force != null && !force && Baritone.settings().suppressClicks.get()) { // <-- cursed if (pressTime > 0) { From bb000c4e3fbd301bccb963d1a75e50537d9e995a Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 16:44:09 -0800 Subject: [PATCH 11/42] include diagonals, and better settings --- README.md | 2 ++ USAGE.md | 2 +- src/api/java/baritone/api/Settings.java | 13 +++++++++++++ src/main/java/baritone/process/MineProcess.java | 10 ++++++---- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c4b35a3b..e7e51c018 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ Here are some links to help to get started: - [Javadocs](https://baritone.leijurv.com/) +- [Settings](https://baritone.leijurv.com/baritone/api/Settings.html) + # Chat control - [Baritone chat control usage](USAGE.md) diff --git a/USAGE.md b/USAGE.md index dab1edb13..a34244ce9 100644 --- a/USAGE.md +++ b/USAGE.md @@ -43,7 +43,7 @@ Some common examples: For the rest of the commands, you can take a look at the code [here](https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/utils/ExampleBaritoneControl.java). -All the settings and documentation are here. If you find HTML easier to read than Javadoc, you can look here and navigate to Settings in the left sidebar. +All the settings and documentation are here. If you find HTML easier to read than Javadoc, you can look here. There are about a hundred settings, but here are some fun / interesting / important ones that you might want to look at changing in normal usage of Baritone. The documentation for each can be found at the above links. - `allowBreak` diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 2e1115acf..1182579fd 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -563,6 +563,19 @@ public final class Settings { */ public final Setting legitMineYLevel = new Setting<>(11); + /** + * Magically see ores that are separated diagonally from existing ores. Basically like mining around the ores that it finds + * in case there's one there touching it diagonally, except it checks it un-legit-ly without having the mine blocks to see it. + * You can decide whether this looks plausible or not. + *

+ * This is disabled because it results in some weird behavior. For example, it can """see""" the top block of a vein of iron_ore + * through a lava lake. This isn't an issue normally since it won't consider anything touching lava, so it just ignores it. + * However, this setting expands that and allows it to see the entire vein so it'll mine under the lava lake to get the iron that + * it can reach without mining blocks adjacent to lava. This really defeats the purpose of legitMine since a player could never + * do that lol, so thats one reason why its disabled + */ + public final Setting legitMineIncludeDiagonals = new Setting<>(false); + /** * When mining block of a certain type, try to mine two at once instead of one. * If the block above is also a goal block, set GoalBlock instead of GoalTwoBlocks diff --git a/src/main/java/baritone/process/MineProcess.java b/src/main/java/baritone/process/MineProcess.java index 513caed04..a299bf314 100644 --- a/src/main/java/baritone/process/MineProcess.java +++ b/src/main/java/baritone/process/MineProcess.java @@ -228,7 +228,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro return prune(ctx, locs, mining, max); } - public void addNearby() { + private void addNearby() { knownOreLocations.addAll(droppedItemsScan(mining, ctx.world())); BlockPos playerFeet = ctx.playerFeet(); BlockStateInterface bsi = new BlockStateInterface(ctx); @@ -239,8 +239,11 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro for (int z = playerFeet.getZ() - searchDist; z <= playerFeet.getZ() + searchDist; z++) { // crucial to only add blocks we can see because otherwise this // is an x-ray and it'll get caught - if (mining.contains(bsi.get0(x, y, z).getBlock()) && RotationUtils.reachable(ctx.player(), new BlockPos(x, y, z), fakedBlockReachDistance).isPresent()) { - knownOreLocations.add(new BlockPos(x, y, z)); + if (mining.contains(bsi.get0(x, y, z).getBlock())) { + BlockPos pos = new BlockPos(x, y, z); + if ((Baritone.settings().legitMineIncludeDiagonals.get() && knownOreLocations.stream().anyMatch(ore -> ore.distanceSq(pos) <= 2 /* sq means this is pytha dist <= sqrt(2) */)) || RotationUtils.reachable(ctx.player(), pos, fakedBlockReachDistance).isPresent()) { + knownOreLocations.add(pos); + } } } } @@ -263,7 +266,6 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro .distinct() // remove any that are within loaded chunks that aren't actually what we want - .filter(pos -> !ctx.bsi.worldContainsLoadedChunk(pos.getX(), pos.getZ()) || mining.contains(ctx.getBlock(pos.getX(), pos.getY(), pos.getZ())) || dropped.contains(pos)) // remove any that are implausible to mine (encased in bedrock, or touching lava) From 503f2fb1975a3403dc72009cb13b432ba3f993c6 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 16:46:24 -0800 Subject: [PATCH 12/42] direct link to the top of the detail section since its not sorted alphabetically --- README.md | 2 +- USAGE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7e51c018..f2e4e4564 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Here are some links to help to get started: - [Javadocs](https://baritone.leijurv.com/) -- [Settings](https://baritone.leijurv.com/baritone/api/Settings.html) +- [Settings](https://baritone.leijurv.com/baritone/api/Settings.html#allowBreak) # Chat control diff --git a/USAGE.md b/USAGE.md index a34244ce9..391e5e456 100644 --- a/USAGE.md +++ b/USAGE.md @@ -43,7 +43,7 @@ Some common examples: For the rest of the commands, you can take a look at the code [here](https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/utils/ExampleBaritoneControl.java). -All the settings and documentation are here. If you find HTML easier to read than Javadoc, you can look here. +All the settings and documentation are here. If you find HTML easier to read than Javadoc, you can look here. There are about a hundred settings, but here are some fun / interesting / important ones that you might want to look at changing in normal usage of Baritone. The documentation for each can be found at the above links. - `allowBreak` From 1d88564a7217e5aecebbd18c99152064fffe941a Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 10 Feb 2019 16:50:54 -0800 Subject: [PATCH 13/42] clarify this setting since its got a similar name --- src/api/java/baritone/api/Settings.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 1182579fd..0fb26134f 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -308,6 +308,8 @@ public final class Settings { * Is it okay to sprint through a descend followed by a diagonal? * The player overshoots the landing, but not enough to fall off. And the diagonal ensures that there isn't * lava or anything that's !canWalkInto in that space, so it's technically safe, just a little sketchy. + *

+ * Note: this is *not* related to the allowDiagonalDescend setting, that is a completely different thing. */ public final Setting allowOvershootDiagonalDescend = new Setting<>(true); From 36f608c63c0e0d1a293fef331efe3b9f2f83cc50 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 11 Feb 2019 19:21:08 -0800 Subject: [PATCH 14/42] add epic gamer address --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f2e4e4564..71c6f6b8b 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ the original version of the bot for Minecraft 1.8, rebuilt for 1.12.2. Baritone Have committed at least once a day for the last 6 months =D 🦀 +1Leijurv3DWTrGAfmmiTphjhXLvQiHg7K2 + Here are some links to help to get started: - [Features](FEATURES.md) From cf38d593b88e374552b7a789055b3effbfc19310 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 11 Feb 2019 22:20:59 -0800 Subject: [PATCH 15/42] thanks leafeon --- src/main/java/baritone/utils/ExampleBaritoneControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 97282a636..aa57e3469 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -236,7 +236,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { logDirect("Queued " + count + " chunks for repacking"); return true; } - if (msg.equals("axis")) { + if (msg.equals("axis") || msg.equals("highway")) { customGoalProcess.setGoalAndPath(new GoalAxis()); return true; } From 24fa75c24e63af55c183f2e6e51cc2e89076cef7 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 11 Feb 2019 22:26:49 -0800 Subject: [PATCH 16/42] did someone say more badges --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 71c6f6b8b..0cbaa6428 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ [![Pull Requests](https://img.shields.io/github/issues-pr/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/pulls/) ![Code size](https://img.shields.io/github/languages/code-size/cabaletta/baritone.svg) ![GitHub repo size](https://img.shields.io/github/repo-size/cabaletta/baritone.svg) +![](https://tokei.rs/b1/github/cabaletta/baritone?category=code) +![](https://tokei.rs/b1/github/cabaletta/baritone?category=files) [![Minecraft](https://img.shields.io/badge/MC-1.12.2-green.svg)](https://minecraft.gamepedia.com/1.12.2) [![GitHub contributors](https://img.shields.io/github/contributors/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/graphs/contributors/) [![GitHub commits](https://img.shields.io/github/commits-since/cabaletta/baritone/v1.0.0.svg)](https://github.com/cabaletta/baritone/commit/) From 8d481ba394b5ba4e193ab4dcdf645ad3f4e9d923 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 12 Feb 2019 09:58:44 -0800 Subject: [PATCH 17/42] lol --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0cbaa6428..eb96e9e4a 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAnd ## Can I use Baritone as a library in my custom utility client? -Sure! (As long as usage is in compliance with the LGPL 3 License) +That's what it's for, sure! (As long as usage is in compliance with the LGPL 3 License) ## How is it so fast? From aac7ebf6dd11af83061405542579de67b68fccd4 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 12 Feb 2019 18:32:03 -0800 Subject: [PATCH 18/42] avoid creating callbackinfo at all costs --- .../launch/mixins/MixinChunkRenderContainer.java | 14 +++++++++----- .../baritone/launch/mixins/MixinRenderList.java | 8 ++++---- .../baritone/launch/mixins/MixinVboRenderList.java | 8 ++++---- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/launch/java/baritone/launch/mixins/MixinChunkRenderContainer.java b/src/launch/java/baritone/launch/mixins/MixinChunkRenderContainer.java index fef16d6b4..511e1c143 100644 --- a/src/launch/java/baritone/launch/mixins/MixinChunkRenderContainer.java +++ b/src/launch/java/baritone/launch/mixins/MixinChunkRenderContainer.java @@ -22,27 +22,31 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ChunkRenderContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.util.math.BlockPos; import org.lwjgl.opengl.GL14; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.Redirect; import static org.lwjgl.opengl.GL11.*; @Mixin(ChunkRenderContainer.class) public class MixinChunkRenderContainer { - @Inject( + @Redirect( // avoid creating CallbackInfo at all costs; this is called 40k times per second method = "preRenderChunk", - at = @At("HEAD") + at = @At( + value = "INVOKE", + target = "net/minecraft/client/renderer/chunk/RenderChunk.getPosition()Lnet/minecraft/util/math/BlockPos;" + ) ) - private void preRenderChunk(RenderChunk renderChunkIn, CallbackInfo ci) { + private BlockPos getPosition(RenderChunk renderChunkIn) { if (Baritone.settings().renderCachedChunks.get() && Minecraft.getMinecraft().world.getChunk(renderChunkIn.getPosition()).isEmpty()) { GlStateManager.enableAlpha(); GlStateManager.enableBlend(); GL14.glBlendColor(0, 0, 0, Baritone.settings().cachedChunksOpacity.get()); GlStateManager.tryBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE, GL_ZERO); } + return renderChunkIn.getPosition(); } } diff --git a/src/launch/java/baritone/launch/mixins/MixinRenderList.java b/src/launch/java/baritone/launch/mixins/MixinRenderList.java index 55d1da70a..3d4d8a910 100644 --- a/src/launch/java/baritone/launch/mixins/MixinRenderList.java +++ b/src/launch/java/baritone/launch/mixins/MixinRenderList.java @@ -22,25 +22,25 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderList; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.Redirect; import static org.lwjgl.opengl.GL11.*; @Mixin(RenderList.class) public class MixinRenderList { - @Inject( + @Redirect( // avoid creating CallbackInfo at all costs; this is called 40k times per second method = "renderChunkLayer", at = @At( value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.popMatrix()V" ) ) - private void renderChunkLayer(CallbackInfo info) { + private void popMatrix() { if (Baritone.settings().renderCachedChunks.get()) { // reset the blend func to normal (not dependent on constant alpha) GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO); } + GlStateManager.popMatrix(); } } diff --git a/src/launch/java/baritone/launch/mixins/MixinVboRenderList.java b/src/launch/java/baritone/launch/mixins/MixinVboRenderList.java index c2c9fd8c7..70048c8ca 100644 --- a/src/launch/java/baritone/launch/mixins/MixinVboRenderList.java +++ b/src/launch/java/baritone/launch/mixins/MixinVboRenderList.java @@ -22,25 +22,25 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.VboRenderList; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.Redirect; import static org.lwjgl.opengl.GL11.*; @Mixin(VboRenderList.class) public class MixinVboRenderList { - @Inject( + @Redirect( // avoid creating CallbackInfo at all costs; this is called 40k times per second method = "renderChunkLayer", at = @At( value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.popMatrix()V" ) ) - private void renderChunkLayer(CallbackInfo info) { + private void popMatrix() { if (Baritone.settings().renderCachedChunks.get()) { // reset the blend func to normal (not dependent on constant alpha) GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO); } + GlStateManager.popMatrix(); } } From 4026b850f899080bac82f5a2a1e6cf411b47651e Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 12 Feb 2019 18:34:58 -0800 Subject: [PATCH 19/42] dont spam debug chat --- src/main/java/baritone/behavior/PathingBehavior.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 004f149fa..d441c4168 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -378,7 +378,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, } if (MovementHelper.canWalkOn(ctx, possibleSupport.down()) && MovementHelper.canWalkThrough(ctx, possibleSupport) && MovementHelper.canWalkThrough(ctx, possibleSupport.up())) { // this is plausible - logDebug("Faking path start assuming player is standing off the edge of a block"); + //logDebug("Faking path start assuming player is standing off the edge of a block"); return possibleSupport; } } @@ -387,7 +387,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, // !onGround // we're in the middle of a jump if (MovementHelper.canWalkOn(ctx, feet.down().down())) { - logDebug("Faking path start assuming player is midair and falling"); + //logDebug("Faking path start assuming player is midair and falling"); return feet.down(); } } From 99cb7f51422370e395f2eeb8e91eef1e56d1cd6d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 12 Feb 2019 21:36:53 -0800 Subject: [PATCH 20/42] crucial performance optimization --- .../java/baritone/pathing/path/PathExecutor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index fffae13fb..c61ebc3d2 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -195,17 +195,17 @@ public class PathExecutor implements IPathExecutor, Helper { continue; } Movement m = (Movement) path.movements().get(i); - HashSet prevBreak = new HashSet<>(m.toBreak(bsi)); - HashSet prevPlace = new HashSet<>(m.toPlace(bsi)); - HashSet prevWalkInto = new HashSet<>(m.toWalkInto(bsi)); + List prevBreak = m.toBreak(bsi); + List prevPlace = m.toPlace(bsi); + List prevWalkInto = m.toWalkInto(bsi); m.resetBlockCache(); - if (!prevBreak.equals(new HashSet<>(m.toBreak(bsi)))) { + if (!prevBreak.equals(m.toBreak(bsi))) { recalcBP = true; } - if (!prevPlace.equals(new HashSet<>(m.toPlace(bsi)))) { + if (!prevPlace.equals(m.toPlace(bsi))) { recalcBP = true; } - if (!prevWalkInto.equals(new HashSet<>(m.toWalkInto(bsi)))) { + if (!prevWalkInto.equals(m.toWalkInto(bsi))) { recalcBP = true; } } From 90a1fa83375ab5aefaf414311c4954775c780617 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 12 Feb 2019 22:06:13 -0800 Subject: [PATCH 21/42] lol --- src/main/java/baritone/event/GameEventHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/event/GameEventHandler.java b/src/main/java/baritone/event/GameEventHandler.java index 84bac80fb..b1bb1182d 100644 --- a/src/main/java/baritone/event/GameEventHandler.java +++ b/src/main/java/baritone/event/GameEventHandler.java @@ -50,7 +50,9 @@ public final class GameEventHandler implements IEventBus, Helper { if (event.getType() == TickEvent.Type.IN) { try { baritone.bsi = new BlockStateInterface(baritone.getPlayerContext(), true); - } catch (Exception ex) {} + } catch (Exception ex) { + baritone.bsi = null; + } } else { baritone.bsi = null; } From c473914d0528ec93b507355b44a5b568059095e9 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 13:54:50 -0800 Subject: [PATCH 22/42] fix flashing backwards, fixes #265 --- src/api/java/baritone/api/utils/Rotation.java | 13 +++++++++++-- src/api/java/baritone/api/utils/RotationUtils.java | 7 +++++-- .../java/baritone/pathing/movement/Movement.java | 2 +- .../pathing/movement/movements/MovementFall.java | 4 ++-- .../pathing/movement/movements/MovementPillar.java | 2 +- .../movement/movements/MovementTraverse.java | 6 +++--- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/api/java/baritone/api/utils/Rotation.java b/src/api/java/baritone/api/utils/Rotation.java index 7f93547b5..54f63ebfa 100644 --- a/src/api/java/baritone/api/utils/Rotation.java +++ b/src/api/java/baritone/api/utils/Rotation.java @@ -117,8 +117,12 @@ public class Rotation { * @return are they really close */ public boolean isReallyCloseTo(Rotation other) { - float yawDiff = Math.abs(this.yaw - other.yaw); // you cant fool me - return (yawDiff < 0.01 || yawDiff > 359.9) && Math.abs(this.pitch - other.pitch) < 0.01; + return yawIsReallyClose(other) && Math.abs(this.pitch - other.pitch) < 0.01; + } + + public boolean yawIsReallyClose(Rotation other) { + float yawDiff = Math.abs(normalizeYaw(yaw) - normalizeYaw(other.yaw)); // you cant fool me + return (yawDiff < 0.01 || yawDiff > 359.99); } /** @@ -147,4 +151,9 @@ public class Rotation { } return newYaw; } + + @Override + public String toString() { + return "Yaw: " + yaw + ", Pitch: " + pitch; + } } diff --git a/src/api/java/baritone/api/utils/RotationUtils.java b/src/api/java/baritone/api/utils/RotationUtils.java index 9352b7fe9..3010d2832 100644 --- a/src/api/java/baritone/api/utils/RotationUtils.java +++ b/src/api/java/baritone/api/utils/RotationUtils.java @@ -78,6 +78,9 @@ public final class RotationUtils { * @return The wrapped angles */ public static Rotation wrapAnglesToRelative(Rotation current, Rotation target) { + if (current.yawIsReallyClose(target)) { + return new Rotation(current.getYaw(), target.getPitch()); + } return target.subtract(current).normalize().add(current); } @@ -102,7 +105,7 @@ public final class RotationUtils { * @param dest The destination position * @return The rotation from the origin to the destination */ - public static Rotation calcRotationFromVec3d(Vec3d orig, Vec3d dest) { + private static Rotation calcRotationFromVec3d(Vec3d orig, Vec3d dest) { double[] delta = {orig.x - dest.x, orig.y - dest.y, orig.z - dest.z}; double yaw = MathHelper.atan2(delta[0], -delta[2]); double dist = Math.sqrt(delta[0] * delta[0] + delta[2] * delta[2]); @@ -196,7 +199,7 @@ public final class RotationUtils { * @return The optional rotation */ public static Optional reachableOffset(Entity entity, BlockPos pos, Vec3d offsetPos, double blockReachDistance) { - Rotation rotation = calcRotationFromVec3d(entity.getPositionEyes(1.0F), offsetPos); + Rotation rotation = calcRotationFromVec3d(entity.getPositionEyes(1.0F), offsetPos, new Rotation(entity.rotationYaw, entity.rotationPitch)); RayTraceResult result = RayTraceUtils.rayTraceTowards(entity, rotation, blockReachDistance); //System.out.println(result); if (result != null && result.typeOfHit == RayTraceResult.Type.BLOCK) { diff --git a/src/main/java/baritone/pathing/movement/Movement.java b/src/main/java/baritone/pathing/movement/Movement.java index 4599637ae..15f4fa24b 100644 --- a/src/main/java/baritone/pathing/movement/Movement.java +++ b/src/main/java/baritone/pathing/movement/Movement.java @@ -160,7 +160,7 @@ public abstract class Movement implements IMovement, MovementHelper { //i dont care if theres snow in the way!!!!!!! //you dont own me!!!! state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.player().getPositionEyes(1.0F), - VecUtils.getBlockPosCenter(blockPos)), true) + VecUtils.getBlockPosCenter(blockPos), ctx.playerRotations()), true) ); // don't check selectedblock on this one, this is a fallback when we can't see any face directly, it's intended to be breaking the "incorrect" block state.setInput(Input.CLICK_LEFT, true); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index 729a2f1de..b06748878 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -78,7 +78,7 @@ public class MovementFall extends Movement { } BlockPos playerFeet = ctx.playerFeet(); - Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest)); + Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations()); Rotation targetRotation = null; Block destBlock = ctx.world().getBlockState(dest).getBlock(); boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER; @@ -141,7 +141,7 @@ public class MovementFall extends Movement { } if (targetRotation == null) { Vec3d destCenterOffset = new Vec3d(destCenter.x + 0.125 * avoid.getX(), destCenter.y, destCenter.z + 0.125 * avoid.getZ()); - state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset), false)); + state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset,ctx.playerRotations()), false)); } return state; } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index 03bdb6f71..d8c03b122 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -151,7 +151,7 @@ public class MovementPillar extends Movement { IBlockState fromDown = BlockStateInterface.get(ctx, src); if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) { // stay centered while swimming up a water column - state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest)), false)); + state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations()), false)); Vec3d destCenter = VecUtils.getBlockPosCenter(dest); if (Math.abs(ctx.player().posX - destCenter.x) > 0.2 || Math.abs(ctx.player().posZ - destCenter.z) > 0.2) { state.setInput(Input.MOVE_FORWARD, true); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 74e4b6f39..f780c76a8 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -174,7 +174,7 @@ public class MovementTraverse extends Movement { // combine the yaw to the center of the destination, and the pitch to the specific block we're trying to break // it's safe to do this since the two blocks we break (in a traverse) are right on top of each other and so will have the same yaw - float yawToDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), dest)).getYaw(); + float yawToDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), dest), ctx.playerRotations()).getYaw(); float pitchToBreak = state.getTarget().getRotation().get().getPitch(); state.setTarget(new MovementState.MovementTarget(new Rotation(yawToDest, pitchToBreak), true)); @@ -198,7 +198,7 @@ public class MovementTraverse extends Movement { isDoorActuallyBlockingUs = true; } if (isDoorActuallyBlockingUs && !(Blocks.IRON_DOOR.equals(pb0.getBlock()) || Blocks.IRON_DOOR.equals(pb1.getBlock()))) { - return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), positionsToBreak[0])), true)) + return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), positionsToBreak[0]), ctx.playerRotations()), true)) .setInput(Input.CLICK_RIGHT, true); } } @@ -212,7 +212,7 @@ public class MovementTraverse extends Movement { } if (blocked != null) { - return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), blocked)), true)) + return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), blocked), ctx.playerRotations()), true)) .setInput(Input.CLICK_RIGHT, true); } } From 0b4efb24aea3d63de75cf01cc53e0c9dce96699b Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 13:57:33 -0800 Subject: [PATCH 23/42] momentous occasion: turning that crap off --- src/api/java/baritone/api/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 0fb26134f..95d56a0e4 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -395,7 +395,7 @@ public final class Settings { /** * Print all the debug messages to chat */ - public final Setting chatDebug = new Setting<>(true); + public final Setting chatDebug = new Setting<>(false); /** * Allow chat based control of Baritone. Most likely should be disabled when Baritone is imported for use in From a21ec54d4f203eb7880a229e5d2503c7572638fc Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 14:05:14 -0800 Subject: [PATCH 24/42] stop breaking block when you let go of left click lol --- .../java/baritone/launch/mixins/MixinKeyBinding.java | 2 +- src/main/java/baritone/behavior/PathingBehavior.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java index 6814b6d62..d61537c9d 100644 --- a/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java +++ b/src/launch/java/baritone/launch/mixins/MixinKeyBinding.java @@ -62,7 +62,7 @@ public class MixinKeyBinding { private void isPressed(CallbackInfoReturnable cir) { // only the primary baritone forces keys Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this); - if (pressTime > 0 && (KeyBinding) (Object) this == Minecraft.getMinecraft().gameSettings.keyBindAttack && Baritone.settings().clickCancel.get()) { + if (pressTime > 0 && (KeyBinding) (Object) this == Minecraft.getMinecraft().gameSettings.keyBindAttack && Baritone.settings().clickCancel.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) { Helper.HELPER.logDirect("Cancelling path on left click since the clickCancel setting is enabled!"); BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything(); return; diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index d441c4168..bf96fd038 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -301,12 +301,14 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, public void secretInternalSegmentCancel() { queuePathEvent(PathEvent.CANCELED); synchronized (pathPlanLock) { - current = null; - next = null; + if (current != null) { + current = null; + next = null; + baritone.getInputOverrideHandler().clearAllKeys(); + getInProgress().ifPresent(AbstractNodeCostSearch::cancel); + baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock(); + } } - baritone.getInputOverrideHandler().clearAllKeys(); - getInProgress().ifPresent(AbstractNodeCostSearch::cancel); - baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock(); } public void forceCancel() { // NOT exposed on public api From f1bacd621092f49ff75c1c07f01f7335ef400e96 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 16:22:49 -0800 Subject: [PATCH 25/42] fix cancellation of unusable segments --- .../baritone/behavior/PathingBehavior.java | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index bf96fd038..899a328fa 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -114,11 +114,27 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, cancelRequested = false; baritone.getInputOverrideHandler().clearAllKeys(); } - if (current == null) { - return; - } - safeToCancel = current.onTick(); synchronized (pathPlanLock) { + synchronized (pathCalcLock) { + if (inProgress != null) { + // we are calculating + // are we calculating the right thing though? 🤔 + BetterBlockPos calcFrom = inProgress.getStart(); + Optional currentBest = inProgress.bestPathSoFar(); + if ((current == null || !current.getPath().getDest().equals(calcFrom)) // if current ends in inProgress's start, then we're ok + && !calcFrom.equals(ctx.playerFeet()) && !calcFrom.equals(expectedSegmentStart) // if current starts in our playerFeet or pathStart, then we're ok + && (!currentBest.isPresent() || (!currentBest.get().positions().contains(ctx.playerFeet()) && !currentBest.get().positions().contains(expectedSegmentStart))) // if + ) { + // when it was *just* started, currentBest will be empty so we need to also check calcFrom since that's always present + inProgress.cancel(); // cancellation doesn't dispatch any events + inProgress = null; // this is safe since we hold both locks + } + } + } + if (current == null) { + return; + } + safeToCancel = current.onTick(); if (current.failed() || current.finished()) { current = null; if (goal == null || goal.isInGoal(ctx.playerFeet())) { @@ -127,7 +143,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, next = null; return; } - if (next != null && !next.getPath().positions().contains(ctx.playerFeet()) && !next.getPath().positions().contains(pathStart())) { // can contain either one + if (next != null && !next.getPath().positions().contains(ctx.playerFeet()) && !next.getPath().positions().contains(expectedSegmentStart)) { // can contain either one // if the current path failed, we may not actually be on the next one, so make sure logDebug("Discarding next path as it does not contain current position"); // for example if we had a nicely planned ahead path that starts where current ends @@ -149,23 +165,12 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, // at this point, current just ended, but we aren't in the goal and have no plan for the future synchronized (pathCalcLock) { if (inProgress != null) { - // we are calculating - // are we calculating the right thing though? 🤔 - BetterBlockPos calcFrom = inProgress.getStart(); - // if current just succeeded, we should be standing in calcFrom, so that's cool and good - // but if current just failed, we should discard this calculation since it doesn't start from where we're standing - if (calcFrom.equals(ctx.playerFeet()) || calcFrom.equals(pathStart())) { - // cool and good - queuePathEvent(PathEvent.PATH_FINISHED_NEXT_STILL_CALCULATING); - return; - } - // oh noes - inProgress.cancel(); // cancellation doesn't dispatch any events - inProgress = null; // this is safe since we hold both locks + queuePathEvent(PathEvent.PATH_FINISHED_NEXT_STILL_CALCULATING); + return; } // we aren't calculating queuePathEvent(PathEvent.CALC_STARTED); - findPathInNewThread(pathStart(), true); + findPathInNewThread(expectedSegmentStart, true); } return; } @@ -340,7 +345,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, return false; } queuePathEvent(PathEvent.CALC_STARTED); - findPathInNewThread(pathStart(), true); + findPathInNewThread(expectedSegmentStart, true); return true; } } From 9ecd24c7553b56f357c8c5e38ec66b898063f665 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 16:30:41 -0800 Subject: [PATCH 26/42] remove toxic cloud --- src/main/java/baritone/pathing/path/PathExecutor.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index c61ebc3d2..9ff27afc1 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -104,14 +104,6 @@ public class PathExecutor implements IPathExecutor, Helper { BetterBlockPos whereShouldIBe = path.positions().get(pathPosition); BetterBlockPos whereAmI = ctx.playerFeet(); if (!whereShouldIBe.equals(whereAmI)) { - - if (pathPosition == 0 && whereAmI.equals(whereShouldIBe.up()) && Math.abs(ctx.player().motionY) < 0.1 && !(path.movements().get(0) instanceof MovementAscend) && !(path.movements().get(0) instanceof MovementPillar)) { - // avoid the Wrong Y coordinate bug - // TODO add a timer here - new MovementDownward(behavior.baritone, whereAmI, whereShouldIBe).update(); - return false; - } - if (!Blocks.AIR.equals(BlockStateInterface.getBlock(ctx, whereAmI.down()))) {//do not skip if standing on air, because our position isn't stable to skip for (int i = 0; i < pathPosition - 1 && i < path.length(); i++) {//this happens for example when you lag out and get teleported back a couple blocks if (whereAmI.equals(path.positions().get(i))) { @@ -408,6 +400,7 @@ public class PathExecutor implements IPathExecutor, Helper { if (next instanceof MovementAscend && current.getDirection().up().equals(next.getDirection().down())) { // a descend then an ascend in the same direction pathPosition++; + onChangeInPathPosition(); // okay to skip clearKeys and / or onChangeInPathPosition here since this isn't possible to repeat, since it's asymmetric logDebug("Skipping descend to straight ascend"); return true; From b2583773d57afc978f74cbeb566f0517c767f847 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 16:30:53 -0800 Subject: [PATCH 27/42] discard next segment properly --- src/main/java/baritone/behavior/PathingBehavior.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 899a328fa..e9e4d4805 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -463,8 +463,12 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior, } else { if (next == null) { if (executor.isPresent()) { - queuePathEvent(PathEvent.NEXT_SEGMENT_CALC_FINISHED); - next = executor.get(); + if (executor.get().getPath().getSrc().equals(current.getPath().getDest())) { + queuePathEvent(PathEvent.NEXT_SEGMENT_CALC_FINISHED); + next = executor.get(); + } else { + logDebug("Warning: discarding orphan next segment with incorrect start"); + } } else { queuePathEvent(PathEvent.NEXT_CALC_FAILED); } From e8d3bf509c539a4f1dcb789d37a003cb3760ceba Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 16:33:27 -0800 Subject: [PATCH 28/42] clarify --- src/main/java/baritone/pathing/path/PathExecutor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 9ff27afc1..e78b5d7e3 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -405,7 +405,7 @@ public class PathExecutor implements IPathExecutor, Helper { logDebug("Skipping descend to straight ascend"); return true; } - if (canSprintInto(ctx, current, next)) { + if (canSprintFromDescendInto(ctx, current, next)) { if (ctx.playerFeet().equals(current.getDest())) { pathPosition++; onChangeInPathPosition(); @@ -429,7 +429,7 @@ public class PathExecutor implements IPathExecutor, Helper { return false; } - private static boolean canSprintInto(IPlayerContext ctx, IMovement current, IMovement next) { + private static boolean canSprintFromDescendInto(IPlayerContext ctx, IMovement current, IMovement next) { if (next instanceof MovementDescend && next.getDirection().equals(current.getDirection())) { return true; } From a84b3bfc7a8fae5e25d1a9a3207d66b79347243f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 16:55:08 -0800 Subject: [PATCH 29/42] sprint through ascends whenever possible, fixes #149 --- .../movement/movements/MovementAscend.java | 2 +- .../baritone/pathing/path/PathExecutor.java | 47 ++++++++++++++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementAscend.java b/src/main/java/baritone/pathing/movement/movements/MovementAscend.java index 97eaa7fb0..f26970164 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementAscend.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementAscend.java @@ -200,7 +200,7 @@ public class MovementAscend extends Movement { return state.setInput(Input.JUMP, true); } - private boolean headBonkClear() { + public boolean headBonkClear() { BetterBlockPos startUp = src.up(2); for (int i = 0; i < 4; i++) { BetterBlockPos check = startUp.offset(EnumFacing.byHorizontalIndex(i)); diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index e78b5d7e3..23b5861b9 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -380,14 +380,26 @@ public class PathExecutor implements IPathExecutor, Helper { if (!new CalculationContext(behavior.baritone).canSprint) { return false; } + IMovement current = path.movements().get(pathPosition); + + // traverse requests sprinting, so we need to do this check first + if (current instanceof MovementTraverse && pathPosition < path.length() - 2) { + IMovement next = path.movements().get(pathPosition + 1); + if (next instanceof MovementAscend && sprintableAscend(ctx, (MovementTraverse) current, (MovementAscend) next)) { + logDebug("Skipping traverse to straight ascend"); + pathPosition++; + onChangeInPathPosition(); + onTick(); + return true; + } + } // if the movement requested sprinting, then we're done if (requested) { return true; } - // however, descend doesn't request sprinting, beceause it doesn't know the context of what movement comes after it - IMovement current = path.movements().get(pathPosition); + // however, descend and ascend don't request sprinting, because they don't know the context of what movement comes after it if (current instanceof MovementDescend) { if (((MovementDescend) current).safeMode() && !((MovementDescend) current).skipToAscend()) { @@ -401,6 +413,7 @@ public class PathExecutor implements IPathExecutor, Helper { // a descend then an ascend in the same direction pathPosition++; onChangeInPathPosition(); + onTick(); // okay to skip clearKeys and / or onChangeInPathPosition here since this isn't possible to repeat, since it's asymmetric logDebug("Skipping descend to straight ascend"); return true; @@ -425,10 +438,40 @@ public class PathExecutor implements IPathExecutor, Helper { return true; } } + if (prev instanceof MovementTraverse && sprintableAscend(ctx, (MovementTraverse) prev, (MovementAscend) current)) { + return true; + } } return false; } + private static boolean sprintableAscend(IPlayerContext ctx, MovementTraverse current, MovementAscend next) { + if (!current.getDirection().equals(next.getDirection().down())) { + return false; + } + if (!MovementHelper.canWalkOn(ctx, current.getDest().down())) { + return false; + } + if (!next.headBonkClear()) { + return false; + } + for (int x = 0; x < 2; x++) { + for (int y = 0; y < 3; y++) { + BlockPos chk = current.getSrc().up(y); + if (x == 1) { + chk = chk.add(current.getDirection()); + } + if (!MovementHelper.fullyPassable(ctx.world().getBlockState(chk))) { + return false; + } + } + } + if (MovementHelper.avoidWalkingInto(ctx.world().getBlockState(current.getSrc().up(3)).getBlock())) { + return false; + } + return true; + } + private static boolean canSprintFromDescendInto(IPlayerContext ctx, IMovement current, IMovement next) { if (next instanceof MovementDescend && next.getDirection().equals(current.getDirection())) { return true; From dbd760fbcb0c9ac97411c6cdcf2dafb2958de17d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 18:26:30 -0800 Subject: [PATCH 30/42] some polish on ascend sprinting --- src/api/java/baritone/api/Settings.java | 5 +++ .../baritone/pathing/path/PathExecutor.java | 36 ++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 95d56a0e4..97ee278ed 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -164,6 +164,11 @@ public final class Settings { */ public final Setting considerPotionEffects = new Setting<>(true); + /** + * Sprint and jump a block early on ascends wherever possible + */ + public final Setting sprintAscends = new Setting<>(true); + /** * This is the big A* setting. * As long as your cost heuristic is an *underestimate*, it's guaranteed to find you the best path. diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 23b5861b9..4321eba29 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -386,11 +386,16 @@ public class PathExecutor implements IPathExecutor, Helper { if (current instanceof MovementTraverse && pathPosition < path.length() - 2) { IMovement next = path.movements().get(pathPosition + 1); if (next instanceof MovementAscend && sprintableAscend(ctx, (MovementTraverse) current, (MovementAscend) next)) { - logDebug("Skipping traverse to straight ascend"); - pathPosition++; - onChangeInPathPosition(); - onTick(); - return true; + if (skipNow(ctx, current, next)) { + logDebug("Skipping traverse to straight ascend"); + pathPosition++; + onChangeInPathPosition(); + onTick(); + behavior.baritone.getInputOverrideHandler().setInputForceState(Input.JUMP, true); + return true; + } else { + logDebug("Too far to the side to safely sprint ascend"); + } } } @@ -445,16 +450,31 @@ public class PathExecutor implements IPathExecutor, Helper { return false; } + private static boolean skipNow(IPlayerContext ctx, IMovement current, IMovement next) { + double offTarget = Math.abs(current.getDirection().getX() * (current.getSrc().z + 0.5D - ctx.player().posZ)) + Math.abs(current.getDirection().getZ() * (current.getSrc().x + 0.5D - ctx.player().posX)); + if (offTarget > 0.1) { + return false; + } + // we are centered + BlockPos headBonk = current.getSrc().subtract(current.getDirection()).up(2); + if (MovementHelper.fullyPassable(ctx.world().getBlockState(headBonk))) { + return true; + } + // wait 0.3 + double flatDist = Math.abs(current.getDirection().getX() * (headBonk.getX() + 0.5D - ctx.player().posX)) + Math.abs(current.getDirection().getZ() * (headBonk.getZ() + 0.5 - ctx.player().posZ)); + return flatDist > 0.8; + } + private static boolean sprintableAscend(IPlayerContext ctx, MovementTraverse current, MovementAscend next) { + if (!Baritone.settings().sprintAscends.get()) { + return false; + } if (!current.getDirection().equals(next.getDirection().down())) { return false; } if (!MovementHelper.canWalkOn(ctx, current.getDest().down())) { return false; } - if (!next.headBonkClear()) { - return false; - } for (int x = 0; x < 2; x++) { for (int y = 0; y < 3; y++) { BlockPos chk = current.getSrc().up(y); From bffeb9c86287728e39c3c7b784de4a60d5ac2c03 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 18:38:46 -0800 Subject: [PATCH 31/42] forgot one extra check --- src/main/java/baritone/pathing/path/PathExecutor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 4321eba29..468dcfa63 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -489,6 +489,9 @@ public class PathExecutor implements IPathExecutor, Helper { if (MovementHelper.avoidWalkingInto(ctx.world().getBlockState(current.getSrc().up(3)).getBlock())) { return false; } + if (MovementHelper.avoidWalkingInto(ctx.world().getBlockState(next.getDest().up(2)).getBlock())) { + return false; + } return true; } From d0548b27159145d854acfb6b48c32c785726e05d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 18:39:26 -0800 Subject: [PATCH 32/42] add a warning --- src/api/java/baritone/api/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 97ee278ed..25244007f 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -479,7 +479,7 @@ public final class Settings { public final Setting pathThroughCachedOnly = new Setting<>(false); /** - * 😎 Render cached chunks as semitransparent. Doesn't work with OptiFine 😭 + * 😎 Render cached chunks as semitransparent. Doesn't work with OptiFine 😭 Rarely randomly crashes, see this issue. *

* Can be very useful on servers with low render distance. After enabling, you may need to reload the world in order for it to have an effect * (e.g. disconnect and reconnect, enter then exit the nether, die and respawn, etc). This may literally kill your FPS and CPU because From 5b8a83853d5b03bb77b2fd04ba0e1bb804d065d6 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 19:23:16 -0800 Subject: [PATCH 33/42] add setting to sprint in water --- src/api/java/baritone/api/Settings.java | 5 +++++ .../pathing/movement/movements/MovementDiagonal.java | 3 ++- .../pathing/movement/movements/MovementTraverse.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 25244007f..b4e595acc 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -478,6 +478,11 @@ public final class Settings { */ public final Setting pathThroughCachedOnly = new Setting<>(false); + /** + * Continue sprinting while in water + */ + public final Setting sprintInWater = new Setting<>(true); + /** * 😎 Render cached chunks as semitransparent. Doesn't work with OptiFine 😭 Rarely randomly crashes, see this issue. *

diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index f34e9468f..f156ff1b4 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -17,6 +17,7 @@ package baritone.pathing.movement.movements; +import baritone.Baritone; import baritone.api.IBaritone; import baritone.api.pathing.movement.MovementStatus; import baritone.api.utils.BetterBlockPos; @@ -181,7 +182,7 @@ public class MovementDiagonal extends Movement { } public boolean sprint() { - if (MovementHelper.isLiquid(ctx, ctx.playerFeet())) { + if (MovementHelper.isLiquid(ctx, ctx.playerFeet()) && !Baritone.settings().sprintInWater.get()) { return false; } for (int i = 0; i < 4; i++) { diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index f780c76a8..65dec97d2 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -234,7 +234,7 @@ public class MovementTraverse extends Movement { BlockPos into = dest.subtract(src).add(dest); Block intoBelow = BlockStateInterface.get(ctx, into).getBlock(); Block intoAbove = BlockStateInterface.get(ctx, into.up()).getBlock(); - if (wasTheBridgeBlockAlwaysThere && !MovementHelper.isLiquid(ctx, ctx.playerFeet()) && !MovementHelper.avoidWalkingInto(intoBelow) && !MovementHelper.avoidWalkingInto(intoAbove)) { + if (wasTheBridgeBlockAlwaysThere && (!MovementHelper.isLiquid(ctx, ctx.playerFeet()) || Baritone.settings().sprintInWater.get()) && !MovementHelper.avoidWalkingInto(intoBelow) && !MovementHelper.avoidWalkingInto(intoAbove)) { state.setInput(Input.SPRINT, true); } Block destDown = BlockStateInterface.get(ctx, dest.down()).getBlock(); From b27d95a61554e3d92150c93f3bafc8fc337c03c9 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 21:11:13 -0800 Subject: [PATCH 34/42] proper fall overshooting --- .../pathing/movement/MovementHelper.java | 5 +- .../baritone/pathing/path/PathExecutor.java | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index f91103d08..0f6659b93 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -439,11 +439,10 @@ public interface MovementHelper extends ActionCosts, Helper { } static void moveTowards(IPlayerContext ctx, MovementState state, BlockPos pos) { - EntityPlayerSP player = ctx.player(); state.setTarget(new MovementTarget( - new Rotation(RotationUtils.calcRotationFromVec3d(player.getPositionEyes(1.0F), + new Rotation(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(pos), - new Rotation(player.rotationYaw, player.rotationPitch)).getYaw(), player.rotationPitch), + ctx.playerRotations()).getYaw(), ctx.player().rotationPitch), false )).setInput(Input.MOVE_FORWARD, true); } diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index 468dcfa63..db46d2fb6 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -25,6 +25,7 @@ import baritone.api.pathing.movement.MovementStatus; import baritone.api.pathing.path.IPathExecutor; import baritone.api.utils.BetterBlockPos; import baritone.api.utils.IPlayerContext; +import baritone.api.utils.RotationUtils; import baritone.api.utils.VecUtils; import baritone.api.utils.input.Input; import baritone.behavior.PathingBehavior; @@ -39,6 +40,8 @@ import net.minecraft.block.BlockLiquid; import net.minecraft.init.Blocks; import net.minecraft.util.Tuple; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.Vec3i; import java.util.*; @@ -114,6 +117,7 @@ public class PathExecutor implements IPathExecutor, Helper { path.movements().get(j).reset(); } onChangeInPathPosition(); + onTick(); return false; } } @@ -126,6 +130,7 @@ public class PathExecutor implements IPathExecutor, Helper { //System.out.println("Double skip sundae"); pathPosition = i - 1; onChangeInPathPosition(); + onTick(); return false; } } @@ -447,9 +452,65 @@ public class PathExecutor implements IPathExecutor, Helper { return true; } } + if (current instanceof MovementFall) { + Tuple data = overrideFall((MovementFall) current); + if (data != null) { + BlockPos fallDest = data.getSecond(); + if (!path.positions().contains(fallDest)) { + throw new IllegalStateException(); + } + if (ctx.playerFeet().equals(fallDest)) { + pathPosition = path.positions().indexOf(fallDest); + onChangeInPathPosition(); + onTick(); + return true; + } + logDebug("Skipping fall to " + fallDest + " " + data.getFirst()); + clearKeys(); + behavior.baritone.getLookBehavior().updateTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), data.getFirst(), ctx.playerRotations()), false); + behavior.baritone.getInputOverrideHandler().setInputForceState(Input.MOVE_FORWARD, true); + return true; + } + } return false; } + private Tuple overrideFall(MovementFall movement) { + Vec3i dir = movement.getDirection(); + if (dir.getY() < -3) { + return null; + } + Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ()); + int i; + outer: + for (i = pathPosition + 1; i < path.length() - 1 && i < pathPosition + 3; i++) { + IMovement next = path.movements().get(i); + if (!(next instanceof MovementTraverse)) { + break; + } + if (!flatDir.equals(next.getDirection())) { + break; + } + for (int y = next.getDest().y; y <= movement.getSrc().y + 1; y++) { + BlockPos chk = new BlockPos(next.getDest().x, y, next.getDest().z); + if (!MovementHelper.fullyPassable(ctx.world().getBlockState(chk))) { + break outer; + } + } + if (!MovementHelper.canWalkOn(ctx, next.getDest().down())) { + break; + } + } + i--; + if (i == pathPosition) { + return null; // no valid extension exists + } + double len = i - pathPosition - 0.4; + return new Tuple<>( + new Vec3d(flatDir.getX() * len + movement.getDest().x + 0.5, movement.getDest().y, flatDir.getZ() * len + movement.getDest().z + 0.5), + movement.getDest().add(flatDir.getX() * (i - pathPosition), 0, flatDir.getZ() * (i - pathPosition))); + } + private static boolean skipNow(IPlayerContext ctx, IMovement current, IMovement next) { double offTarget = Math.abs(current.getDirection().getX() * (current.getSrc().z + 0.5D - ctx.player().posZ)) + Math.abs(current.getDirection().getZ() * (current.getSrc().x + 0.5D - ctx.player().posX)); if (offTarget > 0.1) { From 41b1106c72daa60be78b6b88d3d6154c4490c1d2 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 21:20:06 -0800 Subject: [PATCH 35/42] sprint in water for real --- .../baritone/pathing/movement/movements/MovementTraverse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index 65dec97d2..c1d660d07 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -234,7 +234,7 @@ public class MovementTraverse extends Movement { BlockPos into = dest.subtract(src).add(dest); Block intoBelow = BlockStateInterface.get(ctx, into).getBlock(); Block intoAbove = BlockStateInterface.get(ctx, into.up()).getBlock(); - if (wasTheBridgeBlockAlwaysThere && (!MovementHelper.isLiquid(ctx, ctx.playerFeet()) || Baritone.settings().sprintInWater.get()) && !MovementHelper.avoidWalkingInto(intoBelow) && !MovementHelper.avoidWalkingInto(intoAbove)) { + if (wasTheBridgeBlockAlwaysThere && (!MovementHelper.isLiquid(ctx, ctx.playerFeet()) || Baritone.settings().sprintInWater.get()) && (!MovementHelper.avoidWalkingInto(intoBelow) || MovementHelper.isWater(intoBelow)) && !MovementHelper.avoidWalkingInto(intoAbove)) { state.setInput(Input.SPRINT, true); } Block destDown = BlockStateInterface.get(ctx, dest.down()).getBlock(); From 3f1ee100bfd4f4554ad5bc5a7afd10eaaf195151 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 22:39:34 -0800 Subject: [PATCH 36/42] only sprint ascends that are followed in the same direction --- src/main/java/baritone/pathing/path/PathExecutor.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index db46d2fb6..c84a43119 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -388,9 +388,9 @@ public class PathExecutor implements IPathExecutor, Helper { IMovement current = path.movements().get(pathPosition); // traverse requests sprinting, so we need to do this check first - if (current instanceof MovementTraverse && pathPosition < path.length() - 2) { + if (current instanceof MovementTraverse && pathPosition < path.length() - 3) { IMovement next = path.movements().get(pathPosition + 1); - if (next instanceof MovementAscend && sprintableAscend(ctx, (MovementTraverse) current, (MovementAscend) next)) { + if (next instanceof MovementAscend && sprintableAscend(ctx, (MovementTraverse) current, (MovementAscend) next, path.movements().get(pathPosition + 2))) { if (skipNow(ctx, current, next)) { logDebug("Skipping traverse to straight ascend"); pathPosition++; @@ -448,7 +448,7 @@ public class PathExecutor implements IPathExecutor, Helper { return true; } } - if (prev instanceof MovementTraverse && sprintableAscend(ctx, (MovementTraverse) prev, (MovementAscend) current)) { + if (pathPosition < path.length() - 2 && prev instanceof MovementTraverse && sprintableAscend(ctx, (MovementTraverse) prev, (MovementAscend) current, path.movements().get(pathPosition + 1))) { return true; } } @@ -526,13 +526,16 @@ public class PathExecutor implements IPathExecutor, Helper { return flatDist > 0.8; } - private static boolean sprintableAscend(IPlayerContext ctx, MovementTraverse current, MovementAscend next) { + private static boolean sprintableAscend(IPlayerContext ctx, MovementTraverse current, MovementAscend next, IMovement nextnext) { if (!Baritone.settings().sprintAscends.get()) { return false; } if (!current.getDirection().equals(next.getDirection().down())) { return false; } + if (nextnext.getDirection().getX() != next.getDirection().getX() || nextnext.getDirection().getZ() != next.getDirection().getZ()) { + return false; + } if (!MovementHelper.canWalkOn(ctx, current.getDest().down())) { return false; } From 5b6c9fc348e777ce0a346130e1f2f73ca0ad2a34 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 22:39:43 -0800 Subject: [PATCH 37/42] blacklist unreachable gettoblocks --- src/api/java/baritone/api/Settings.java | 6 +++ .../baritone/process/GetToBlockProcess.java | 54 ++++++++++++++----- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index b4e595acc..4e1cc9cdd 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -483,6 +483,12 @@ public final class Settings { */ public final Setting sprintInWater = new Setting<>(true); + /** + * When GetToBlockProcess fails to calculate a path, instead of just giving up, mark the closest instances + * of that block as "unreachable" and go towards the next closest + */ + public final Setting blacklistOnGetToBlockFailure = new Setting<>(true); + /** * 😎 Render cached chunks as semitransparent. Doesn't work with OptiFine 😭 Rarely randomly crashes, see this issue. *

diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index a6e2e68b8..6a0a44f78 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -32,15 +32,14 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.ContainerPlayer; import net.minecraft.util.math.BlockPos; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; +import java.util.*; +import java.util.stream.Collectors; public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBlockProcess { private Block gettingTo; private List knownLocations; + private List blacklist; // locations we failed to calc to private BlockPos start; private int tickCount = 0; @@ -54,6 +53,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl onLostControl(); gettingTo = block; start = ctx.playerFeet(); + blacklist = new ArrayList<>(); rescan(new ArrayList<>(), new CalculationContext(baritone)); } @@ -63,7 +63,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl } @Override - public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) { + public synchronized PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) { if (knownLocations == null) { rescan(new ArrayList<>(), new CalculationContext(baritone)); } @@ -84,11 +84,17 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl } Goal goal = new GoalComposite(knownLocations.stream().map(this::createGoal).toArray(Goal[]::new)); if (calcFailed) { - logDirect("Unable to find any path to " + gettingTo + ", canceling GetToBlock"); - if (isSafeToCancel) { - onLostControl(); + if (Baritone.settings().blacklistOnGetToBlockFailure.get()) { + logDirect("Unable to find any path to " + gettingTo + ", blacklisting presumably unreachable closest instances"); + blacklistClosest(); + return onTick(false, isSafeToCancel); // gamer moment + } else { + logDirect("Unable to find any path to " + gettingTo + ", canceling GetToBlock"); + if (isSafeToCancel) { + onLostControl(); + } + return new PathingCommand(goal, PathingCommandType.CANCEL_AND_SET_GOAL); } - return new PathingCommand(goal, PathingCommandType.CANCEL_AND_SET_GOAL); } int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get(); if (mineGoalUpdateInterval != 0 && tickCount++ % mineGoalUpdateInterval == 0) { // big brain @@ -111,11 +117,33 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl return new PathingCommand(goal, PathingCommandType.REVALIDATE_GOAL_AND_PATH); } + public synchronized void blacklistClosest() { + List newBlacklist = knownLocations.stream().sorted(Comparator.comparingDouble(ctx.player()::getDistanceSq)).collect(Collectors.toList()).subList(0, 1); + outer: + while (true) { + for (BlockPos known : knownLocations) { + for (BlockPos blacklist : newBlacklist) { + if (known.distanceSq(blacklist) == 1) { // directly adjacent + newBlacklist.add(known); + knownLocations.remove(known); + continue outer; + } + } + } + if (true) { + break; // codacy gets mad if i just end on a break LOL + } + } + logDebug("Blacklisting unreachable locations " + newBlacklist); + blacklist.addAll(newBlacklist); + } + @Override - public void onLostControl() { + public synchronized void onLostControl() { gettingTo = null; knownLocations = null; start = null; + blacklist = null; baritone.getInputOverrideHandler().clearAllKeys(); } @@ -124,8 +152,10 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl return "Get To Block " + gettingTo; } - private void rescan(List known, CalculationContext context) { - knownLocations = MineProcess.searchWorld(context, Collections.singletonList(gettingTo), 64, known); + private synchronized void rescan(List known, CalculationContext context) { + List positions = MineProcess.searchWorld(context, Collections.singletonList(gettingTo), 64, known); + positions.removeIf(blacklist::contains); + knownLocations = positions; } private Goal createGoal(BlockPos pos) { From f094e83e4dd149c14f56f96910b67de8d0236a48 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 13 Feb 2019 22:41:18 -0800 Subject: [PATCH 38/42] codacy --- .../src/main/java/baritone/gradle/task/BaritoneGradleTask.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java b/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java index 4f7674f67..7e26dac11 100644 --- a/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java +++ b/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java @@ -17,8 +17,6 @@ package baritone.gradle.task; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; import org.gradle.api.DefaultTask; import java.io.File; @@ -26,7 +24,6 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; /** * @author Brady From 4fe9c180d5e0a063d625a8496dab470607c4b299 Mon Sep 17 00:00:00 2001 From: babbaj Date: Thu, 14 Feb 2019 07:03:22 -0500 Subject: [PATCH 39/42] Fix potential problems --- .../java/baritone/process/GetToBlockProcess.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index 6a0a44f78..89f60da39 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -33,7 +33,6 @@ import net.minecraft.inventory.ContainerPlayer; import net.minecraft.util.math.BlockPos; import java.util.*; -import java.util.stream.Collectors; public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBlockProcess { @@ -117,13 +116,15 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl return new PathingCommand(goal, PathingCommandType.REVALIDATE_GOAL_AND_PATH); } + // blacklist the closest block and its adjacent blocks public synchronized void blacklistClosest() { - List newBlacklist = knownLocations.stream().sorted(Comparator.comparingDouble(ctx.player()::getDistanceSq)).collect(Collectors.toList()).subList(0, 1); + List newBlacklist = new ArrayList<>(); + knownLocations.stream().min(Comparator.comparingDouble(ctx.player()::getDistanceSq)).ifPresent(newBlacklist::add); outer: while (true) { for (BlockPos known : knownLocations) { for (BlockPos blacklist : newBlacklist) { - if (known.distanceSq(blacklist) == 1) { // directly adjacent + if (areAdjacent(known, blacklist)) { // directly adjacent newBlacklist.add(known); knownLocations.remove(known); continue outer; @@ -138,6 +139,14 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl blacklist.addAll(newBlacklist); } + // safer than direct double comparison from distanceSq + private boolean areAdjacent(BlockPos posA, BlockPos posB) { + int diffX = Math.abs(posA.getX() - posB.getX()); + int diffY = Math.abs(posA.getY() - posB.getY()); + int diffZ = Math.abs(posA.getZ() - posB.getZ()); + return (diffX + diffY + diffZ) == 1; + } + @Override public synchronized void onLostControl() { gettingTo = null; From 89b5ce4b6327d91495c2fb2f9893feb3f1c2c711 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 14 Feb 2019 14:47:38 -0800 Subject: [PATCH 40/42] properly detect failure --- src/main/java/baritone/process/GetToBlockProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index 6a0a44f78..b6151f5cc 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -68,7 +68,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl rescan(new ArrayList<>(), new CalculationContext(baritone)); } if (knownLocations.isEmpty()) { - if (Baritone.settings().exploreForBlocks.get()) { + if (Baritone.settings().exploreForBlocks.get() && !calcFailed) { return new PathingCommand(new GoalRunAway(1, start) { @Override public boolean isInGoal(int x, int y, int z) { From 46c2d8f7c7c38be3d888825dd6223b6cf6190931 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 15 Feb 2019 21:35:52 -0800 Subject: [PATCH 41/42] unneeded --- src/main/java/baritone/pathing/path/PathExecutor.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index c84a43119..1a221af3c 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -465,7 +465,6 @@ public class PathExecutor implements IPathExecutor, Helper { onTick(); return true; } - logDebug("Skipping fall to " + fallDest + " " + data.getFirst()); clearKeys(); behavior.baritone.getLookBehavior().updateTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), data.getFirst(), ctx.playerRotations()), false); behavior.baritone.getInputOverrideHandler().setInputForceState(Input.MOVE_FORWARD, true); From 11af0a7aac65f0e061227d197870400c21e1d831 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 15 Feb 2019 21:36:34 -0800 Subject: [PATCH 42/42] v1.1.5 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ceb024c1c..d31ea10ec 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ */ group 'baritone' -version '1.1.4' +version '1.1.5' buildscript { repositories {