Compare commits

...

67 Commits

Author SHA1 Message Date
leijurv
a9f40fb0e5 Merge pull request #4885 from Skylandia/tripwire-support
Allow pathing through tripwires
2025-10-16 11:12:38 -07:00
Skylandia
521303b9e4 allow the user to ignore tripwires on the path 2025-10-08 15:35:02 +13:00
leijurv
d196c649e3 Merge pull request #4752 from Murat65536/bridging-improvements
Bridging Improvements
2025-09-11 15:30:24 -07:00
Murat65536
a56f3cfd86 Clarify yaw distance comment 2025-09-10 21:06:26 -04:00
Murat65536
714e7afce1 More minor formatting changes. 2025-08-30 17:48:19 -04:00
Murat65536
037912871c Adjust order. 2025-08-30 08:21:58 -04:00
Murat65536
ce81d36479 Convert to ternary operators. 2025-08-28 21:44:05 -04:00
Murat65536
f9ae7029c3 Formatting change. 2025-08-28 08:57:49 -04:00
Murat65536
61c0a097bb Add 45 degree intervals to yaw change. 2025-08-28 08:22:17 -04:00
ZacSharp
2a3c22424f Update SETUP.md 2025-08-27 01:28:42 +02:00
ZacSharp
bd14ede064 Update README.md 2025-08-27 01:24:15 +02:00
Murat65536
a2a6769742 Round yaw to 45 degrees when bridging. 2025-08-23 20:25:16 -04:00
leijurv
44909d3140 Merge pull request #4764 from rfresh2/precomputed-data-optimize
reduce PrecomputedData memory usage
2025-08-18 21:21:16 -07:00
rfresh2
b666c92267 use requested style 2025-08-18 14:46:09 -07:00
Murat65536
0eb0e6709a Condense more. 2025-08-17 20:12:22 -04:00
Murat65536
9714fa4fd4 Condense logic into huge lambda. 2025-08-17 20:04:55 -04:00
Murat65536
f1e5c44b85 Replace messy Vec2 with a cleaner record class. Also, remove a messy switch case. 2025-08-17 19:52:14 -04:00
leijurv
ade898d5c6 Merge pull request #4839 from AverWasTaken/patch-1
Remove Elytra from future features
2025-08-16 21:20:18 -07:00
Murat65536
7b5ba80f67 Change to Vec2. 2025-08-06 15:38:53 -04:00
aver
69d91a62be Remove Elytra from future features 2025-08-05 16:44:14 -07:00
Murat65536
102960446d Fix bug. 2025-07-31 18:17:35 -04:00
Murat65536
2ba448c30d Merge remote-tracking branch 'origin/bridging-improvements' into bridging-improvements 2025-07-25 16:41:53 -04:00
Murat65536
9d33858687 Small change. 2025-07-25 16:41:38 -04:00
Murat Bayraktar
1c4c3f3eb6 Merge branch 'cabaletta:1.19.4' into bridging-improvements 2025-07-23 22:02:24 -04:00
leijurv
c1aa2012b9 Merge pull request #4740 from Murat65536/safewalk-update
Let external safewalk handle being safe.
2025-07-24 02:01:55 +02:00
Murat Bayraktar
9c84fa54c6 Merge branch 'cabaletta:1.19.4' into bridging-improvements 2025-07-23 19:31:44 -04:00
leijurv
95212d6339 Merge pull request #4742 from Murat65536/magma-block-detection
Magma block detection
2025-07-23 20:58:03 +02:00
leijurv
e3160f50de format 2025-07-23 11:57:53 -07:00
Murat65536
1a3d302e46 Clean up. 2025-07-23 00:49:45 -04:00
Murat65536
8ee7a1e39d Small change. 2025-07-23 00:29:03 -04:00
Murat65536
c8dcbeb6f8 Format. 2025-07-22 11:34:56 -04:00
Murat65536
65d0d860dd Reformatting, appeasing leijurv, and fixing stupid mistake. 2025-07-22 01:51:42 -04:00
Murat65536
65182fa2dc Remove movement change. 2025-07-20 18:40:25 -04:00
Murat Bayraktar
8168d1f889 Merge branch 'cabaletta:1.19.4' into safewalk-update 2025-07-20 18:24:01 -04:00
Murat65536
5d8136b02e Simplify. 2025-07-13 10:09:16 -04:00
Murat65536
191155315b Keep original player movement. 2025-07-06 20:25:02 -04:00
Murat Bayraktar
a30e3ce8e3 Merge branch 'cabaletta:1.19.4' into bridging-improvements 2025-07-06 19:44:20 -04:00
Murat65536
83afa1126e Fix. 2025-07-02 16:08:14 -04:00
Murat Bayraktar
7be4d646d9 Merge branch 'cabaletta:1.19.4' into magma-block-detection 2025-06-24 16:37:12 -04:00
leijurv
4d27d56ff5 Merge pull request #4639 from babbaj/fix-packer
fix chuckpacker y bug
2025-06-04 15:15:10 -07:00
Murat65536
72fb0a0d28 Add default to switch case. 2025-05-23 22:04:13 -04:00
Murat65536
cbfb329b94 Add direction-independent movement. 2025-05-23 18:31:34 -04:00
rfresh2
8f8ce30091 reduce PrecomputedData memory usage 2025-05-21 23:54:10 -07:00
leijurv
89b0fd74dd some readme updates, yes i intentionally linked to the baritone discord server three times 2025-05-14 15:48:46 -07:00
Murat65536
053b88d7cd Make cost calculation use settings in CalculationContext. 2025-05-14 15:13:12 -04:00
Murat Bayraktar
091500b002 Merge branch 'cabaletta:1.19.4' into safewalk-update 2025-05-14 19:08:45 +00:00
Murat Bayraktar
8d790ebe74 Merge branch 'cabaletta:1.19.4' into magma-block-detection 2025-05-14 19:07:56 +00:00
Murat65536
1078270eb3 Clean up. 2025-05-13 21:46:37 -04:00
ZacSharp
de0b1f271e Update quick download links 2025-05-13 23:33:25 +02:00
ZacSharp
5ffd3fcf20 Update setup information 2025-05-13 23:29:54 +02:00
ZacSharp
773d753c60 Update quick download links 2025-05-13 21:31:56 +02:00
ZacSharp
647daf23aa v1.9.5
previous commit was mistaken v1.9.4 already exists
2025-05-13 19:35:28 +02:00
ZacSharp
01379f5474 v1.9.4 2025-05-13 19:32:29 +02:00
Murat65536
0378096340 Make Baritone not look forward while bridging. 2025-05-11 18:12:11 -04:00
Murat Bayraktar
21954f74a9 Merge branch 'cabaletta:1.19.4' into magma-block-detection 2025-05-10 15:24:44 +00:00
Murat65536
6dd5d843d5 Make magma blocks disallowed if setting is turned off. 2025-05-10 08:53:26 -04:00
Murat65536
f4b51586e8 Add setting that controls sneaking on magma blocks. 2025-05-09 22:02:22 -04:00
Murat65536
267d677d79 Make MovementDiagonal not account sprint cost reduction on sneak. 2025-05-09 21:09:56 -04:00
Murat65536
0815697d30 Make MovementPillar literally always sneak because why not. 2025-05-09 20:41:19 -04:00
Murat65536
f504d26dfd Add magma block functionality to MovementParkour. 2025-05-09 20:15:36 -04:00
Murat65536
373757a63a Implement MovementFall magma block detection. 2025-05-09 18:53:03 -04:00
Murat65536
7317a5c9c4 Fix ascend. 2025-05-08 20:33:27 -04:00
Murat65536
8eebeb9772 Magma block detection for MovementDiagonal. 2025-05-08 18:51:37 -04:00
Murat65536
292f13d05e Small change. 2025-05-08 18:24:54 -04:00
Murat65536
974a3416d8 Integrate some magma block avoidance functionality. 2025-05-08 18:10:34 -04:00
Murat65536
7568939dfd Let external safewalk handle being safe. 2025-05-06 21:44:59 -04:00
Babbaj
6cc5420b95 fix chuckpacker y bug 2025-02-09 02:20:47 -05:00
18 changed files with 249 additions and 85 deletions

View File

@@ -49,4 +49,3 @@ See <a href="https://github.com/cabaletta/baritone/issues">issues</a> for more.
Things it may not ever have, from most likely to least likely =( Things it may not ever have, from most likely to least likely =(
- Boats - Boats
- Horses (2x3 path instead of 1x2) - Horses (2x3 path instead of 1x2)
- Elytra

View File

@@ -59,25 +59,29 @@ Baritone is the pathfinding system used in [Impact](https://impactclient.net/) s
**Quick download links:** **Quick download links:**
| Forge | Fabric | | Forge | Fabric | NeoForge |
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------| |---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [1.12.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.2.19/baritone-api-forge-1.2.19.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.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.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.6/baritone-api-forge-1.8.6.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.6/baritone-api-fabric-1.8.6.jar) | | [1.18.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.8.6/baritone-api-forge-1.8.6.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.6/baritone-api-fabric-1.8.6.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.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.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) | | [1.19.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.5/baritone-api-forge-1.9.5.jar) | [1.19.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.5/baritone-api-fabric-1.9.5.jar) | |
| [1.20.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-forge-1.10.1.jar) | [1.20.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-fabric-1.10.1.jar) | | [1.20.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.3/baritone-api-forge-1.10.3.jar) | [1.20.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.3/baritone-api-fabric-1.10.3.jar) | |
| [1.20.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-forge-1.10.2.jar) | [1.20.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-fabric-1.10.2.jar) | | [1.20.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-forge-1.10.4.jar) | [1.20.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-fabric-1.10.4.jar) | [1.20.3 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-neoforge-1.10.4.jar) |
| [1.20.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-forge-1.10.2.jar) | [1.20.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-fabric-1.10.2.jar) | | [1.20.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-forge-1.10.4.jar) | [1.20.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-fabric-1.10.4.jar) | [1.20.4 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.10.4/baritone-api-neoforge-1.10.4.jar) |
| [1.21.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.11.1/baritone-api-forge-1.11.1.jar) | [1.21.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.11.1/baritone-api-fabric-1.11.1.jar) | | [1.21.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.11.2/baritone-api-forge-1.11.2.jar) | [1.21.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.11.2/baritone-api-fabric-1.11.2.jar) | [1.21.1 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.11.2/baritone-api-neoforge-1.11.2.jar) |
| [1.21.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.11.1/baritone-api-forge-1.11.1.jar) | [1.21.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.11.1/baritone-api-fabric-1.11.1.jar) | [1.21.3 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.11.1/baritone-api-neoforge-1.11.1.jar) |
| [1.21.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.13.1/baritone-api-forge-1.13.1.jar) | [1.21.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.13.1/baritone-api-fabric-1.13.1.jar) | [1.21.4 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.13.1/baritone-api-neoforge-1.13.1.jar) |
| [1.21.5 Forge](https://github.com/cabaletta/baritone/releases/download/v1.14.0/baritone-api-forge-1.14.0.jar) | [1.21.5 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.14.0/baritone-api-fabric-1.14.0.jar) | [1.21.5 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.14.0/baritone-api-neoforge-1.14.0.jar) |
| [1.21.6 Forge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-forge-1.15.0.jar) | [1.21.6 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-fabric-1.15.0.jar) | [1.21.6 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-neoforge-1.15.0.jar) |
| [1.21.7 Forge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-forge-1.15.0.jar) | [1.21.7 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-fabric-1.15.0.jar) | [1.21.7 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-neoforge-1.15.0.jar) |
| [1.21.8 Forge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-forge-1.15.0.jar) | [1.21.8 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-fabric-1.15.0.jar) | [1.21.8 NeoForge](https://github.com/cabaletta/baritone/releases/download/v1.15.0/baritone-api-neoforge-1.15.0.jar) |
**Message for 2b2t players looking for 1.19/1.20 Baritone** If you like, please try the beta for Baritone Elytra for 2b2t, find it in #announcements of [the Baritone discord](http://discord.gg/s6fRBAUpmr). It supports 1.19.4 and 1.20.1, Forge or Fabric. If you have to see it to believe it, watch [this YouTube video](https://youtu.be/NnSlQi-68eQ). **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 ([trailer](https://youtu.be/4bGGPo8yiHo), [usage](https://youtu.be/NnSlQi-68eQ)). For help, join the [Baritone Discord Server](http://discord.gg/s6fRBAUpmr).
**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). 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. For help, join the [Baritone Discord Server](http://discord.gg/s6fRBAUpmr).
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.
This project is an updated version of [MineBot](https://github.com/leijurv/MineBot/), 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 onwards. 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). the original version of the bot for Minecraft 1.8.9, rebuilt for 1.12.2 onwards. 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).

View File

@@ -1,6 +1,6 @@
# Installation # Installation
The easiest way to install Baritone is to install it as Forge/Neoforge/Fabric mod, but if you know how you can also use with a custom `version.json` The easiest way to install Baritone is to install it as Forge/Neoforge/Fabric mod, but if you know how you can also use it with a custom `version.json`
(Examples: [1.14.4](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1), [1.15.2](https://www.dropbox.com/s/8rx6f0kts9hvd4f/1.15.2-Baritone.zip?dl=1), [1.16.5](https://www.dropbox.com/s/i6f292o2i7o9acp/1.16.5-Baritone.zip?dl=1)). (Examples: [1.14.4](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1), [1.15.2](https://www.dropbox.com/s/8rx6f0kts9hvd4f/1.15.2-Baritone.zip?dl=1), [1.16.5](https://www.dropbox.com/s/i6f292o2i7o9acp/1.16.5-Baritone.zip?dl=1)).
Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it. Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it.
@@ -10,10 +10,10 @@ Releases are made rarely and are not always up to date with the latest features
Link to the releases page: [Releases](https://github.com/cabaletta/baritone/releases) Link to the releases page: [Releases](https://github.com/cabaletta/baritone/releases)
The mapping between major Minecraft versions and major Baritone versions is as follows The mapping between Minecraft versions and major Baritone versions is as follows
| Minecraft version | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19 | 1.20 | 1.21 | | 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 |
|-------------------|------|------|------|------|------|------|------|------|-------|-------| |-------------------|------|------|------|------|------|------|------|------|-------|-------|--------|--------|------------------|
| Baritone version | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 | v1.11 | | 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 |
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`. 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`.
@@ -56,7 +56,7 @@ The recommended Java versions by Minecraft version are
| 1.12.2 - 1.16.5 | 8 | | 1.12.2 - 1.16.5 | 8 |
| 1.17.1 | 16 | | 1.17.1 | 16 |
| 1.18.2 - 1.20.4 | 17 | | 1.18.2 - 1.20.4 | 17 |
| 1.20.5 - 1.21.4 | 21 | | 1.20.5 - 1.21.8 | 21 |
Download java: https://adoptium.net/ Download java: https://adoptium.net/

View File

@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx4G
mod_version=1.9.3 mod_version=1.9.5
maven_group=baritone maven_group=baritone
archives_base_name=baritone archives_base_name=baritone

View File

@@ -237,9 +237,9 @@ public final class Settings {
/** /**
* Blocks that Baritone will attempt to avoid (Used in avoidance) * Blocks that Baritone will attempt to avoid (Used in avoidance)
*/ */
public final Setting<List<Block>> blocksToAvoid = new Setting<>(new ArrayList<>( public final Setting<List<Block>> blocksToAvoid = new Setting<>(new ArrayList<>(List.of(
// Leave Empty by Default Blocks.TRIPWIRE
)); )));
/** /**
* Blocks that Baritone is not allowed to break * Blocks that Baritone is not allowed to break
@@ -1550,6 +1550,11 @@ public final class Settings {
*/ */
public final Setting<Boolean> elytraChatSpam = new Setting<>(false); public final Setting<Boolean> elytraChatSpam = new Setting<>(false);
/**
* Sneak when magma blocks are under feet
*/
public final Setting<Boolean> allowWalkOnMagmaBlocks = new Setting<>(false);
/** /**
* A map of lowercase setting field names to their respective setting * A map of lowercase setting field names to their respective setting
*/ */

View File

@@ -159,6 +159,26 @@ public class Rotation {
return newYaw; return newYaw;
} }
/**
* Gets the distance between a starting yaw and an offset yaw.
* Distance can be negative if the offset yaw is behind of the starting yaw.
*
* @param yaw The initial yaw
* @param offsetYaw The offset yaw
* @return The distance between the yaws
*/
public static float yawDistanceFromOffset(float yaw, float offsetYaw) {
if ((yaw > 0 ^ offsetYaw > 0) && ((yaw > 90 || yaw < -90) ^ (offsetYaw > 90 || offsetYaw < -90))) {
if (yaw < 0) {
return 360 + (yaw - offsetYaw);
} else {
return 360 - (yaw - offsetYaw);
}
} else {
return yaw - offsetYaw;
}
}
@Override @Override
public String toString() { public String toString() {
return "Yaw: " + yaw + ", Pitch: " + pitch; return "Yaw: " + yaw + ", Pitch: " + pitch;

View File

@@ -78,7 +78,7 @@ public final class ChunkPacker {
for (int x = 0; x < 16; x++) { for (int x = 0; x < 16; x++) {
int index = CachedChunk.getPositionIndex(x, y, z); int index = CachedChunk.getPositionIndex(x, y, z);
BlockState state = bsc.get(x, y1, z); BlockState state = bsc.get(x, y1, z);
boolean[] bits = getPathingBlockType(state, chunk, x, y, z).getBits(); boolean[] bits = getPathingBlockType(state, chunk, x, y + chunk.getMinBuildHeight(), z).getBits();
bitSet.set(index, bits[0]); bitSet.set(index, bits[0]);
bitSet.set(index + 1, bits[1]); bitSet.set(index + 1, bits[1]);
Block block = state.getBlock(); Block block = state.getBlock();

View File

@@ -79,6 +79,7 @@ public class CalculationContext {
public double backtrackCostFavoringCoefficient; public double backtrackCostFavoringCoefficient;
public double jumpPenalty; public double jumpPenalty;
public final double walkOnWaterOnePenalty; public final double walkOnWaterOnePenalty;
public final boolean allowWalkOnMagmaBlocks;
public final BetterWorldBorder worldBorder; public final BetterWorldBorder worldBorder;
public final PrecomputedData precomputedData; public final PrecomputedData precomputedData;
@@ -125,6 +126,7 @@ public class CalculationContext {
this.backtrackCostFavoringCoefficient = Baritone.settings().backtrackCostFavoringCoefficient.value; this.backtrackCostFavoringCoefficient = Baritone.settings().backtrackCostFavoringCoefficient.value;
this.jumpPenalty = Baritone.settings().jumpPenalty.value; this.jumpPenalty = Baritone.settings().jumpPenalty.value;
this.walkOnWaterOnePenalty = Baritone.settings().walkOnWaterOnePenalty.value; this.walkOnWaterOnePenalty = Baritone.settings().walkOnWaterOnePenalty.value;
this.allowWalkOnMagmaBlocks = Baritone.settings().allowWalkOnMagmaBlocks.value;
// why cache these things here, why not let the movements just get directly from settings? // why cache these things here, why not let the movements just get directly from settings?
// because if some movements are calculated one way and others are calculated another way, // because if some movements are calculated one way and others are calculated another way,
// then you get a wildly inconsistent path that isn't optimal for either scenario. // then you get a wildly inconsistent path that isn't optimal for either scenario.

View File

@@ -31,6 +31,7 @@ import baritone.utils.BlockStateInterface;
import baritone.utils.ToolSet; import baritone.utils.ToolSet;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.Mth;
import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.piston.MovingPistonBlock; import net.minecraft.world.level.block.piston.MovingPistonBlock;
@@ -50,9 +51,9 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import java.util.List; import java.util.*;
import java.util.Optional;
import static baritone.api.utils.RotationUtils.DEG_TO_RAD_F;
import static baritone.pathing.movement.Movement.HORIZONTALS_BUT_ALSO_DOWN_____SO_EVERY_DIRECTION_EXCEPT_UP; import static baritone.pathing.movement.Movement.HORIZONTALS_BUT_ALSO_DOWN_____SO_EVERY_DIRECTION_EXCEPT_UP;
import static baritone.pathing.precompute.Ternary.*; import static baritone.pathing.precompute.Ternary.*;
@@ -140,7 +141,7 @@ public interface MovementHelper extends ActionCosts, Helper {
if (block instanceof AirBlock) { if (block instanceof AirBlock) {
return YES; return YES;
} }
if (block instanceof BaseFireBlock || block == Blocks.TRIPWIRE || block == Blocks.COBWEB || block == Blocks.END_PORTAL || block == Blocks.COCOA || block instanceof AbstractSkullBlock || block == Blocks.BUBBLE_COLUMN || block instanceof ShulkerBoxBlock || block instanceof SlabBlock || block instanceof TrapDoorBlock || block == Blocks.HONEY_BLOCK || block == Blocks.END_ROD || block == Blocks.SWEET_BERRY_BUSH || block == Blocks.POINTED_DRIPSTONE || block instanceof AmethystClusterBlock || block instanceof AzaleaBlock) { if (block instanceof BaseFireBlock || block == Blocks.COBWEB || block == Blocks.END_PORTAL || block == Blocks.COCOA || block instanceof AbstractSkullBlock || block == Blocks.BUBBLE_COLUMN || block instanceof ShulkerBoxBlock || block instanceof SlabBlock || block instanceof TrapDoorBlock || block == Blocks.HONEY_BLOCK || block == Blocks.END_ROD || block == Blocks.SWEET_BERRY_BUSH || block == Blocks.POINTED_DRIPSTONE || block instanceof AmethystClusterBlock || block instanceof AzaleaBlock) {
return NO; return NO;
} }
if (block == Blocks.BIG_DRIPLEAF) { if (block == Blocks.BIG_DRIPLEAF) {
@@ -384,7 +385,7 @@ public interface MovementHelper extends ActionCosts, Helper {
static boolean avoidWalkingInto(BlockState state) { static boolean avoidWalkingInto(BlockState state) {
Block block = state.getBlock(); Block block = state.getBlock();
return !state.getFluidState().isEmpty() return !state.getFluidState().isEmpty()
|| block == Blocks.MAGMA_BLOCK || (block == Blocks.MAGMA_BLOCK && !Baritone.settings().allowWalkOnMagmaBlocks.value)
|| block == Blocks.CACTUS || block == Blocks.CACTUS
|| block == Blocks.SWEET_BERRY_BUSH || block == Blocks.SWEET_BERRY_BUSH
|| block instanceof BaseFireBlock || block instanceof BaseFireBlock
@@ -420,7 +421,7 @@ public interface MovementHelper extends ActionCosts, Helper {
static Ternary canWalkOnBlockState(BlockState state) { static Ternary canWalkOnBlockState(BlockState state) {
Block block = state.getBlock(); Block block = state.getBlock();
if (isBlockNormalCube(state) && block != Blocks.MAGMA_BLOCK && block != Blocks.BUBBLE_COLUMN && block != Blocks.HONEY_BLOCK) { if (isBlockNormalCube(state) && (block != Blocks.MAGMA_BLOCK || Baritone.settings().allowWalkOnMagmaBlocks.value) && block != Blocks.BUBBLE_COLUMN && block != Blocks.HONEY_BLOCK) {
return YES; return YES;
} }
if (block instanceof AzaleaBlock) { if (block instanceof AzaleaBlock) {
@@ -658,6 +659,43 @@ public interface MovementHelper extends ActionCosts, Helper {
)).setInput(Input.MOVE_FORWARD, true); )).setInput(Input.MOVE_FORWARD, true);
} }
static void moveTowardsWithoutRotation(IPlayerContext ctx, MovementState state, float idealYaw) {
MovementOption.getOptions(
Mth.sin(ctx.playerRotations().getYaw() * DEG_TO_RAD_F),
Mth.cos(ctx.playerRotations().getYaw() * DEG_TO_RAD_F),
Baritone.settings().allowSprint.value
).min(Comparator.comparing(option -> option.distanceToSq(
Mth.sin(idealYaw * DEG_TO_RAD_F),
Mth.cos(idealYaw * DEG_TO_RAD_F)
))).ifPresent(selection -> selection.setInputs(state));
}
static void moveTowardsWithoutRotation(IPlayerContext ctx, MovementState state, BlockPos dest) {
float idealYaw = RotationUtils.calcRotationFromVec3d(
ctx.playerHead(),
VecUtils.getBlockPosCenter(dest),
ctx.playerRotations()
).getYaw();
moveTowardsWithoutRotation(ctx, state, idealYaw);
}
static void moveTowardsWithSlightRotation(IPlayerContext ctx, MovementState state, BlockPos dest) {
float idealYaw = RotationUtils.calcRotationFromVec3d(
ctx.playerHead(),
VecUtils.getBlockPosCenter(dest),
ctx.playerRotations()
).getYaw();
float distance = Rotation.yawDistanceFromOffset(ctx.playerRotations().getYaw(), idealYaw) % 45f;
float newYaw = distance > 0f ?
distance > 22.5f ? distance - 45f : distance :
distance < -22.5f ? distance + 45f : distance;
state.setTarget(new MovementTarget(new Rotation(
ctx.playerRotations().getYaw() - newYaw,
ctx.playerRotations().getPitch()
), true));
moveTowardsWithoutRotation(ctx, state, idealYaw);
}
/** /**
* Returns whether or not the specified block is * Returns whether or not the specified block is
* water, regardless of whether or not it is flowing. * water, regardless of whether or not it is flowing.
@@ -777,7 +815,7 @@ public interface MovementHelper extends ActionCosts, Helper {
if (ctx.getSelectedBlock().isPresent()) { if (ctx.getSelectedBlock().isPresent()) {
BlockPos selectedBlock = ctx.getSelectedBlock().get(); BlockPos selectedBlock = ctx.getSelectedBlock().get();
Direction side = ((BlockHitResult) ctx.objectMouseOver()).getDirection(); Direction side = ((BlockHitResult) ctx.objectMouseOver()).getDirection();
// only way for selectedBlock.equals(placeAt) to be true is if it's replacable // only way for selectedBlock.equals(placeAt) to be true is if it's replaceable
if (selectedBlock.equals(placeAt) || (MovementHelper.canPlaceAgainst(ctx, selectedBlock) && selectedBlock.relative(side).equals(placeAt))) { if (selectedBlock.equals(placeAt) || (MovementHelper.canPlaceAgainst(ctx, selectedBlock) && selectedBlock.relative(side).equals(placeAt))) {
if (wouldSneak) { if (wouldSneak) {
state.setInput(Input.SNEAK, true); state.setInput(Input.SNEAK, true);
@@ -806,4 +844,16 @@ public interface MovementHelper extends ActionCosts, Helper {
b == Blocks.LAVA || b == Blocks.LAVA ||
b == Blocks.WATER; b == Blocks.WATER;
} }
static List<BetterBlockPos> steppingOnBlocks(IPlayerContext ctx) {
List<BetterBlockPos> blocks = new ArrayList<>();
for (byte x = -1; x <= 1; x++) {
for (byte z = -1; z <= 1; z++) {
if (ctx.player().getBoundingBox().intersects(Vec3.atLowerCornerOf(ctx.player().blockPosition()).add(x, 0, z), Vec3.atLowerCornerOf(ctx.player().blockPosition()).add(x + 1, 1, z + 1))) {
blocks.add(new BetterBlockPos(ctx.player().getBlockX() + x, ctx.player().getBlockY() - 1, ctx.player().getBlockZ() + z));
}
}
}
return blocks;
}
} }

View File

@@ -0,0 +1,57 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.pathing.movement;
import baritone.api.utils.input.Input;
import net.minecraft.util.Mth;
import java.util.stream.Stream;
public record MovementOption(Input input1, Input input2, float motionX, float motionZ) {
private static final float SPRINT_MULTIPLIER = 1.3f;
public MovementOption(Input input1, float motionX, float motionZ) {
this(input1, null, motionX, motionZ);
}
public void setInputs(MovementState movementState) {
if (input1 != null) {
movementState.setInput(input1, true);
}
if (input2 != null) {
movementState.setInput(input2, true);
}
}
public float distanceToSq(float otherX, float otherZ) {
return Mth.abs(motionX() - otherX) + Mth.abs(motionZ() - otherZ);
}
public static Stream<MovementOption> getOptions(float motionX, float motionZ, boolean canSprint) {
return Stream.of(
new MovementOption(Input.MOVE_FORWARD, canSprint ? motionX * SPRINT_MULTIPLIER : motionX, canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ),
new MovementOption(Input.MOVE_BACK, -motionX, -motionZ),
new MovementOption(Input.MOVE_LEFT, -motionZ, motionX),
new MovementOption(Input.MOVE_RIGHT, motionZ, -motionX),
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_LEFT, (canSprint ? motionX * SPRINT_MULTIPLIER : motionX) - motionZ, (canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ) + motionX),
new MovementOption(Input.MOVE_FORWARD, Input.MOVE_RIGHT, (canSprint ? motionX * SPRINT_MULTIPLIER : motionX) + motionZ, (canSprint ? motionZ * SPRINT_MULTIPLIER : motionZ) - motionX),
new MovementOption(Input.MOVE_BACK, Input.MOVE_LEFT, -motionX - motionZ, -motionZ + motionX),
new MovementOption(Input.MOVE_BACK, Input.MOVE_RIGHT, -motionX + motionZ, -motionZ - motionX)
);
}
}

View File

@@ -131,8 +131,10 @@ public class MovementAscend extends Movement {
} }
} else { } else {
// jumpingFromBottomSlab must be false // jumpingFromBottomSlab must be false
if (toPlace.getBlock() == Blocks.SOUL_SAND) { if (toPlace.is(Blocks.SOUL_SAND)) {
walk = WALK_ONE_OVER_SOUL_SAND_COST; walk = WALK_ONE_OVER_SOUL_SAND_COST;
} else if (toPlace.is(Blocks.MAGMA_BLOCK)) {
walk = SNEAK_ONE_BLOCK_COST;
} else { } else {
walk = Math.max(JUMP_ONE_BLOCK_COST, WALK_ONE_BLOCK_COST); walk = Math.max(JUMP_ONE_BLOCK_COST, WALK_ONE_BLOCK_COST);
} }
@@ -188,6 +190,9 @@ public class MovementAscend extends Movement {
return state; return state;
} }
MovementHelper.moveTowards(ctx, state, dest); MovementHelper.moveTowards(ctx, state, dest);
state.setInput(Input.SNEAK, Baritone.settings().allowWalkOnMagmaBlocks.value && jumpingOnto.is(Blocks.MAGMA_BLOCK));
if (MovementHelper.isBottomSlab(jumpingOnto) && !MovementHelper.isBottomSlab(BlockStateInterface.get(ctx, src.below()))) { if (MovementHelper.isBottomSlab(jumpingOnto) && !MovementHelper.isBottomSlab(BlockStateInterface.get(ctx, src.below()))) {
return state; // don't jump while walking from a non double slab into a bottom slab return state; // don't jump while walking from a non double slab into a bottom slab
} }

View File

@@ -17,6 +17,7 @@
package baritone.pathing.movement.movements; package baritone.pathing.movement.movements;
import baritone.Baritone;
import baritone.api.IBaritone; import baritone.api.IBaritone;
import baritone.api.pathing.movement.MovementStatus; import baritone.api.pathing.movement.MovementStatus;
import baritone.api.utils.BetterBlockPos; import baritone.api.utils.BetterBlockPos;
@@ -255,6 +256,9 @@ public class MovementDescend extends Movement {
double x = ctx.player().position().x - (src.getX() + 0.5); double x = ctx.player().position().x - (src.getX() + 0.5);
double z = ctx.player().position().z - (src.getZ() + 0.5); double z = ctx.player().position().z - (src.getZ() + 0.5);
double fromStart = Math.sqrt(x * x + z * z); double fromStart = Math.sqrt(x * x + z * z);
state.setInput(Input.SNEAK, Baritone.settings().allowWalkOnMagmaBlocks.value && ctx.world().getBlockState(ctx.player().blockPosition().below()).is(Blocks.MAGMA_BLOCK));
if (!playerFeet.equals(dest) || ab > 0.25) { if (!playerFeet.equals(dest) || ab > 0.25) {
if (numTicks++ < 20 && fromStart < 1.25) { if (numTicks++ < 20 && fromStart < 1.25) {
MovementHelper.moveTowards(ctx, state, fakeDest); MovementHelper.moveTowards(ctx, state, fakeDest);

View File

@@ -118,6 +118,7 @@ public class MovementDiagonal extends Movement {
BlockState destWalkOn; BlockState destWalkOn;
boolean descend = false; boolean descend = false;
boolean frostWalker = false; boolean frostWalker = false;
boolean sneaking = false;
if (!MovementHelper.canWalkThrough(context, destX, y, destZ, destInto)) { if (!MovementHelper.canWalkThrough(context, destX, y, destZ, destInto)) {
ascend = true; ascend = true;
if (!context.allowDiagonalAscend || !MovementHelper.canWalkThrough(context, x, y + 2, z) || !MovementHelper.canWalkOn(context, destX, y, destZ, destInto) || !MovementHelper.canWalkThrough(context, destX, y + 2, destZ)) { if (!context.allowDiagonalAscend || !MovementHelper.canWalkThrough(context, x, y + 2, z) || !MovementHelper.canWalkOn(context, destX, y, destZ, destInto) || !MovementHelper.canWalkThrough(context, destX, y + 2, destZ)) {
@@ -140,8 +141,11 @@ public class MovementDiagonal extends Movement {
} }
double multiplier = WALK_ONE_BLOCK_COST; double multiplier = WALK_ONE_BLOCK_COST;
// For either possible soul sand, that affects half of our walking // For either possible soul sand, that affects half of our walking
if (destWalkOn.getBlock() == Blocks.SOUL_SAND) { if (destWalkOn.is(Blocks.SOUL_SAND)) {
multiplier += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2; multiplier += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2;
} else if (context.allowWalkOnMagmaBlocks && destWalkOn.is(Blocks.MAGMA_BLOCK)) {
multiplier += (SNEAK_ONE_BLOCK_COST - WALK_ONE_BLOCK_COST) / 2;
sneaking = true;
} else if (frostWalker) { } else if (frostWalker) {
// frostwalker lets us walk on water without the penalty // frostwalker lets us walk on water without the penalty
} else if (destWalkOn.getBlock() == Blocks.WATER) { } else if (destWalkOn.getBlock() == Blocks.WATER) {
@@ -153,13 +157,16 @@ public class MovementDiagonal extends Movement {
} }
if (fromDownBlock == Blocks.SOUL_SAND) { if (fromDownBlock == Blocks.SOUL_SAND) {
multiplier += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2; multiplier += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2;
} else if (context.allowWalkOnMagmaBlocks && fromDownBlock.equals(Blocks.MAGMA_BLOCK)) {
multiplier += (SNEAK_ONE_BLOCK_COST - WALK_ONE_BLOCK_COST) / 2;
sneaking = true;
} }
BlockState cuttingOver1 = context.get(x, y - 1, destZ); BlockState cuttingOver1 = context.get(x, y - 1, destZ);
if (cuttingOver1.getBlock() == Blocks.MAGMA_BLOCK || MovementHelper.isLava(cuttingOver1)) { if ((!context.allowWalkOnMagmaBlocks && cuttingOver1.is(Blocks.MAGMA_BLOCK)) || MovementHelper.isLava(cuttingOver1)) {
return; return;
} }
BlockState cuttingOver2 = context.get(destX, y - 1, z); BlockState cuttingOver2 = context.get(destX, y - 1, z);
if (cuttingOver2.getBlock() == Blocks.MAGMA_BLOCK || MovementHelper.isLava(cuttingOver2)) { if ((!context.allowWalkOnMagmaBlocks && cuttingOver1.is(Blocks.MAGMA_BLOCK)) || MovementHelper.isLava(cuttingOver2)) {
return; return;
} }
boolean water = false; boolean water = false;
@@ -234,7 +241,7 @@ public class MovementDiagonal extends Movement {
} }
} else { } else {
// only can sprint if not edging around // only can sprint if not edging around
if (context.canSprint && !water) { if (context.canSprint && !water && !sneaking) {
// If we aren't edging around anything, and we aren't in water // If we aren't edging around anything, and we aren't in water
// We can sprint =D // We can sprint =D
// Don't check for soul sand, since we can sprint on that too // Don't check for soul sand, since we can sprint on that too
@@ -270,6 +277,7 @@ public class MovementDiagonal extends Movement {
if (sprint()) { if (sprint()) {
state.setInput(Input.SPRINT, true); state.setInput(Input.SPRINT, true);
} }
state.setInput(Input.SNEAK, Baritone.settings().allowWalkOnMagmaBlocks.value && MovementHelper.steppingOnBlocks(ctx).stream().anyMatch(block -> ctx.world().getBlockState(block).is(Blocks.MAGMA_BLOCK)));
MovementHelper.moveTowards(ctx, state, dest); MovementHelper.moveTowards(ctx, state, dest);
return state; return state;
} }

View File

@@ -94,6 +94,11 @@ public class MovementFall extends Movement {
Rotation targetRotation = null; Rotation targetRotation = null;
BlockState destState = ctx.world().getBlockState(dest); BlockState destState = ctx.world().getBlockState(dest);
Block destBlock = destState.getBlock(); Block destBlock = destState.getBlock();
if (ctx.world().getBlockState(dest.below()).is(Blocks.MAGMA_BLOCK) && MovementHelper.steppingOnBlocks(ctx).stream().allMatch(block -> MovementHelper.canWalkThrough(ctx, block))) {
state.setInput(Input.SNEAK, true);
}
boolean isWater = destState.getFluidState().getType() instanceof WaterFluid; boolean isWater = destState.getFluidState().getType() instanceof WaterFluid;
if (!isWater && willPlaceBucket() && !playerFeet.equals(dest)) { if (!isWater && willPlaceBucket() && !playerFeet.equals(dest)) {
if (!Inventory.isHotbarSlot(ctx.player().getInventory().findSlotMatchingItem(STACK_BUCKET_WATER)) || ctx.world().dimension() == Level.NETHER) { if (!Inventory.isHotbarSlot(ctx.player().getInventory().findSlotMatchingItem(STACK_BUCKET_WATER)) || ctx.world().dimension() == Level.NETHER) {

View File

@@ -102,14 +102,14 @@ public class MovementParkour extends Movement {
return; // can't jump out of water return; // can't jump out of water
} }
int maxJump; int maxJump;
if (standingOn.getBlock() == Blocks.SOUL_SAND) { if (context.allowWalkOnMagmaBlocks && standingOn.is(Blocks.MAGMA_BLOCK)) {
maxJump = 2;
} else if (standingOn.getBlock() == Blocks.SOUL_SAND) {
maxJump = 2; // 1 block gap maxJump = 2; // 1 block gap
} else if (context.canSprint) {
maxJump = 4;
} else { } else {
if (context.canSprint) { maxJump = 3;
maxJump = 4;
} else {
maxJump = 3;
}
} }
// check parkour jumps from smallest to largest for obstacles/walls and landing positions // check parkour jumps from smallest to largest for obstacles/walls and landing positions
@@ -262,6 +262,10 @@ public class MovementParkour extends Movement {
if (dist >= 4 || ascend) { if (dist >= 4 || ascend) {
state.setInput(Input.SPRINT, true); state.setInput(Input.SPRINT, true);
} }
if (Baritone.settings().allowWalkOnMagmaBlocks.value && ctx.world().getBlockState(ctx.playerFeet().below()).is(Blocks.MAGMA_BLOCK)) {
state.setInput(Input.SNEAK, true);
}
MovementHelper.moveTowards(ctx, state, dest); MovementHelper.moveTowards(ctx, state, dest);
if (ctx.playerFeet().equals(dest)) { if (ctx.playerFeet().equals(dest)) {
Block d = BlockStateInterface.getBlock(ctx, dest); Block d = BlockStateInterface.getBlock(ctx, dest);

View File

@@ -229,8 +229,7 @@ public class MovementPillar extends Movement {
return state.setStatus(MovementStatus.UNREACHABLE); return state.setStatus(MovementStatus.UNREACHABLE);
} }
state.setInput(Input.SNEAK, true);
state.setInput(Input.SNEAK, ctx.player().position().y > dest.getY() || ctx.player().position().y < src.getY() + 0.2D); // delay placement by 1 tick for ncp compatibility
// since (lower down) we only right click once player.isSneaking, and that happens the tick after we request to sneak // since (lower down) we only right click once player.isSneaking, and that happens the tick after we request to sneak
double diffX = ctx.player().position().x - (dest.getX() + 0.5); double diffX = ctx.player().position().x - (dest.getX() + 0.5);

View File

@@ -85,6 +85,7 @@ public class MovementTraverse extends Movement {
if (frostWalker || MovementHelper.canWalkOn(context, destX, y - 1, destZ, destOn)) { //this is a walk, not a bridge if (frostWalker || MovementHelper.canWalkOn(context, destX, y - 1, destZ, destOn)) { //this is a walk, not a bridge
double WC = WALK_ONE_BLOCK_COST; double WC = WALK_ONE_BLOCK_COST;
boolean water = false; boolean water = false;
boolean sneaking = false;
if (MovementHelper.isWater(pb0) || MovementHelper.isWater(pb1)) { if (MovementHelper.isWater(pb0) || MovementHelper.isWater(pb1)) {
WC = context.waterWalkSpeed; WC = context.waterWalkSpeed;
water = true; water = true;
@@ -98,6 +99,9 @@ public class MovementTraverse extends Movement {
} }
if (srcDownBlock == Blocks.SOUL_SAND) { if (srcDownBlock == Blocks.SOUL_SAND) {
WC += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2; WC += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2;
} else if (context.allowWalkOnMagmaBlocks && srcDownBlock.equals(Blocks.MAGMA_BLOCK)) {
sneaking = true;
WC += (SNEAK_ONE_BLOCK_COST - WALK_ONE_BLOCK_COST) / 2;
} }
} }
double hardness1 = MovementHelper.getMiningDurationTicks(context, destX, y, destZ, pb1, false); double hardness1 = MovementHelper.getMiningDurationTicks(context, destX, y, destZ, pb1, false);
@@ -106,7 +110,7 @@ public class MovementTraverse extends Movement {
} }
double hardness2 = MovementHelper.getMiningDurationTicks(context, destX, y + 1, destZ, pb0, true); // only include falling on the upper block to break double hardness2 = MovementHelper.getMiningDurationTicks(context, destX, y + 1, destZ, pb0, true); // only include falling on the upper block to break
if (hardness1 == 0 && hardness2 == 0) { if (hardness1 == 0 && hardness2 == 0) {
if (!water && context.canSprint) { if (!water && !sneaking && context.canSprint) {
// If there's nothing in the way, and this isn't water, and we aren't sneak placing // If there's nothing in the way, and this isn't water, and we aren't sneak placing
// We can sprint =D // We can sprint =D
// Don't check for soul sand, since we can sprint on that too // Don't check for soul sand, since we can sprint on that too
@@ -213,12 +217,12 @@ public class MovementTraverse extends Movement {
.setInput(Input.SPRINT, true); .setInput(Input.SPRINT, true);
} }
//sneak may have been set to true in the PREPPING state while mining an adjacent block
state.setInput(Input.SNEAK, false);
Block fd = BlockStateInterface.get(ctx, src.below()).getBlock(); Block fd = BlockStateInterface.get(ctx, src.below()).getBlock();
boolean ladder = fd == Blocks.LADDER || fd == Blocks.VINE; boolean ladder = fd == Blocks.LADDER || fd == Blocks.VINE;
//sneak may have been set to true in the PREPPING state while mining an adjacent block, but we still want it to be true if the player is about to go on magma
state.setInput(Input.SNEAK, Baritone.settings().allowWalkOnMagmaBlocks.value && MovementHelper.steppingOnBlocks(ctx).stream().anyMatch(block -> ctx.world().getBlockState(block).is(Blocks.MAGMA_BLOCK)));
if (pb0.getBlock() instanceof DoorBlock || pb1.getBlock() instanceof DoorBlock) { if (pb0.getBlock() instanceof DoorBlock || pb1.getBlock() instanceof DoorBlock) {
boolean notPassable = pb0.getBlock() instanceof DoorBlock && !MovementHelper.isDoorPassable(ctx, src, dest) || pb1.getBlock() instanceof DoorBlock && !MovementHelper.isDoorPassable(ctx, dest, src); boolean notPassable = pb0.getBlock() instanceof DoorBlock && !MovementHelper.isDoorPassable(ctx, src, dest) || pb1.getBlock() instanceof DoorBlock && !MovementHelper.isDoorPassable(ctx, dest, src);
boolean canOpen = !(Blocks.IRON_DOOR.equals(pb0.getBlock()) || Blocks.IRON_DOOR.equals(pb1.getBlock())); boolean canOpen = !(Blocks.IRON_DOOR.equals(pb0.getBlock()) || Blocks.IRON_DOOR.equals(pb1.getBlock()));
@@ -296,7 +300,7 @@ public class MovementTraverse extends Movement {
} }
} }
double dist1 = Math.max(Math.abs(ctx.player().position().x - (dest.getX() + 0.5D)), Math.abs(ctx.player().position().z - (dest.getZ() + 0.5D))); double dist1 = Math.max(Math.abs(ctx.player().position().x - (dest.getX() + 0.5D)), Math.abs(ctx.player().position().z - (dest.getZ() + 0.5D)));
PlaceResult p = MovementHelper.attemptToPlaceABlock(state, baritone, dest.below(), false, true); PlaceResult p = MovementHelper.attemptToPlaceABlock(state, baritone, dest.below(), false, !Baritone.settings().assumeSafeWalk.value);
if ((p == PlaceResult.READY_TO_PLACE || dist1 < 0.6) && !Baritone.settings().assumeSafeWalk.value) { if ((p == PlaceResult.READY_TO_PLACE || dist1 < 0.6) && !Baritone.settings().assumeSafeWalk.value) {
state.setInput(Input.SNEAK, true); state.setInput(Input.SNEAK, true);
} }
@@ -352,9 +356,8 @@ public class MovementTraverse extends Movement {
} }
return state; return state;
} }
MovementHelper.moveTowards(ctx, state, positionsToBreak[0]); MovementHelper.moveTowardsWithSlightRotation(ctx, state, dest);
return state; return state;
// TODO MovementManager.moveTowardsBlock(to); // move towards not look at because if we are bridging for a couple blocks in a row, it is faster if we dont spin around and walk forwards then spin around and place backwards for every block
} }
} }

View File

@@ -22,46 +22,45 @@ import baritone.utils.BlockStateInterface;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import static baritone.pathing.precompute.Ternary.MAYBE;
import static baritone.pathing.precompute.Ternary.YES;
public class PrecomputedData { public class PrecomputedData {
private final int[] data = new int[Block.BLOCK_STATE_REGISTRY.size()]; private final byte[] data = new byte[Block.BLOCK_STATE_REGISTRY.size()];
private static final int COMPLETED_MASK = 1 << 0; /**
private static final int CAN_WALK_ON_MASK = 1 << 1; * byte layout
private static final int CAN_WALK_ON_SPECIAL_MASK = 1 << 2; *
private static final int CAN_WALK_THROUGH_MASK = 1 << 3; * 7 6 5 4 3 2 1 0
private static final int CAN_WALK_THROUGH_SPECIAL_MASK = 1 << 4; * | | | | | | | |
private static final int FULLY_PASSABLE_MASK = 1 << 5; * unused canWalkOn maybe canWalkThrough maybe fullyPassable maybe completed
private static final int FULLY_PASSABLE_SPECIAL_MASK = 1 << 6; */
private static final byte COMPLETED_MASK = (byte) 1 << 0;
private static final byte FULLY_PASSABLE_MAYBE_MASK = (byte) 1 << 1;
private static final byte FULLY_PASSABLE_MASK = (byte) 1 << 2;
private static final byte CAN_WALK_THROUGH_MAYBE_MASK = (byte) 1 << 3;
private static final byte CAN_WALK_THROUGH_MASK = (byte) 1 << 4;
private static final byte CAN_WALK_ON_MAYBE_MASK = (byte) 1 << 5;
private static final byte CAN_WALK_ON_MASK = (byte) 1 << 6;
private int fillData(int id, BlockState state) { private int fillData(int id, BlockState state) {
int blockData = 0; byte blockData = 0;
Ternary canWalkOnState = MovementHelper.canWalkOnBlockState(state); Ternary canWalkOnState = MovementHelper.canWalkOnBlockState(state);
if (canWalkOnState == YES) { switch (canWalkOnState) {
blockData |= CAN_WALK_ON_MASK; case YES -> blockData |= CAN_WALK_ON_MASK;
} case MAYBE -> blockData |= CAN_WALK_ON_MAYBE_MASK;
if (canWalkOnState == MAYBE) {
blockData |= CAN_WALK_ON_SPECIAL_MASK;
} }
Ternary canWalkThroughState = MovementHelper.canWalkThroughBlockState(state); Ternary canWalkThroughState = MovementHelper.canWalkThroughBlockState(state);
if (canWalkThroughState == YES) { switch (canWalkThroughState) {
blockData |= CAN_WALK_THROUGH_MASK; case YES -> blockData |= CAN_WALK_THROUGH_MASK;
} case MAYBE -> blockData |= CAN_WALK_THROUGH_MAYBE_MASK;
if (canWalkThroughState == MAYBE) {
blockData |= CAN_WALK_THROUGH_SPECIAL_MASK;
} }
Ternary fullyPassableState = MovementHelper.fullyPassableBlockState(state); Ternary fullyPassableState = MovementHelper.fullyPassableBlockState(state);
if (fullyPassableState == YES) { switch (fullyPassableState) {
blockData |= FULLY_PASSABLE_MASK; case YES -> blockData |= FULLY_PASSABLE_MASK;
} case MAYBE -> blockData |= FULLY_PASSABLE_MAYBE_MASK;
if (fullyPassableState == MAYBE) {
blockData |= FULLY_PASSABLE_SPECIAL_MASK;
} }
blockData |= COMPLETED_MASK; blockData |= COMPLETED_MASK;
@@ -78,7 +77,7 @@ public class PrecomputedData {
blockData = fillData(id, state); blockData = fillData(id, state);
} }
if ((blockData & CAN_WALK_ON_SPECIAL_MASK) != 0) { if ((blockData & CAN_WALK_ON_MAYBE_MASK) != 0) {
return MovementHelper.canWalkOnPosition(bsi, x, y, z, state); return MovementHelper.canWalkOnPosition(bsi, x, y, z, state);
} else { } else {
return (blockData & CAN_WALK_ON_MASK) != 0; return (blockData & CAN_WALK_ON_MASK) != 0;
@@ -93,7 +92,7 @@ public class PrecomputedData {
blockData = fillData(id, state); blockData = fillData(id, state);
} }
if ((blockData & CAN_WALK_THROUGH_SPECIAL_MASK) != 0) { if ((blockData & CAN_WALK_THROUGH_MAYBE_MASK) != 0) {
return MovementHelper.canWalkThroughPosition(bsi, x, y, z, state); return MovementHelper.canWalkThroughPosition(bsi, x, y, z, state);
} else { } else {
return (blockData & CAN_WALK_THROUGH_MASK) != 0; return (blockData & CAN_WALK_THROUGH_MASK) != 0;
@@ -108,7 +107,7 @@ public class PrecomputedData {
blockData = fillData(id, state); blockData = fillData(id, state);
} }
if ((blockData & FULLY_PASSABLE_SPECIAL_MASK) != 0) { if ((blockData & FULLY_PASSABLE_MAYBE_MASK) != 0) {
return MovementHelper.fullyPassablePosition(bsi, x, y, z, state); return MovementHelper.fullyPassablePosition(bsi, x, y, z, state);
} else { } else {
return (blockData & FULLY_PASSABLE_MASK) != 0; return (blockData & FULLY_PASSABLE_MASK) != 0;