Skip to content

Commit

Permalink
Merge branch 'master' into 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
leijurv committed Aug 18, 2023
2 parents 7969988 + 4efa2b1 commit b351cee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ mapping

libs/lwjgl-platform-2.9.4-nightly-20150209-natives-osx.jar
libs/java-objc-bridge-1.1.jar

mapping
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,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>
Expand Down Expand Up @@ -60,7 +60,7 @@ 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.18/baritone-api-forge-1.2.18.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.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) |
Expand Down
7 changes: 3 additions & 4 deletions buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ private String getJavaBinPathForProguard() throws Exception {
ex.printStackTrace();
}

path = findJavaByGradleCurrentRuntime();
if (path != null) return path;

try {
path = findJavaByJavaHome();
if (path != null) return path;
Expand All @@ -134,10 +137,6 @@ private String getJavaBinPathForProguard() throws Exception {
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)");
}
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/baritone/process/elytra/ElytraBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,19 @@ private void pathfindAroundObstacles() {
}
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
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
} else {
rejoinMainPathAt = path.size() - 1; // 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));

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),
Expand Down

0 comments on commit b351cee

Please sign in to comment.