Compare commits

...

12 Commits

Author SHA1 Message Date
Leijurv f2679bea29
hopefully actually fix backtracking 2023-08-22 13:28:11 -07:00
leijurv 301ad40350
link to latest 2023-08-18 19:36:12 -07:00
leijurv aee36e4d85
deprecate 1.12.2 2023-08-18 19:35:30 -07:00
Leijurv 4efa2b1272
fix backtracking bad behavior when render distance is tiny 2023-08-18 15:02:13 -07:00
Leijurv c2308c650a
mapping 2023-08-18 14:35:02 -07:00
leijurv 75b8554a11
bump readme 2023-08-17 17:14:33 -07:00
leijurv d9cb2d91a0
v1.2.19 2023-08-17 16:57:11 -07:00
leijurv d4b95110f5
fml 2023-08-17 16:56:22 -07:00
leijurv 8a2a20a1b3
1.16 and 1.18 deprecated 2023-08-17 14:40:26 -07:00
leijurv 7daf1022c0
Merge pull request #4100 from babbaj/fix-proguard-lol
proguard: get java from gradle runtime before JAVA_HOME
2023-08-15 21:33:42 -07:00
Babbaj 60d6791f0c
proguard: get java from gradle runtime before JAVA_HOME 2023-08-16 00:27:23 -04:00
Leijurv ca4385da7a
update readme 2023-08-14 22:34:38 -07:00
6 changed files with 39 additions and 22 deletions

2
.gitignore vendored
View File

@ -32,3 +32,5 @@ baritone_Client.launch
libs/lwjgl-platform-2.9.4-nightly-20150209-natives-osx.jar
libs/java-objc-bridge-1.1.jar
mapping

View File

@ -1,3 +1,13 @@
# 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
<p align="center">
<a href="https://github.com/cabaletta/baritone/releases/"><img src="https://img.shields.io/github/downloads/cabaletta/baritone/total.svg" alt="GitHub All Releases"/></a>
@ -8,9 +18,9 @@
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.13.2-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.14.4-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.15.2-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.16.5-brightgreen.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.16.5-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.17.1-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.18.2-brightgreen.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.18.2-yellow.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.19.2-brightgreen.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.19.4-brightgreen.svg" alt="Minecraft"/></a>
<a href="#Baritone"><img src="https://img.shields.io/badge/MC-1.20.1-brightgreen.svg" alt="Minecraft"/></a>
@ -60,10 +70,10 @@ Baritone is the pathfinding system used in [Impact](https://impactclient.net/) s
| Forge | Fabric |
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| [1.12.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.2.17/baritone-api-forge-1.2.17.jar) | |
| [1.16.5 Forge](https://github.com/cabaletta/baritone/releases/download/v1.6.4/baritone-api-forge-1.6.4.jar) | [1.16.5 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.6.4/baritone-api-fabric-1.6.4.jar) |
| [1.12.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.2.19/baritone-api-forge-1.2.19.jar) | |
| [1.16.5 Forge](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-forge-1.6.5.jar) | [1.16.5 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-fabric-1.6.5.jar) |
| [1.17.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-forge-1.7.3.jar) | [1.17.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-fabric-1.7.3.jar) |
| [1.18.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.8.4/baritone-api-forge-1.8.4.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.4/baritone-api-fabric-1.8.4.jar) |
| [1.18.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.8.5/baritone-api-forge-1.8.5.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.5/baritone-api-fabric-1.8.5.jar) |
| [1.19.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-forge-1.9.4.jar) | [1.19.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-fabric-1.9.4.jar) |
| [1.19.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-forge-1.9.1.jar) | [1.19.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-fabric-1.9.1.jar) |
| [1.19.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-forge-1.9.3.jar) | [1.19.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-fabric-1.9.3.jar) |
@ -71,7 +81,7 @@ Baritone is the pathfinding system used in [Impact](https://impactclient.net/) s
**Message for 2b2t players looking for 1.19/1.20 Baritone** Download it from right above ^. But also please check back in a few days for Baritone Elytra ([vid 1](https://youtu.be/4bGGPo8yiHo) [vid 2](https://www.youtube.com/watch?v=pUN9nmINe3I)), which will be ported to 1.19/1.20 soon! It will work on 2b2t with its anticheat, that was the whole point of Baritone Elytra (it's fully vanilla compatible). Also join [**the discord**](http://discord.gg/s6fRBAUpmr). Thanks!
**How to immediately get started:** Type `#goto 1000 500` in chat to go to x=1000 z=500. Type `#mine diamond_ore` to mine diamond ore. Type `#stop` to stop. For more, read [the usage page](USAGE.md) and/or watch this [tutorial playlist](https://www.youtube.com/playlist?list=PLnwnJ1qsS7CoQl9Si-RTluuzCo_4Oulpa)
**How to immediately get started:** Type `#goto 1000 500` in chat to go to x=1000 z=500. Type `#mine diamond_ore` to mine diamond ore. Type `#stop` to stop. For more, read [the usage page](USAGE.md) and/or watch this [tutorial playlist](https://www.youtube.com/playlist?list=PLnwnJ1qsS7CoQl9Si-RTluuzCo_4Oulpa). Also try `#elytra` for Elytra flying in the Nether using fireworks.
For other versions of Minecraft or more complicated situations or for development, see [Installation & setup](SETUP.md). Also consider just installing [Impact](https://impactclient.net/), which comes with Baritone and is easier to install than wrangling with version JSONs and zips. For 1.16.5, [click here](https://www.youtube.com/watch?v=_4eVJ9Qz2J8) and see description. Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it. There's a [showcase video](https://youtu.be/CZkLXWo4Fg4) made by @Adovin#6313 on Baritone which I recommend.

View File

@ -16,7 +16,7 @@
*/
group 'baritone'
version '1.2.18'
version '1.2.19'
buildscript {
repositories {

View File

@ -114,6 +114,9 @@ public class ProguardTask extends BaritoneGradleTask {
ex.printStackTrace();
}
path = findJavaByGradleCurrentRuntime();
if (path != null) return path;
try {
path = findJavaByJavaHome();
if (path != null) return path;
@ -122,10 +125,6 @@ public class ProguardTask extends BaritoneGradleTask {
ex.printStackTrace();
}
path = findJavaByGradleCurrentRuntime();
if (path != null) return path;
throw new Exception("Unable to find java to determine ProGuard libraryjars. Please specify forkOptions.executable in javaCompile," +
" JAVA_HOME environment variable, or make sure to run Gradle with the correct JDK (a v1.8 only)");
}

View File

@ -177,7 +177,6 @@ public class ElytraCommand extends Command {
}
private boolean detectOn2b2t() {
if (true) return true;
ServerData data = ctx.minecraft().getCurrentServerData();
return data != null && data.serverIP.toLowerCase().contains("2b2t.org");
}

View File

@ -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<Void> pathRecalcSegment(final int upToIncl) {
public CompletableFuture<Void> pathRecalcSegment(final OptionalInt upToIncl) {
if (this.recalculating) {
throw new IllegalStateException("already recalculating");
}
this.recalculating = true;
final List<BetterBlockPos> after = this.path.subList(upToIncl + 1, this.path.size());
final List<BetterBlockPos> 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");
});
@ -330,12 +330,19 @@ 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?
// find the next valid segment
// 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
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 = 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(rangeEndExcl - 1));
final double distance = ctx.playerFeet().distanceTo(this.path.get(rejoinMainPathAt.orElse(path.size() - 1)));
final long start = System.nanoTime();
this.pathRecalcSegment(rangeEndExcl - 1)
this.pathRecalcSegment(rejoinMainPathAt)
.thenRun(() -> {
logDirect(String.format("Recalculated segment around path blockage near %s %s %s (next %.1f blocks in %.4f seconds)",
SettingsUtil.maybeCensor(blockage.x),
@ -349,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"));
}
}