From aee36e4d85ce46838acbe4493d6ebed97981d385 Mon Sep 17 00:00:00 2001 From: leijurv Date: Fri, 18 Aug 2023 19:35:30 -0700 Subject: [PATCH 1/5] deprecate 1.12.2 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 11a12e822..3167deb3d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +# Warning: Old Branch!! + +**This branch (`master`) is Baritone for Minecraft 1.12.2. This is the original version of Minecraft that Baritone was written for, and it was the primary development branch for over 5 years. As such, it's quite mature, and arguably more reliable than Baritone for newer versions of Minecraft. Nevertheless, as of August 2023, with [2b2t's update from 1.12.2 to 1.19.4](https://2b2t.org/update/), I decided to move Baritone's primary development branch accordingly. PRs should now be made against the `1.19.4` branch going forward. This branch might see some fixes going forward, particularly to newer features such as `#elytra`, but it won't be the primary focus anymore.** + +The other intermediary branches (`1.13.2`, `1.14.4`, `1.15.2`, `1.16.5`, `1.17.1`, `1.18.2`, `1.19.2`, and `1.19.3`) will probably not receive any updates at all. You can find their last releases in the releases tab, or in the quick download links table. + +For `1.16.5` and `1.18.2`, the latest release is fully up to date with the code. ZacSharp merged master into some of those versions even after they were deprecated, if you are for some reason really interested in the latest Baritone bugfixes on these versions of Minecraft, you can build from source as of these commits: [1.13.2](https://github.com/cabaletta/baritone/commit/be54b8ee5b5639f80e3d6809ed1abd52444d8a08), [1.14.4](https://github.com/cabaletta/baritone/commit/be54b8ee5b5639f80e3d6809ed1abd52444d8a08), [1.15.2](https://github.com/cabaletta/baritone/commit/45abbb7fa1062cefc26abbb006a02a4edd6faa32), [1.17.1](https://github.com/cabaletta/baritone/commit/cbf0d79c9c5f7454071dc0a5289261ec9ca4373f), [1.19.2](https://github.com/cabaletta/baritone/commit/217dca53633610edc9483fda7a234e46c839fd99). For `1.19.3`, merging [this](https://github.com/cabaletta/baritone/commit/217dca53633610edc9483fda7a234e46c839fd99) commit into it is trivial and is left as an exercise for the reader. For other versions in between these (for example people always ask in the Discord for 1.16.1), you'll have to figure it out yourself. + # Baritone

GitHub All Releases From 301ad403508139cb2ee09bd44896ae6a251849ab Mon Sep 17 00:00:00 2001 From: leijurv Date: Fri, 18 Aug 2023 19:36:12 -0700 Subject: [PATCH 2/5] link to latest --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3167deb3d..2847001a3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Warning: Old Branch!! +**Click [here](https://github.com/cabaletta/baritone) to go to the current Baritone readme.** + **This branch (`master`) is Baritone for Minecraft 1.12.2. This is the original version of Minecraft that Baritone was written for, and it was the primary development branch for over 5 years. As such, it's quite mature, and arguably more reliable than Baritone for newer versions of Minecraft. Nevertheless, as of August 2023, with [2b2t's update from 1.12.2 to 1.19.4](https://2b2t.org/update/), I decided to move Baritone's primary development branch accordingly. PRs should now be made against the `1.19.4` branch going forward. This branch might see some fixes going forward, particularly to newer features such as `#elytra`, but it won't be the primary focus anymore.** The other intermediary branches (`1.13.2`, `1.14.4`, `1.15.2`, `1.16.5`, `1.17.1`, `1.18.2`, `1.19.2`, and `1.19.3`) will probably not receive any updates at all. You can find their last releases in the releases tab, or in the quick download links table. From 5f5567f283a0e51eb2b74b117abf448ce0f684e7 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sat, 19 Aug 2023 15:33:12 -0400 Subject: [PATCH 3/5] recover from flying into lava (and fix ignoreLava) --- .../java/baritone/process/elytra/ElytraBehavior.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/process/elytra/ElytraBehavior.java b/src/main/java/baritone/process/elytra/ElytraBehavior.java index 127f90131..7334f10b4 100644 --- a/src/main/java/baritone/process/elytra/ElytraBehavior.java +++ b/src/main/java/baritone/process/elytra/ElytraBehavior.java @@ -24,6 +24,7 @@ import baritone.api.behavior.look.ITickableAimProcessor; import baritone.api.event.events.*; import baritone.api.pathing.goals.GoalBlock; import baritone.api.utils.*; +import baritone.api.utils.input.Input; import baritone.process.ElytraProcess; import baritone.utils.BlockStateInterface; import baritone.utils.IRenderer; @@ -601,6 +602,11 @@ public final class ElytraBehavior implements Helper { this.deployedFireworkLastTick = false; } + final boolean inLava = ctx.player().isInLava(); + if (inLava) { + baritone.getInputOverrideHandler().setInputForceState(Input.JUMP, true); + } + if (solution == null) { logDirect("no solution"); return; @@ -619,7 +625,7 @@ public final class ElytraBehavior implements Helper { solution.context.start, solution.goingTo, solution.context.boost.isBoosted(), - solution.forceUseFirework + solution.forceUseFirework || inLava ); } @@ -1001,7 +1007,7 @@ public final class ElytraBehavior implements Helper { // if start == dest then the cpp raytracer dies clear = start.equals(dest) || this.context.raytrace(start, dest); } else { - clear = ctx.world().clip(new ClipContext(start, dest, ClipContext.Block.COLLIDER, ClipContext.Fluid.ANY, ctx.player())).getType() == HitResult.Type.MISS; + clear = ctx.world().clip(new ClipContext(start, dest, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, ctx.player())).getType() == HitResult.Type.MISS; } if (Baritone.settings().elytraRenderRaytraces.value) { From f2679bea294e51e3d2e83bda562451f8f9d2cf5a Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 22 Aug 2023 13:28:11 -0700 Subject: [PATCH 4/5] hopefully actually fix backtracking --- .../process/elytra/ElytraBehavior.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/baritone/process/elytra/ElytraBehavior.java b/src/main/java/baritone/process/elytra/ElytraBehavior.java index c6207b08f..29f63f96c 100644 --- a/src/main/java/baritone/process/elytra/ElytraBehavior.java +++ b/src/main/java/baritone/process/elytra/ElytraBehavior.java @@ -98,7 +98,7 @@ public final class ElytraBehavior implements Helper { private BlockStateInterface bsi; private final BlockStateOctreeInterface boi; - public final BlockPos destination; + public final BetterBlockPos destination; private final boolean appendDestination; private final ExecutorService solverExecutor; @@ -119,7 +119,7 @@ public final class ElytraBehavior implements Helper { this.blockedLines = new CopyOnWriteArrayList<>(); this.pathManager = this.new PathManager(); this.process = process; - this.destination = destination; + this.destination = new BetterBlockPos(destination); this.appendDestination = appendDestination; this.solverExecutor = Executors.newSingleThreadExecutor(); this.nextTickBoostCounter = new int[2]; @@ -188,16 +188,16 @@ public final class ElytraBehavior implements Helper { }); } - public CompletableFuture pathRecalcSegment(final int upToIncl) { + public CompletableFuture pathRecalcSegment(final OptionalInt upToIncl) { if (this.recalculating) { throw new IllegalStateException("already recalculating"); } this.recalculating = true; - final List after = this.path.subList(upToIncl + 1, this.path.size()); + final List after = upToIncl.isPresent() ? this.path.subList(upToIncl.getAsInt() + 1, this.path.size()) : Collections.emptyList(); final boolean complete = this.completePath; - return this.path0(ctx.playerFeet(), this.path.get(upToIncl), segment -> segment.append(after.stream(), complete)) + return this.path0(ctx.playerFeet(), upToIncl.isPresent() ? this.path.get(upToIncl.getAsInt()) : ElytraBehavior.this.destination, segment -> segment.append(after.stream(), complete || (segment.isFinished() && !upToIncl.isPresent()))) .whenComplete((result, ex) -> { this.recalculating = false; if (ex != null) { @@ -315,7 +315,7 @@ public final class ElytraBehavior implements Helper { } if (ElytraBehavior.this.process.state != ElytraProcess.State.LANDING && this.ticksNearUnchanged > 100) { - this.pathRecalcSegment(rangeEndExcl - 1) + this.pathRecalcSegment(OptionalInt.of(rangeEndExcl - 1)) .thenRun(() -> { logDirect("Recalculating segment, no progress in last 100 ticks"); }); @@ -331,15 +331,15 @@ public final class ElytraBehavior implements Helper { if (!ElytraBehavior.this.clearView(this.path.getVec(i), this.path.getVec(i + 1), false)) { // obstacle. where do we return to pathing? // if the end of render distance is closer to goal, then that's fine, otherwise we'd be "digging our hole deeper" and making an already bad backtrack worse - int rejoinMainPathAt; - if (this.path.get(rangeEndExcl - 1).distanceSq(this.path.get(path.size() - 1)) < ctx.playerFeet().distanceSq(this.path.get(path.size() - 1))) { - rejoinMainPathAt = rangeEndExcl - 1; // rejoin after current render distance + OptionalInt rejoinMainPathAt; + if (this.path.get(rangeEndExcl - 1).distanceSq(ElytraBehavior.this.destination) < ctx.playerFeet().distanceSq(ElytraBehavior.this.destination)) { + rejoinMainPathAt = OptionalInt.of(rangeEndExcl - 1); // rejoin after current render distance } else { - rejoinMainPathAt = path.size() - 1; // large backtrack detected. ignore render distance, rejoin later on + rejoinMainPathAt = OptionalInt.empty(); // large backtrack detected. ignore render distance, rejoin later on } final BetterBlockPos blockage = this.path.get(i); - final double distance = ctx.playerFeet().distanceTo(this.path.get(rejoinMainPathAt)); + final double distance = ctx.playerFeet().distanceTo(this.path.get(rejoinMainPathAt.orElse(path.size() - 1))); final long start = System.nanoTime(); this.pathRecalcSegment(rejoinMainPathAt) @@ -356,7 +356,7 @@ public final class ElytraBehavior implements Helper { } } if (!canSeeAny && rangeStartIncl < rangeEndExcl - 2 && process.state != ElytraProcess.State.GET_TO_JUMP) { - this.pathRecalcSegment(rangeEndExcl - 1).thenRun(() -> logDirect("Recalculated segment since no path points were visible")); + this.pathRecalcSegment(OptionalInt.of(rangeEndExcl - 1)).thenRun(() -> logDirect("Recalculated segment since no path points were visible")); } } From 2cd5c6b0af433b6c4dfef17b3000834c630551ba Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 22 Aug 2023 13:28:45 -0700 Subject: [PATCH 5/5] delete master stuff --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index f9797fafd..3f2923f92 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,3 @@ -# Warning: Old Branch!! - -**Click [here](https://github.com/cabaletta/baritone) to go to the current Baritone readme.** - -**This branch (`master`) is Baritone for Minecraft 1.12.2. This is the original version of Minecraft that Baritone was written for, and it was the primary development branch for over 5 years. As such, it's quite mature, and arguably more reliable than Baritone for newer versions of Minecraft. Nevertheless, as of August 2023, with [2b2t's update from 1.12.2 to 1.19.4](https://2b2t.org/update/), I decided to move Baritone's primary development branch accordingly. PRs should now be made against the `1.19.4` branch going forward. This branch might see some fixes going forward, particularly to newer features such as `#elytra`, but it won't be the primary focus anymore.** - -The other intermediary branches (`1.13.2`, `1.14.4`, `1.15.2`, `1.16.5`, `1.17.1`, `1.18.2`, `1.19.2`, and `1.19.3`) will probably not receive any updates at all. You can find their last releases in the releases tab, or in the quick download links table. - -For `1.16.5` and `1.18.2`, the latest release is fully up to date with the code. ZacSharp merged master into some of those versions even after they were deprecated, if you are for some reason really interested in the latest Baritone bugfixes on these versions of Minecraft, you can build from source as of these commits: [1.13.2](https://github.com/cabaletta/baritone/commit/be54b8ee5b5639f80e3d6809ed1abd52444d8a08), [1.14.4](https://github.com/cabaletta/baritone/commit/be54b8ee5b5639f80e3d6809ed1abd52444d8a08), [1.15.2](https://github.com/cabaletta/baritone/commit/45abbb7fa1062cefc26abbb006a02a4edd6faa32), [1.17.1](https://github.com/cabaletta/baritone/commit/cbf0d79c9c5f7454071dc0a5289261ec9ca4373f), [1.19.2](https://github.com/cabaletta/baritone/commit/217dca53633610edc9483fda7a234e46c839fd99). For `1.19.3`, merging [this](https://github.com/cabaletta/baritone/commit/217dca53633610edc9483fda7a234e46c839fd99) commit into it is trivial and is left as an exercise for the reader. For other versions in between these (for example people always ask in the Discord for 1.16.1), you'll have to figure it out yourself. - # Baritone

GitHub All Releases