Skip to content

Commit 0a374ad

Browse files
committed
Merge branch '1.21.8' into 1.21.10
2 parents 7d3dad3 + 77758cf commit 0a374ad

38 files changed

Lines changed: 1282 additions & 296 deletions

.github/workflows/gradle_build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
with:
1818
fetch-depth: 0
1919

2020
- name: Set up JDK 21
21-
uses: actions/setup-java@v4
21+
uses: actions/setup-java@v5
2222
with:
2323
java-version: '21'
2424
distribution: 'temurin'
@@ -31,13 +31,13 @@ jobs:
3131
run: ./gradlew build -Pmod_version="$(git describe --always --tags --first-parent | cut -c2-)"
3232

3333
- name: Archive Artifacts
34-
uses: actions/upload-artifact@v4
34+
uses: actions/upload-artifact@v7
3535
with:
3636
name: Artifacts
3737
path: dist/
3838

3939
- name: Archive mapping.txt
40-
uses: actions/upload-artifact@v4
40+
uses: actions/upload-artifact@v7
4141
with:
4242
name: Mappings
4343
path: mapping/

.github/workflows/run_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- name: Set up JDK 21
16-
uses: actions/setup-java@v4
16+
uses: actions/setup-java@v5
1717
with:
1818
java-version: '21'
1919
distribution: 'temurin'

FEATURES.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Pathing features
2+
23
- **Long distance pathing and splicing** Baritone calculates paths in segments, and precalculates the next segment when the current one is about to end, so that it's moving towards the goal at all times.
34
- **Chunk caching** Baritone simplifies chunks to a compacted internal 2-bit representation (AIR, SOLID, WATER, AVOID) and stores them in RAM for better very-long-distance pathing. There is also an option to save these cached chunks to disk. <a href="https://www.youtube.com/watch?v=dyfYKSubhdc">Example</a>
45
- **Block breaking** Baritone considers breaking blocks as part of its path. It also takes into account your current tool set and hot bar. For example, if you have a Eff V diamond pick, it may choose to mine through a stone barrier, while if you only had a wood pick it might be faster to climb over it.
@@ -14,7 +15,8 @@
1415
- **Pigs** It can sort of control pigs. I wouldn't rely on it though.
1516

1617
# Pathing method
17-
Baritone uses A*, with some modifications:
18+
19+
Baritone uses A*, with some modifications:
1820

1921
- **Segmented calculation** Traditional A* calculates until the most promising node is in the goal, however in the environment of Minecraft with a limited render distance, we don't know the environment all the way to our goal. Baritone has three possible ways for path calculation to end: finding a path all the way to the goal, running out of time, or getting to the render distance. In the latter two scenarios, the selection of which segment to actually execute falls to the next item (incremental cost backoff). Whenever the path calculation thread finds that the best / most promising node is at the edge of loaded chunks, it increments a counter. If this happens more than 50 times (configurable), path calculation exits early. This happens with very low render distances. Otherwise, calculation continues until the timeout is hit (also configurable) or we find a path all the way to the goal.
2022
- **Incremental cost backoff** When path calculation exits early without getting all the way to the goal, Baritone it needs to select a segment to execute first (assuming it will calculate the next segment at the end of this one). It uses incremental cost backoff to select the best node by varying metrics, then paths to that node. This is unchanged from MineBot and I made a <a href="https://docs.google.com/document/d/1WVHHXKXFdCR1Oz__KtK8sFqyvSwJN_H4lftkHFgmzlc/edit">write-up</a> that still applies. In essence, it keeps track of the best node by various increasing coefficients, then picks the node with the least coefficient that goes at least 5 blocks from the starting position.
@@ -27,7 +29,9 @@ Baritone uses A*, with some modifications:
2729
- [Baritone chat control usage](USAGE.md)
2830

2931
# Goals
32+
3033
The pathing goal can be set to any of these options:
34+
3135
- **GoalBlock** one specific block that the player should stand inside at foot level
3236
- **GoalXZ** an X and a Z coordinate, used for long distance pathing
3337
- **GoalYLevel** a Y coordinate
@@ -38,14 +42,16 @@ The pathing goal can be set to any of these options:
3842

3943
And finally `GoalComposite`. `GoalComposite` is a list of other goals, any one of which satisfies the goal. For example, `mine diamond_ore` creates a `GoalComposite` of `GoalTwoBlocks`s for every diamond ore location it knows of.
4044

41-
4245
# Future features
46+
4347
Things it doesn't have yet
48+
4449
- Trapdoors
4550
- Sprint jumping in a 1x2 corridor
4651

4752
See <a href="https://github.com/cabaletta/baritone/issues">issues</a> for more.
4853

4954
Things it may not ever have, from most likely to least likely =(
55+
5056
- Boats
5157
- Horses (2x3 path instead of 1x2)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Baritone
2+
23
<p align="center">
34
<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>
45
</p>
@@ -111,15 +112,14 @@ Here are some links to help to get started:
111112
# API
112113

113114
The API is heavily documented, you can find the Javadocs for the latest release [here](https://baritone.leijurv.com/).
114-
Please note that usage of anything located outside of the ``baritone.api`` package is not supported by the API release
115+
Please note that usage of anything located outside of the `baritone.api` package is not supported by the API release
115116
jar.
116117

117118
Below is an example of basic usage for changing some settings, and then pathing to an X/Z goal.
118119

119120
```java
120121
BaritoneAPI.getSettings().allowSprint.value = true;
121122
BaritoneAPI.getSettings().primaryTimeoutMS.value = 2000L;
122-
123123
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ(10000, 20000));
124124
```
125125

SETUP.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ The easiest way to install Baritone is to install it as Forge/Neoforge/Fabric mo
66
Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it.
77

88
## Prebuilt official releases
9+
910
Releases are made rarely and are not always up to date with the latest features and bug fixes.
1011

1112
Link to the releases page: [Releases](https://github.com/cabaletta/baritone/releases)
1213

1314
The mapping between Minecraft versions and major Baritone versions is as follows
15+
1416
| Minecraft version | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19 | 1.20 | 1.21 | 1.21.4 | 1.21.5 | 1.21.6 - 1.21.8 |
1517
|-------------------|------|------|------|------|------|------|------|------|-------|-------|--------|--------|------------------|
1618
| Baritone version | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 | v1.11 | v1.13 | v1.14 | v1.15 |
1719

18-
Any official release will be GPG signed by leijurv (44A3EA646EADAC6A). Please verify that the hash of the file you download is in `checksums.txt` and that `checksums_signed.asc` is a valid signature by that public keys of `checksums.txt`.
20+
Any official release will be GPG signed by leijurv (44A3EA646EADAC6A). Please verify that the hash of the file you download is in `checksums.txt` and that `checksums_signed.asc` is a valid signature by that public keys of `checksums.txt`.
1921

2022
The build is fully deterministic and reproducible, and you can verify that by running `docker build --no-cache -t cabaletta/baritone .` yourself and comparing the shasum. This works identically on Travis, Mac, and Linux (if you have docker on Windows, I'd be grateful if you could let me know if it works there too).
2123

22-
2324
## Artifacts
2425

2526
Building Baritone will create the final artifacts in the ``dist`` directory. These are the same as the artifacts created in the [releases](https://github.com/cabaletta/baritone/releases).
@@ -31,6 +32,7 @@ If you want to report a bug and spare us some effort, you want `baritone-unoptim
3132
Otherwise, you want `baritone-standalone-*-VERSION.jar`
3233

3334
Here's what the various qualifiers mean
35+
3436
- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features.
3537
- **Standalone**: Everything is obfuscated. Other mods cannot use Baritone, but you get a bit of extra performance.
3638
- **Unoptimized**: Nothing is obfuscated. This shouldn't be used in production, but is really helpful for crash reports.
@@ -41,24 +43,27 @@ Here's what the various qualifiers mean
4143
If you build from source you will also find mapping files in the `dist` directory. These contain the renamings done by ProGuard and are useful if you want to read obfuscated stack traces.
4244

4345
## Build it yourself
46+
4447
- Clone or download Baritone
4548

4649
![Image](https://i.imgur.com/kbqBtoN.png)
4750
- If you choose to download, make sure you download the correct branch and extract the ZIP archive.
4851
- Follow one of the instruction sets below, based on your preference
4952

5053
## Command Line
54+
5155
On Mac OSX and Linux, use `./gradlew` instead of `gradlew`.
5256

5357
The recommended Java versions by Minecraft version are
58+
5459
| Minecraft version | Java version |
5560
|-------------------------------|---------------|
5661
| 1.12.2 - 1.16.5 | 8 |
5762
| 1.17.1 | 16 |
5863
| 1.18.2 - 1.20.4 | 17 |
5964
| 1.20.5 - 1.21.8 | 21 |
6065

61-
Download java: https://adoptium.net/
66+
Download java: <https://adoptium.net/>
6267

6368
To check which java version you are using do `java -version` in a command prompt or terminal.
6469

@@ -75,11 +80,13 @@ and `gradlew build -Pbaritone.forge_build` / `gradlew build -Pbaritone.fabric_bu
7580
for Forge/Fabric instead. And you might have to run `setupDecompWorkspace` first.
7681

7782
## IntelliJ
83+
7884
- Open the project in IntelliJ as a Gradle project
7985
- Refresh the Gradle project (or, to be safe, just restart IntelliJ)
8086
- Depending on the minecraft version, you may need to run `setupDecompWorkspace` or `genIntellijRuns` in order to get everything working
8187

8288
## Github Actions
89+
8390
Most branches have a CI workflow at `.github/workflows/gradle_build.yml`. If you fork this repository and enable actions for your fork
8491
you can push a dummy commit to trigger it and have GitHub build Baritone for you.
8592

USAGE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Try `#help` I promise it won't just send you back here =)
1616

1717
"wtf where is cleararea" -> look at `#help sel`
1818

19-
"wtf where is goto death, goto waypoint" -> look at `#help wp`
19+
"wtf where is goto death, goto waypoint" -> look at `#help wp`
2020

2121
just look at `#help` lmao
2222

@@ -33,6 +33,7 @@ Watch this [showcase video](https://youtu.be/CZkLXWo4Fg4)!
3333
To toggle a boolean setting, just say its name in chat (for example saying `allowBreak` toggles whether Baritone will consider breaking blocks). For a numeric setting, say its name then the new value (like `primaryTimeoutMS 250`). It's case insensitive. To reset a setting to its default value, say `acceptableThrowawayItems reset`. To reset all settings, say `reset`. To see all settings that have been modified from their default values, say `modified`.
3434

3535
Commands in Baritone:
36+
3637
- `thisway 1000` then `path` to go in the direction you're facing for a thousand blocks
3738
- `goal x y z` or `goal x z` or `goal y`, then `path` to set a goal to a certain coordinate then path to it
3839
- `goto x y z` or `goto x z` or `goto y` to go to a certain coordinate (in a single step, starts going immediately)
@@ -47,7 +48,7 @@ Commands in Baritone:
4748
- `build` to build a schematic. `build blah.schematic` will load `schematics/blah.schematic` and build it with the origin being your player feet. `build blah.schematic x y z` to set the origin. Any of those can be relative to your player (`~ 69 ~-420` would build at x=player x, y=69, z=player z-420).
4849
- `schematica` to build the schematic that is currently open in schematica
4950
- `tunnel` to dig and make a tunnel, 1x2. It will only deviate from the straight line if necessary such as to avoid lava. For a dumber tunnel that is really just cleararea, you can `tunnel 3 2 100`, to clear an area 3 high, 2 wide, and 100 deep.
50-
- `farm` to automatically harvest, replant, or bone meal crops. Use `farm <range>` or `farm <range> <waypoint>` to limit the max distance from the starting point or a waypoint.
51+
- `farm` to automatically harvest, replant, or bone meal crops. Use `farm <range>` or `farm <range> <waypoint>` to limit the max distance from the starting point or a waypoint.
5152
- `axis` to go to an axis or diagonal axis at y=120 (`axisHeight` is a configurable setting, defaults to 120).
5253
- `explore x z` to explore the world from the origin of x,z. Leave out x and z to default to player feet. This will continually path towards the closest chunk to the origin that it's never seen before. `explorefilter filter.json` with optional invert can be used to load in a list of chunks to load.
5354
- `invert` to invert the current goal and path. This gets as far away from it as possible, instead of as close as possible. For example, do `goal` then `invert` to run as far as possible from where you're standing at the start.
@@ -67,6 +68,7 @@ Commands in Baritone:
6768
All the settings and documentation are <a href="https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java">here</a>. If you find HTML easier to read than Javadoc, you can look <a href="https://baritone.leijurv.com/baritone/api/Settings.html#field.detail">here</a>.
6869

6970
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.
71+
7072
- `allowBreak`
7173
- `allowSprint`
7274
- `allowPlace`
@@ -86,12 +88,10 @@ There are about a hundred settings, but here are some fun / interesting / import
8688
- `mineScanDroppedItems`
8789
- `allowDiagonalAscend`
8890

89-
90-
91-
9291
# Troubleshooting / common issues
9392

9493
## Why doesn't Baritone respond to any of my chat commands?
94+
9595
This could be one of many things.
9696

9797
First, make sure it's actually installed. An easy way to check is seeing if it created the folder `baritone` in your Minecraft folder.
@@ -101,7 +101,7 @@ Second, make sure that you're using the prefix properly, and that chat control i
101101
For example, Impact disables direct chat control. (i.e. anything typed in chat without a prefix will be ignored and sent publicly). **This is a saved setting**, so if you run Impact once, `chatControl` will be off from then on, **even in other clients**.
102102
So you'll need to use the `#` prefix or edit `baritone/settings.txt` in your Minecraft folder to undo that (specifically, remove the line `chatControl false` then restart your client).
103103

104-
105104
## Why can I do `.goto x z` in Impact but nowhere else? Why can I do `-path to x z` in KAMI but nowhere else?
105+
106106
These are custom commands that they added; those aren't from Baritone.
107107
The equivalent you're looking for is `goto x z`.

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ allprojects {
2020
apply plugin: "xyz.wagyourtail.unimined"
2121
apply plugin: "maven-publish"
2222

23-
archivesBaseName = rootProject.archives_base_name
23+
base {
24+
archivesName = rootProject.archives_base_name
25+
}
2426

2527
def vers = ""
2628
try {
@@ -37,9 +39,8 @@ allprojects {
3739
}
3840
group = rootProject.maven_group
3941

40-
sourceCompatibility = targetCompatibility = JavaVersion.toVersion(project.java_version)
41-
4242
java {
43+
sourceCompatibility = JavaVersion.toVersion(project.java_version)
4344
toolchain {
4445
languageVersion.set(JavaLanguageVersion.of(sourceCompatibility.majorVersion.toInteger()))
4546
}
@@ -113,7 +114,9 @@ unimined.minecraft {
113114
defaultRemapJar = false
114115
}
115116

116-
archivesBaseName = archivesBaseName + "-common"
117+
base {
118+
archivesName = archivesName.get() + "-common"
119+
}
117120

118121
sourceSets {
119122
api {

buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package baritone.gradle.task;
1919

2020
import baritone.gradle.util.Determinizer;
21-
import org.gradle.api.plugins.JavaPluginConvention;
21+
import org.gradle.api.plugins.JavaPluginExtension;
2222
import org.gradle.api.tasks.Input;
2323
import org.gradle.api.tasks.SourceSetContainer;
2424
import org.gradle.api.tasks.TaskAction;
@@ -33,7 +33,7 @@
3333
import xyz.wagyourtail.unimined.api.minecraft.MinecraftConfig;
3434

3535
import java.io.*;
36-
import java.net.URL;
36+
import java.net.URI;
3737
import java.nio.file.Files;
3838
import java.nio.file.Path;
3939
import java.nio.file.StandardCopyOption;
@@ -97,7 +97,8 @@ private void processArtifact() throws Exception {
9797
private void downloadProguard() throws Exception {
9898
Path proguardZip = getTemporaryFile(String.format(PROGUARD_ZIP, proguardVersion));
9999
if (!Files.exists(proguardZip)) {
100-
write(new URL(String.format("https://github.com/Guardsquare/proguard/releases/download/v%s/proguard-%s.zip", proguardVersion, proguardVersion)).openStream(), proguardZip);
100+
String downloadAddress = String.format("https://github.com/Guardsquare/proguard/releases/download/v%s/proguard-%s.zip", proguardVersion, proguardVersion);
101+
write(new URI(downloadAddress).toURL().openStream(), proguardZip);
101102
}
102103
}
103104

@@ -175,7 +176,7 @@ private void generateConfigs() throws Exception {
175176
}
176177

177178
private Stream<File> acquireDependencies() {
178-
return getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("main").getCompileClasspath().getFiles()
179+
return getProject().getExtensions().getByType(JavaPluginExtension.class).getSourceSets().findByName("main").getCompileClasspath().getFiles()
179180
.stream()
180181
.filter(File::isFile);
181182
}

buildSrc/src/main/java/baritone/gradle/util/Determinizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static void determinize(String inputPath, String outputPath, List<File> t
6565
clone.setTime(42069);
6666
jos.putNextEntry(clone);
6767
if (entry.getName().endsWith(".refmap.json")) {
68-
JsonElement json = new JsonParser().parse(new InputStreamReader(jarFile.getInputStream(entry)));
68+
JsonElement json = JsonParser.parseReader(new InputStreamReader(jarFile.getInputStream(entry)));
6969
jos.write(writeSorted(json).getBytes());
7070
} else if (entry.getName().equals("META-INF/MANIFEST.MF") && doForgeReplacementOfMetaInf) { // only replace for forge jar
7171
ByteArrayOutputStream cancer = new ByteArrayOutputStream();

fabric/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ import baritone.gradle.task.CreateDistTask
1919
import baritone.gradle.task.ProguardTask
2020

2121
plugins {
22-
id "com.github.johnrengelman.shadow" version "8.0.0"
22+
id "com.github.johnrengelman.shadow" version "8.1.1"
2323
}
2424

25-
archivesBaseName = archivesBaseName + "-fabric"
25+
base {
26+
archivesName = archivesName.get() + "-fabric"
27+
}
2628

2729
unimined.minecraft {
2830
fabric {

0 commit comments

Comments
 (0)