From 9f5d9bceaaa2fd7c761313a648ce1b8157080c23 Mon Sep 17 00:00:00 2001 From: ads123ads <33590926+ads123ads@users.noreply.github.com> Date: Tue, 15 Oct 2019 15:34:22 +0530 Subject: [PATCH 1/8] The grammar mistakes were corrected --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90173889..0891e127 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ A Minecraft pathfinder bot. Baritone is the pathfinding system used in [Impact](https://impactclient.net/) since 4.4. There's a [showcase video](https://www.youtube.com/watch?v=yI8hgW_m6dQ) made by @Adovin#3153 on Baritone's integration into Impact. [Here's](https://www.youtube.com/watch?v=StquF69-_wI) a video I made showing off what it can do. -The easiest way to install Baritone is to install [Impact](https://impactclient.net/), which comes with Baritone. The second easiest way (for 1.12.2 only) is to install the v1.2.* forge api jar from [releases](https://github.com/cabaletta/baritone/releases). Otherwise, see [Installation & setup](SETUP.md). Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it. +The easiest way to install Baritone is to install [Impact](https://impactclient.net/), which comes with Baritone. The second easiest way (for 1.12.2 only) is to install the v1.2.* forge API jar from [releases](https://github.com/cabaletta/baritone/releases). Otherwise, see [Installation & setup](SETUP.md). Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it. For 1.14.4, [click here](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1). Or [with optifine](https://github.com/cabaletta/baritone/issues/797). This project is an updated version of [MineBot](https://github.com/leijurv/MineBot/), the original version of the bot for Minecraft 1.8.9, rebuilt for 1.12.2 and 1.13.2. Baritone focuses on reliability and particularly performance (it's over [30x faster](https://github.com/cabaletta/baritone/pull/180#issuecomment-423822928) than MineBot at calculating paths). -Have committed at least once a day from Aug 1 2018 to Aug 1 2019. +Have committed at least once a day from Aug 1, 2018, to Aug 1, 2019. 1Leijurv3DWTrGAfmmiTphjhXLvQiHg7K2 @@ -62,7 +62,7 @@ The API is heavily documented, you can find the Javadocs for the latest release Please note that usage of anything located outside of the ``baritone.api`` package is not supported by the API release jar. -Below is an example of basic usage for changing some settings, and then pathing to a X/Z goal. +Below is an example of basic usage for changing some settings, and then pathing to an X/Z goal. ``` BaritoneAPI.getSettings().allowSprint.value = true; @@ -75,7 +75,7 @@ BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAnd ## Can I use Baritone as a library in my custom utility client? -That's what it's for, sure! (As long as usage is in compliance with the LGPL 3.0 License) +That's what it's for, sure! (As long as usage complies with the LGPL 3.0 License) ## How is it so fast? From 523f13c430404d2f2910f6ecd0dca7595d9e969f Mon Sep 17 00:00:00 2001 From: RealIndrit <32206640+RealIndrit@users.noreply.github.com> Date: Tue, 18 Aug 2020 12:36:10 +0200 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=94=A5=20Get=20yeeted=20unused=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed an unused function that can't be used anyways, because RayTraceUtils cant detect entity hit... --- src/api/java/baritone/api/utils/IPlayerContext.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/api/java/baritone/api/utils/IPlayerContext.java b/src/api/java/baritone/api/utils/IPlayerContext.java index 8ce3271b..f746110e 100644 --- a/src/api/java/baritone/api/utils/IPlayerContext.java +++ b/src/api/java/baritone/api/utils/IPlayerContext.java @@ -97,17 +97,4 @@ public interface IPlayerContext { default boolean isLookingAt(BlockPos pos) { return getSelectedBlock().equals(Optional.of(pos)); } - - /** - * Returns the entity that the crosshair is currently placed over. Updated once per tick. - * - * @return The entity - */ - default Optional getSelectedEntity() { - RayTraceResult result = objectMouseOver(); - if (result != null && result.typeOfHit == RayTraceResult.Type.ENTITY) { - return Optional.of(result.entityHit); - } - return Optional.empty(); - } } From 5f686c1c12e1abfc071fa3bda028da7a9e527183 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Thu, 20 Aug 2020 22:40:16 +0200 Subject: [PATCH 3/8] improve isSafeToCancel in MovementDiagonal even more It did not return true early enough for backfill while cornering over air --- .../movement/movements/MovementDiagonal.java | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 2631af84..1ea0591c 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -31,6 +31,7 @@ import baritone.utils.pathing.MutableMoveResult; import com.google.common.collect.ImmutableSet; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.init.Blocks; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; @@ -58,11 +59,34 @@ public class MovementDiagonal extends Movement { @Override protected boolean safeToCancel(MovementState state) { - return ctx.playerFeet().equals(src) || (( - MovementHelper.canWalkOn(ctx, new BlockPos(src.x, src.y - 1, dest.z)) - ) && - MovementHelper.canWalkOn(ctx, new BlockPos(dest.x, src.y - 1, src.z))); - } + //too simple. backfill does not work after cornering with this + //return MovementHelper.canWalkOn(ctx, ctx.playerFeet().down()); + EntityPlayerSP player = ctx.player(); + double offset = 0.25; + double x = player.posX; + double y = player.posY - 1; + double z = player.posZ; + //standard + if (ctx.playerFeet().equals(src)){ + return true; + } + //both corners are walkable + if (MovementHelper.canWalkOn(ctx, new BlockPos(src.x, src.y - 1, dest.z)) + && MovementHelper.canWalkOn(ctx, new BlockPos(dest.x, src.y - 1, src.z))){ + return true; + } + //we are in a likely unwalkable corner, check for a supporting block + if (ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) + || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))){ + if (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z - offset)) + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z + offset)) + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))){ + return true; + } + } + return false; + } @Override public double calculateCost(CalculationContext context) { From b7d1ba1fa5187e096356c90c43c780b4481aa4d0 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Thu, 20 Aug 2020 23:11:55 +0200 Subject: [PATCH 4/8] Make Codacity happy --- .../pathing/movement/movements/MovementDiagonal.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 1ea0591c..eaaef0a8 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -78,12 +78,11 @@ public class MovementDiagonal extends Movement { //we are in a likely unwalkable corner, check for a supporting block if (ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))){ - if (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) + && (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z - offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z + offset)) - || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))){ + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))) return true; - } } return false; } From ea35a3478f8b87a10bd440f5638961fdd455d6c5 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Thu, 20 Aug 2020 23:16:59 +0200 Subject: [PATCH 5/8] Codacity again for the same and syntax dab --- .../baritone/pathing/movement/movements/MovementDiagonal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index eaaef0a8..3fc67e8f 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -77,11 +77,11 @@ public class MovementDiagonal extends Movement { } //we are in a likely unwalkable corner, check for a supporting block if (ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) - || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))){ + || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))) && (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z - offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z + offset)) - || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))) + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))){ return true; } return false; From 3c691bb498395e941830b4eac381ef00abf281eb Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Thu, 20 Aug 2020 23:33:47 +0200 Subject: [PATCH 6/8] But now it's working --- .../baritone/pathing/movement/movements/MovementDiagonal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 3fc67e8f..2e026b87 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -76,12 +76,12 @@ public class MovementDiagonal extends Movement { return true; } //we are in a likely unwalkable corner, check for a supporting block - if (ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) + if ((ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))) && (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z - offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z + offset)) - || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))){ + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset)))){ return true; } return false; From 9636e69a6b34778f9ee5c73bef961f9409bc2542 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Mon, 24 Aug 2020 23:06:19 +0200 Subject: [PATCH 7/8] slightly better condition --- .../pathing/movement/movements/MovementDiagonal.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 2e026b87..b5ea19a9 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -76,15 +76,14 @@ public class MovementDiagonal extends Movement { return true; } //we are in a likely unwalkable corner, check for a supporting block - if ((ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) - || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))) - && (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) + if (ctx.playerFeet().equals(new BetterBlockPos(src.x, src.y, dest.z)) + || ctx.playerFeet().equals(new BetterBlockPos(dest.x, src.y, src.z))){ + return (MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z + offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x + offset, y, z - offset)) || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z + offset)) - || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset)))){ - return true; + || MovementHelper.canWalkOn(ctx, new BetterBlockPos(x - offset, y, z - offset))); } - return false; + return true; } @Override From d7088c8eea51d4abbdf39c07e7eae7e2702848ec Mon Sep 17 00:00:00 2001 From: scorbett123 Date: Mon, 31 Aug 2020 18:48:46 +0100 Subject: [PATCH 8/8] fix typo in java-doc x2 Signed-off-by: scorbett123 --- src/api/java/baritone/api/Settings.java | 2 +- src/api/java/baritone/api/process/IBaritoneProcess.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 6ef5e5d1..46e3fbf5 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -64,7 +64,7 @@ public final class Settings { /** * Disable baritone's auto-tool at runtime, but still assume that another mod will provide auto tool functionality *

- * Specifically, path calculation will still assume that an auto tool wil run at execution time, even though + * Specifically, path calculation will still assume that an auto tool will run at execution time, even though * Baritone itself will not do that. */ public final Setting assumeExternalAutoTool = new Setting<>(false); diff --git a/src/api/java/baritone/api/process/IBaritoneProcess.java b/src/api/java/baritone/api/process/IBaritoneProcess.java index 726260d8..9c62d203 100644 --- a/src/api/java/baritone/api/process/IBaritoneProcess.java +++ b/src/api/java/baritone/api/process/IBaritoneProcess.java @@ -75,7 +75,7 @@ public interface IBaritoneProcess { * to start eating this tick. {@code PauseForAutoEatProcess} should only actually right click once onTick is called with * {@code isSafeToCancel} true though. * - * @return Whethor or not if this control is temporary + * @return Whether or not if this control is temporary */ boolean isTemporary();