Compare commits

..

296 Commits

Author SHA1 Message Date
Leijurv
53adf80540 deprecate 1.14.4 2022-02-02 00:13:57 -08:00
Leijurv
ffd7d7a23a Merge pull request #3067 from wagyourtail/collisionShapeFix
fix Null params on getCollisionShape causing NPEs
2022-02-01 23:55:01 -08:00
Wagyourtail
08c00b8a42 surround with try/catch 2021-11-03 13:04:51 -06:00
Leijurv
c37cdf78e4 Merge branch '1.13.2' into 1.14.4 2021-02-02 17:09:18 -08:00
Leijurv
6a1f716dc8 Merge branch 'master' into 1.13.2 2021-02-02 17:09:06 -08:00
Leijurv
331a7f3842 Merge pull request #2407 from DifferentPerson/master
Fix SpongePowered Maven repo URL
2021-02-02 16:06:48 -08:00
DifferentPerson
25de16e051 Fix SpongePowered Maven repo URL
SpongePowered recently changed their Maven repo URL, so this is the right one
2021-01-31 15:55:52 -08:00
Leijurv
a732e766f4 crucial performance optimization 2021-01-30 17:22:19 -08:00
Leijurv
bb75e68b0a Merge branch '1.13.2' into 1.14.4 2021-01-29 21:13:33 -08:00
Leijurv
e9b9977674 Merge branch 'master' into 1.13.2 2021-01-29 21:13:12 -08:00
Leijurv
91854f97ad fully remove remnants of xvfb 2021-01-29 21:12:44 -08:00
Leijurv
eae6e4d804 fake merge of 1.13.2 into 1.14.4 due to reformatting conflicts 2021-01-29 20:28:32 -08:00
Leijurv
37cd50d435 a long overdue reformat of every file 2021-01-29 20:28:11 -08:00
Leijurv
3f65d46e12 fake merge of master into 1.13.2 due to reformatting conflicts 2021-01-29 20:26:22 -08:00
Leijurv
15fd313757 a long overdue reformat of every file 2021-01-29 20:26:06 -08:00
Leijurv
835fb3471f a long overdue reformat of every file 2021-01-29 20:17:53 -08:00
Leijurv
4c9689fe19 Merge branch '1.13.2' into 1.14.4 2021-01-29 19:49:11 -08:00
Leijurv
f41c873852 Merge branch 'master' into 1.13.2 2021-01-29 19:31:16 -08:00
Leijurv
eb8a673165 Merge branch 'master' into 1.13.2 2021-01-29 19:30:56 -08:00
Leijurv
a9f497981f Merge pull request #2080 from millennIumAMbiguity/master
Added range argument to farm
2021-01-29 17:41:08 -08:00
Leijurv
74dd88d123 Merge pull request #2359 from stragulus/build-with-forge-instructions
Add instructions to build with forge for minecraft 1.15+
2021-01-29 17:37:43 -08:00
Leijurv
b94494d386 Merge pull request #2357 from ZacSharp/builderMaterialLogging
Log blocks the builder can't place (missing or obstructed by flowing liquid) when failing
2021-01-26 23:28:45 -08:00
Leijurv
974b19fcc7 Merge pull request #2378 from ZacSharp/patch-1
Correct usage for mining a specific amount
2021-01-26 23:24:07 -08:00
ZacSharp
364b7b5438 Correct usage for mining a specific amount
Found and fixed by @CesiumCs
2021-01-21 15:39:37 +01:00
Bram Avontuur
0222c47113 Typo fix 2021-01-17 11:40:52 -05:00
Bram Avontuur
33d007eea5 Add instructions to build with forge for minecraft 1.15+ 2021-01-16 11:34:12 -05:00
ZacSharp
79e0f4ba23 Log blocks it can't place 2021-01-15 12:52:38 +01:00
Leijurv
72cf9392b1 Update README.md 2020-12-24 21:34:02 -08:00
Leijurv
b6265036d4 Update README.md 2020-12-24 21:33:29 -08:00
Leijurv
dc70d810c9 Update README.md 2020-12-24 21:33:11 -08:00
Leijurv
16cfcb36a3 Update USAGE.md 2020-11-29 20:04:44 -08:00
Leijurv
6bec994a57 Merge pull request #2185 from unrootexe/master
Update rootNET's supported version
2020-11-19 23:56:45 -08:00
unrootexe
a99206b6c2 Update rootNET's supported version
rootNET supports the latest version of Baritone, this change reflects that
2020-11-16 17:18:32 +00:00
Leijurv
c491d67925 add setting to just skip layers that the builder fails to construct 2020-11-11 17:53:26 -08:00
millennIumAMbiguity
853b5ca771 Moved throw up into the default: 2020-11-02 01:44:12 +01:00
millennIumAMbiguity
f4706fff18 Simplified and optimised code 2020-11-02 01:25:25 +01:00
millennIumAMbiguity
7218a46211 Added defaults and javadocs 2020-11-02 00:33:31 +01:00
Leijurv
320a5d64a3 well i guess technically there could be an ore at bedrock level lmao 2020-10-30 22:39:30 -07:00
Leijurv
b16a8ecf21 Merge pull request #2079 from scorbett123/limitedMineDistance
add a minimum Y level during mining.
2020-10-30 22:35:26 -07:00
Leijurv
73265ef944 Merge pull request #2100 from GameCenterJerry/master
added jdk 8 instructions for macOS in SETUP.md
2020-10-30 22:28:57 -07:00
Leijurv
3bbc141e9a Merge pull request #2132 from ZacSharp/noForgeMod
don't make non-forge jars valid mods (fixes #2124)
2020-10-30 22:28:03 -07:00
ZacSharp
9ca95e8e14 don't make non-forge jars valid mods (fixes #2124) 2020-10-31 03:21:59 +01:00
Leijurv
6d51e10090 Merge pull request #1971 from krzys-h/fix-entity-follow-forge
Fix "#entity follow <name>" under Forge
2020-10-23 18:54:11 -07:00
GameCenterJerry
14b75973b0 Update SETUP.md 2020-10-22 15:02:17 +11:00
GameCenterJerry
0bfd0bca0c Update SETUP.md 2020-10-22 13:47:50 +11:00
GameCenterJerry
cafb810a1f Update SETUP.md 2020-10-22 13:28:18 +11:00
GameCenterJerry
07704b3ec7 Update SETUP.md 2020-10-22 13:14:53 +11:00
GameCenterJerry
7032efcc05 added jdk 8 instructions for macOS
added necessary commands and download links
2020-10-22 13:09:56 +11:00
millennIumAMbiguity
65a5677b33 Added the feature to only farm within range of a waypoint. 2020-10-22 00:36:19 +02:00
millennIumAMbiguity
5d3522ca0a Added range argument to farm 2020-10-16 23:32:53 +02:00
Sam Corbett
bfb530e02b add a minimum Y level.
Signed-off-by: Sam Corbett <sam@corbettchocolates.com>
2020-10-16 17:02:02 +01:00
Leijurv
5a5d11922f Merge pull request #1995 from scorbett123/exposedOres
add mineOnlyExposedOres setting
2020-10-14 12:01:49 -07:00
scorbett123
39cfebeb34 fix formatting
Signed-off-by: scorbett123 <sam@corbettchocolates.com>
2020-10-14 20:00:49 +01:00
Leijurv
950f47ccae Merge pull request #1958 from CDAGaming/feature/toasts
 Added Toast API Support
2020-10-14 11:18:09 -07:00
CDAGaming
d2c625e1c9 Apply Review Comments 2020-10-14 13:14:23 -05:00
Leijurv
3f207b7041 Merge pull request #2076 from CDAGaming/feature/rendering-compat-fix
🐛 Fix a Rendering Conflict with some other Mods
2020-10-14 11:09:00 -07:00
Leijurv
8deb9e5a35 Merge pull request #1959 from CDAGaming/feature/top-command
 Added a top/surface command
2020-10-14 11:02:07 -07:00
Leijurv
5eeb33a6f5 Merge pull request #1845 from mariusdkm/master
Fixing crash after clicking into the air using the #click command
2020-10-14 10:59:34 -07:00
CDAGaming
918f009e8a 🐛 Fix a Rendering Conflict with some other Mods
In testing within Fabritone, it was found that these two lines (Which were previously used for an unknown optifine workaround) are no longer needed, and had no known side effects as of writing.

This can be backported as needed, but details are unknown how far this can go down

Future me PS: This PR is a superseed of my last one, erased during repo refactors, so now it lives on master branch. Testing recommended and can be up-ported/down-ported as you wish.
2020-10-12 12:52:05 -05:00
CDAGaming
d6665f1cd5 Added Toast API Support
This adds in a logAsToast and toastTimer option, and is a minified form of Indrit's initial implementation previously used from fabritone
2020-10-12 12:46:01 -05:00
CDAGaming
af29ed7146 Added a top/surface command
Superseeds PR #594
2020-10-12 12:44:12 -05:00
Leijurv
8ddc795158 Merge pull request #2020 from ZacSharp/wpgoto
make `#wp goto` behave like `#wp goal` and `#path`
2020-09-29 16:55:50 -07:00
ZacSharp
8a572516fc Update description of WaypointsCommand 2020-09-23 22:54:41 +02:00
ZacSharp
508dacac63 directly start pathing after #home
just like servers directly teleport you after `/home` without waiting for something like `/teleport`
2020-09-18 22:41:33 +02:00
ZacSharp
13ca691f5d make #wp goto behave like #goto
It now is a combined `#wp goal` and `#path` just like `#goto` is `#goal` and `#path`
2020-09-16 20:19:55 +02:00
Leijurv
7e4d2c9b28 Update README.md 2020-09-15 12:43:34 -07:00
Brady
500c34c330 Merge pull request #2015 from babbaj/fix-troll-code
Don't call onLostControl on processes that haven't been fully constructed
2020-09-13 17:46:23 -05:00
Babbaj
234fd3f75e don't use getter 2020-09-13 18:45:50 -04:00
Babbaj
32ef30686b Don't call onLostControl on processes that haven't been fully constructed 2020-09-13 18:21:22 -04:00
Leijurv
175df6ce7a Update USAGE.md 2020-09-11 21:54:20 -07:00
Leijurv
96b874c099 Update README.md 2020-09-11 21:52:43 -07:00
Sam Corbett
612510550f fix javadoc.
Signed-off-by: Sam Corbett <sam@corbettchocolates.com>
2020-09-08 19:00:41 +01:00
Sam Corbett
80e4852f90 Merge https://github.com/cabaletta/baritone into exposedOres 2020-09-08 17:48:45 +01:00
Sam Corbett
071243b99a move is transparent to movement helper and circle maker 2020-09-08 17:47:46 +01:00
Sam Corbett
547db3a6b4 make the ability to turn it off.
Signed-off-by: Sam Corbett <sam@corbettchocolates.com>
2020-09-08 17:47:45 +01:00
scorbett123
063f698bd2 need to remove diagonals, however this does most of what you suggest.
Signed-off-by: scorbett123 <sam@corbettchocolates.com>
2020-09-08 17:47:45 +01:00
scorbett123
bcbfca100f add mineOnlyExposedOres setting
Signed-off-by: scorbett123 <sam@corbettchocolates.com>
2020-09-08 17:47:45 +01:00
Leijurv
8206b1673c Merge pull request #1988 from scorbett123/patch1
fix typo in java-doc x2
2020-09-07 13:18:52 -07:00
scorbett123
d7088c8eea fix typo in java-doc x2
Signed-off-by: scorbett123 <sam@corbettchocolates.com>
2020-08-31 18:48:46 +01:00
Leijurv
bf723deced Merge pull request #1964 from ZacSharp/master
Fix MovementDiagonal being safeToCancel while cornering over air 2.0
2020-08-24 16:20:01 -07:00
ZacSharp
9636e69a6b slightly better condition 2020-08-24 23:06:19 +02:00
krzys-h
ed91e2aa7b Fix "#entity follow <name>" under Forge
One of the Forge patches removes EntityList.REGISTRY and provides
the getClass method as a replacement.

The fix is based on a similar one I found in WorldDownloader

Closes #1376 (and duplicates: #1777 and #1815)
2020-08-24 22:24:18 +02:00
ZacSharp
3c691bb498 But now it's working 2020-08-20 23:33:47 +02:00
ZacSharp
ea35a3478f Codacity again for the same and syntax
dab
2020-08-20 23:16:59 +02:00
ZacSharp
b7d1ba1fa5 Make Codacity happy 2020-08-20 23:11:55 +02:00
ZacSharp
5f686c1c12 improve isSafeToCancel in MovementDiagonal even more
It did not return true early enough for backfill while cornering over air
2020-08-20 22:55:42 +02:00
Leijurv
4eea8308d7 Merge pull request #1956 from RealIndrit/patch-1
🔥 Get yeeted unused code
2020-08-18 11:14:25 -07:00
kuthy
7f9704592e Made catch function wide 2020-08-18 15:40:12 +02:00
RealIndrit
523f13c430 🔥 Get yeeted unused code
Removed an unused function that can't be used anyways, because RayTraceUtils cant detect entity hit...
2020-08-18 12:36:10 +02:00
Leijurv
1c8079c051 Merge pull request #1058 from ADShenoi/patch-1
The grammar mistakes were corrected
2020-08-17 16:40:56 -07:00
Leijurv
2abd024b3c Merge branch 'master' into patch-1 2020-08-17 16:40:41 -07:00
Leijurv
7992b63aae Merge pull request #1346 from aUniqueUser/master
Make desktop notifications more useful
2020-08-17 16:38:36 -07:00
Leijurv
836ef3328c Merge pull request #1541 from babbaj/keep-annotation
Annotation for proguard -keep
2020-08-17 16:36:48 -07:00
Leijurv
c470dc1a17 Merge pull request #1158 from c0nn3r/master
Create .gitmessage
2020-08-17 16:33:48 -07:00
Leijurv
97a1029a72 Merge pull request #1554 from ByteZ1337/master
Fixed Typo
2020-08-17 16:17:47 -07:00
Leijurv
5f9602796a Merge pull request #1876 from CorruptedSeal/master
Update ExecutionControlCommands.java
2020-08-17 16:17:01 -07:00
Leijurv
02e7886e77 properly set isSafeToCancel in MovementDiagonal, fixes #1788 2020-08-17 16:15:56 -07:00
Leijurv
9851623557 anti-indrit-cringe 2020-08-17 16:03:04 -07:00
Leijurv
f0d2bae3d1 Merge pull request #1947 from RealIndrit/master
Add auto tool setting
2020-08-17 15:57:37 -07:00
Leijurv
f3561cab47 SUPER cute code for repackOnAnyBlockChange 2020-08-17 15:54:42 -07:00
Leijurv
38d047dbd1 make the packer queue super cute and deduplicated 2020-08-17 15:19:11 -07:00
Leijurv
e6ba4ef309 we don't compile here 2020-08-17 15:00:57 -07:00
Leijurv
460833f7d6 Merge branch 'master' of github.com:cabaletta/baritone 2020-08-17 14:59:20 -07:00
RealIndrit
2eba22031a Maybe dont have ignore cost calculation override auto tool? 2020-08-14 22:47:39 +02:00
RealIndrit
ac55de63e9 Maybe dont have ignore cost calculation override auto tool? 2020-08-14 17:55:10 +02:00
RealIndrit
88e2fba447 Ok, Im actually retarded 2020-08-14 17:11:31 +02:00
RealIndrit
94ac15a8fc KEK False != True :clown: 2020-08-14 17:06:41 +02:00
RealIndrit
19355cb4f2 Added AutoToolMovement bypass setting for special usage cases, should not be used it not actually necessary 2020-08-14 10:58:15 +02:00
RealIndrit
e0ff16e2dd Nice brainfart 2020-08-14 10:34:21 +02:00
RealIndrit
49db52673a Lol 2020-08-14 10:25:51 +02:00
RealIndrit
f8872e1cd4 Everything can be traced back to getBestSlot(); 2020-08-14 10:14:02 +02:00
RealIndrit
2ed3e10833 And we try this again, because wtf?? 2020-08-13 23:20:30 +02:00
RealIndrit
2b6fe188ed Why calculate stuff that isnt needed... 2020-08-13 22:47:40 +02:00
RealIndrit
2ddc2c3660 Add auto tool settings because 2 lines of code lols 2020-08-13 22:36:34 +02:00
Leijurv
b187d86074 fix orsond rock brain moment 2020-08-05 23:31:32 -07:00
Leijurv
727694fdd5 Merge pull request #1939 from orsondmc/startAtLayer
Introduce startAtLayer
2020-08-05 23:28:52 -07:00
orsondmc
7081cf7172 Introduce startAtLayer to start building at a specific layer in the schematic. To be used only with buildWithLayers true. 2020-08-06 16:23:13 +10:00
Leijurv
a25afd5c13 Merge pull request #1895 from John200410/patch-1
add rusherhack integration badge
2020-07-29 12:57:41 -07:00
Leijurv
c180eb9975 Update README.md 2020-07-29 12:52:19 -07:00
Leijurv
9e45998a65 brady shouldn't merge PRs that don't compile, thanks cdagaming 2020-07-26 13:21:51 -07:00
John
2acf64a0d0 add rusherhack integration badge
as of rusherhack v1.0 there is baritone API integration, similar to future's.
2020-07-20 03:12:24 -04:00
Brady
9d41367eff Merge pull request #1873 from CorruptedSeal/master
Update ProguardTask.java
2020-07-20 00:59:52 -05:00
Leijurv
b64dd8f25f Merge pull request #1879 from elonmusksama/master
updated compatible versions to future badge
2020-07-16 21:12:13 -07:00
elongated muskrat
cbb3483456 updated compatible versions to future badge
updated the compatible versions to the future integrations badge
2020-07-16 14:35:17 -03:00
CorruptedSeal
6603e8b11e Update ExecutionControlCommands.java 2020-07-16 03:45:23 -06:00
CorruptedSeal
d522f9dfa3 Update ProguardTask.java 2020-07-15 01:34:19 -06:00
CorruptedSeal
f02476ff3a Update ProguardTask.java 2020-07-15 01:18:01 -06:00
Leijurv
eafca1e1fe yourkit 2020-07-06 17:07:59 -07:00
kuthy
0055a059f7 Formated Code 2020-07-03 16:52:03 +02:00
kuthy
8262909063 Fixing crash after clicking into the air 2020-07-03 15:36:44 +02:00
Leijurv
e42c19bfec thebes uwu 2020-06-27 22:25:47 -07:00
ByteZ1337
c41eb4afa0 Merge remote-tracking branch 'upstream/master' 2020-06-08 17:42:05 +02:00
Leijurv
80c8294f5f maintain obscenely obvious pro impact bias in subconscious coloring 2020-06-04 11:32:20 -07:00
Leijurv
fc58673abd Merge pull request #1709 from dominikaaaa/patch-1
Added blue badge to integrations badges
2020-06-04 11:31:28 -07:00
Dominika
ca831bc734 Added blue badge to integrations badges 2020-05-18 13:47:57 -04:00
Leijurv
a76cf0fe9a brady more like brainletdy 2020-05-17 18:35:41 -07:00
Leijurv
688853c523 Merge pull request #1657 from babbaj/rename
bring back ExampleBaritoneControl
2020-05-03 22:24:45 -07:00
Babbaj
806dc8f017 This had to be done 2020-05-04 01:15:18 -04:00
Leijurv
89ab78a329 Update README.md 2020-05-03 18:51:21 -07:00
Leijurv
3a7cb5e020 Merge pull request #1629 from dominikaaaa/patch-1
Fix broken API Settings link in USAGE. Close #1040
2020-04-27 16:59:56 -07:00
Leijurv
d0f594065d Update README.md 2020-04-26 13:22:55 -07:00
Dominika
10677040e0 Fix broken API Settings link in USAGE. Close #1040 2020-04-26 15:22:24 -04:00
Leijurv
c2624bbaaf Update README.md 2020-04-21 13:32:47 -07:00
Leijurv
fe0b54cfb4 v1.4.6 2020-04-21 12:23:47 -07:00
Leijurv
0bf7bb4b39 Merge branch '1.13.2' into 1.14.4 2020-04-21 12:17:54 -07:00
Leijurv
2a830b6b68 v1.3.8 2020-04-21 12:05:09 -07:00
Leijurv
fc620f8ba8 Merge branch 'master' into 1.13.2 2020-04-21 12:04:44 -07:00
Leijurv
33d4dd47bb v1.2.14 2020-04-21 12:02:07 -07:00
Leijurv
ec92ab8b39 Update README.md 2020-04-18 22:07:18 -07:00
ByteZ1337
ff3234fcdd Fixed Typo
Fixed Typo in the Long Description of the Goto Command
2020-04-13 20:39:56 +02:00
Babbaj
c32652394e Annotation for proguard -keep 2020-04-12 03:01:24 -04:00
Leijurv
580ba60762 Merge pull request #1344 from dominikaaaa/fix/setupmd
Change 1.14 to 1.15 in SETUP.md
2020-04-09 14:02:28 -07:00
Dominika
0e7bf25de7 fix setup.md as per leij's recommendations 2020-04-09 17:01:26 -04:00
Leijurv
315977e1f2 Merge branch '1.13.2' into 1.14.4 2020-04-07 23:45:48 -07:00
Leijurv
e7658b75ef Merge branch 'master' into 1.13.2 2020-04-07 23:45:42 -07:00
Leijurv
e218ced2c7 i hate myself 2020-03-30 22:23:43 -07:00
Leijurv
3cc4c0ea98 Revert "Update README.md"
This reverts commit ac2a88d186.
2020-03-25 21:52:42 -07:00
Leijurv
ac2a88d186 Update README.md 2020-03-25 21:50:12 -07:00
Leijurv
16f6baf216 v1.4.5 2020-03-25 17:39:01 -07:00
Leijurv
89ab959fb4 Merge branch '1.13.2' into 1.14.4 2020-03-25 17:38:28 -07:00
Leijurv
b9a7efc25b v1.3.7 2020-03-25 17:26:18 -07:00
Leijurv
3b7f13babd Merge branch 'master' into 1.13.2 2020-03-25 17:25:25 -07:00
Leijurv
dff92beea1 v1.2.13 2020-03-25 17:17:10 -07:00
Leijurv
62b808ad48 nickhasbugs 2020-03-18 19:15:47 -07:00
Leijurv
8794bfd79a fix javadoc errors 2020-03-14 12:35:03 -07:00
Leijurv
58bb6c4357 Merge branch '1.13.2' into 1.14.4 2020-03-14 12:25:36 -07:00
Leijurv
520142427d Merge branch 'master' into 1.13.2 2020-03-14 12:25:22 -07:00
Leijurv
69e871eaad we can copy from this image sure 2020-03-14 12:19:39 -07:00
Leijurv
d759c676f7 disable broken code 2020-03-14 12:13:45 -07:00
Leijurv
12481cc491 v1.2.12 2020-03-14 12:09:35 -07:00
Leijurv
43f11aaf0c finally update usage to furry code 2020-03-14 12:09:19 -07:00
Leijurv
f4842aa512 fix actual underlying sneak issue 2020-03-14 11:51:26 -07:00
Leijurv
bcd3fd3266 Merge pull request #1401 from S-B99/patch-1
Add modified settings to bug template
2020-03-14 10:59:39 -07:00
Bella Who
67256c17cf Add modified settings to bug template 2020-03-14 12:10:26 -04:00
Bella Who
d6106a44f7 Remove dropbox link as 1.15.2 is now officially released 2020-03-13 09:00:17 -04:00
Brady
e0beba38af Merge branch '1.13.2' into 1.14.4 2020-03-07 20:37:47 -06:00
Brady
ebe3f457c6 Fix additional injection points in 1.13.2 2020-03-07 20:27:29 -06:00
Brady
6289e540b8 Merge branch 'master' into 1.13.2 2020-03-07 20:23:09 -06:00
Brady
eda1820773 Fix Cubecraft Crash (Affects 1.13.2+) 2020-03-07 20:17:53 -06:00
Brady
c8856cfea4 Fix #1250 2020-03-07 17:34:27 -06:00
Leijurv
217e0da4a6 Merge pull request #1340 from fw4hre0xxq/issue-1339-trapchest-pathing
fix #1339
2020-03-02 12:50:35 -08:00
Brady
96a8bb90c9 Fix tunnel usage in USAGE.md 2020-03-02 13:41:21 -06:00
Brady
0ca3c496de Fix tunnel command usage 2020-03-02 13:40:43 -06:00
aUniqueUser
0434e1c5d3 Add more entries to MineProcess 2020-02-29 12:24:06 -05:00
aUniqueUser
4c79701d22 Make desktop notifications more useful 2020-02-29 11:28:18 -05:00
Bella
5f49bedc42 Change 1.14 to 1.15 in SETUP.md 2020-02-28 17:26:59 -05:00
Leijurv
d9fc825b0f Merge pull request #1336 from S-B99/patch-1
Update USAGE.md as per #1332
2020-02-27 18:07:16 -08:00
Leijurv
17c691b1cf the whole point is its better to do something nonsensical than to crash, so lets continue in that direction 2020-02-27 18:06:11 -08:00
Leijurv
9fb46946b5 fix sprint while paused bug, fixes #1331 2020-02-27 18:05:48 -08:00
fw4hre0xxq
220fa79057 fix #1339 2020-02-27 17:14:41 -08:00
Bella Who
f1f4adf8a6 Update USAGE.md as per #1332 2020-02-27 17:42:12 -05:00
Leijurv
448dd979a2 Merge pull request #1332 from aUniqueUser/master
#740 (Custom tunneling) Updated for new command system
2020-02-27 14:29:18 -08:00
Leijurv
3386947522 Merge pull request #1020 from Xephorix/patch-1
Update USAGE.md
2020-02-27 09:25:25 -08:00
aUniqueUser
628ec0f2b5 updated longDesc 2020-02-26 13:04:10 -05:00
aUniqueUser
e3b91c884a More logical argument order 2020-02-26 12:30:07 -05:00
aUniqueUser
10bb935a42 Merge pull request #1 from CDAGaming/CDAGaming-patch-1
[Change] Adjustments
2020-02-26 11:14:45 -05:00
CDAGaming
6f136a90a2 [Change] Adjustments 2020-02-26 07:55:21 -06:00
aUniqueUser
acd9bcceeb Codacy 2020-02-25 21:47:35 -05:00
aUniqueUser
3c2838df9e lol 2020-02-25 21:22:35 -05:00
aUniqueUser
4b526f7242 Custom Tunneling 2020-02-25 21:13:20 -05:00
Leijurv
5fd3e236e2 Merge branch '1.13.2' into 1.14.4 2020-02-24 19:28:42 -08:00
Leijurv
399037b866 Merge branch 'master' into 1.13.2 2020-02-24 19:28:05 -08:00
Leijurv
61563c9359 builderprocess should use hypothetical sneaking 2020-02-24 19:27:11 -08:00
Leijurv
1a8d93b946 Merge branch '1.13.2' into 1.14.4 2020-02-24 18:56:56 -08:00
Leijurv
50783e65a9 Merge branch 'master' into 1.13.2 2020-02-24 18:39:36 -08:00
Leijurv
e854bf59f8 fix sneaking based issues 2020-02-24 18:31:42 -08:00
Leijurv
393a3a87b6 Update USAGE.md 2020-02-24 12:20:13 -08:00
Brady
888b2723e0 Fix critical prefix tag bug 2020-02-23 21:13:51 -06:00
Leijurv
6ed03d0858 Merge pull request #1328 from babbaj/baritoe
toe
2020-02-23 18:55:22 -08:00
Babbaj
ee33666b38 3 days 2020-02-23 21:54:18 -05:00
Babbaj
07c406aa16 baritoe 2020-02-23 21:48:15 -05:00
Brady
c578d5c1a3 Fix additional TrayIcon creation and support Mac notifs 2020-02-23 12:51:14 -06:00
Leijurv
2ea66ea8fc Merge pull request #1324 from aUniqueUser/master
Desktop Notification System
2020-02-23 10:05:30 -08:00
Leijurv
27440fc147 Update README.md 2020-02-22 22:42:22 -08:00
Leijurv
b1f5429db9 Update README.md 2020-02-22 18:37:29 -08:00
Leijurv
042b1ed6d7 Update README.md 2020-02-22 18:37:10 -08:00
aUniqueUser
a8645afbdb Revert "mfw"
This reverts commit 25b85f17a3.
2020-02-22 21:09:36 -05:00
aUniqueUser
25b85f17a3 mfw 2020-02-22 20:41:06 -05:00
aUniqueUser
cf691118b9 comment fixed 2020-02-22 20:19:25 -05:00
aUniqueUser
0dcb9d4b69 Formatting 2020-02-22 20:12:43 -05:00
aUniqueUser
2d2571cff5 Desktop Notification System 2020-02-22 18:31:41 -05:00
Leijurv
ec8d5c0f4d Merge pull request #1314 from babbaj/proguard-patch
Remove string parsing functions from -assumenosideeffects
2020-02-20 17:35:21 -08:00
Babbaj
85d63c9d7f Exceptions are side effects 2020-02-20 20:29:36 -05:00
Leijurv
19f70f5a79 Merge pull request #1306 from S-B99/patch-1
Make setup instructions more clear
2020-02-17 14:43:05 -08:00
Bella Who
80955cad8b Make setup instructions more clear 2020-02-17 17:42:05 -05:00
Leijurv
25587e317a fix link click crash 2020-02-14 15:26:03 -08:00
Leijurv
01ba712d33 Update README.md 2020-02-14 13:49:53 -08:00
Leijurv
e0985d3b68 Update README.md 2020-02-14 13:49:15 -08:00
Leijurv
7181d2c91a Merge pull request #1287 from S-B99/master
Add Linux support to issue templates
2020-02-09 17:15:52 -08:00
Bella Who
e66d8616ce fixed space 2020-02-09 19:28:19 -05:00
Bella Who
656dd91004 Update bug.md 2020-02-09 19:12:40 -05:00
Leijurv
d88b3a7799 Merge pull request #1286 from S-B99/master
Make how to use checkboxes more clear in issue templates
2020-02-09 14:54:35 -08:00
Bella Who
7cdbc4acca Update suggestion.md 2020-02-09 17:45:28 -05:00
Bella Who
de68e6630e Update question.md 2020-02-09 17:45:09 -05:00
Bella Who
de89da20b2 Update bug.md 2020-02-09 17:44:50 -05:00
Leijurv
17a06621f5 rootnet shill 2020-02-01 16:42:14 -08:00
Leijurv
b3de840e04 no reason for this now that impact is 1.14.4 for all 2020-01-26 12:41:15 -08:00
Leijurv
539b8ef973 fix oversight in coordinate censorship 2020-01-25 22:35:01 -08:00
Brady
94a2e13561 Merge branch '1.13.2' into 1.14.4 2020-01-10 20:14:46 -06:00
Brady
f7041022d0 Merge branch 'master' into 1.13.2 2020-01-10 20:13:57 -06:00
Brady
710170ef2d Fix RelativeGoalXZ coordinate mix-up
Basically for many months now RelativeGoalXZ produced (~X, ~Y), not (~X, ~Z).
2020-01-10 20:10:16 -06:00
Leijurv
760ac5dd8f v1.4.4 2020-01-04 21:58:55 -08:00
Leijurv
dd76d2eabc v1.3.6 2020-01-04 21:58:21 -08:00
Leijurv
fb22cf05eb v1.2.11 2020-01-04 21:57:16 -08:00
Brady
92966dc57c Merge branch '1.13.2' into 1.14.4 2019-12-31 21:57:55 -06:00
Brady
e3d3407de5 Remove normalizations from BlockOptionalMeta 2019-12-31 19:44:44 -06:00
Brady
f3d860e8fa Merge branch 'master' into 1.13.2 2019-12-31 19:40:14 -06:00
Brady
adff391e45 Merge branch 'schematic-formats' 2019-12-31 18:25:21 -06:00
Brady
4a05837b01 Requested changes 2019-12-31 17:44:20 -06:00
Leijurv
1edd7126fd Merge branch 'master' into 1.13.2 2019-12-31 15:44:03 -08:00
Leijurv
a0014fda12 Merge pull request #1216 from FTC55/master
Fixed a rather obnoxious bug that would require a full restart of the client.
2019-12-31 15:35:01 -08:00
FTC55
04190af340 ...more than I thought. Autoreformatted file x2 2019-12-31 19:45:08 +01:00
FTC55
4b10904b97 Git missed some changes. Autoreformatted files. 2019-12-31 19:43:54 +01:00
FTC55
bbb25acff3 Fixed the bug, merged CancelCommand into ExecutionControlCommands 2019-12-31 19:31:30 +01:00
Brady
fcfa022232 Clean up BlockOptionalMeta comment and add behavioral clarification 2019-12-30 02:27:20 -06:00
Brady
220ee30d35 Appease Codacy 2019-12-27 21:28:05 -06:00
Brady
812bc0d8c4 Remove redundant parser layer 2019-12-27 01:14:31 -06:00
Brady
d712839c25 Make Schematica respect mapArtMode setting 2019-12-25 01:35:10 -06:00
Brady
eee705b371 Schematic Format API support 2019-12-24 17:20:00 -06:00
Brady
77bdf6e444 Fix MapSchematic 2019-12-23 18:05:50 -06:00
Brady
0a858c040c Working 2019-12-19 22:15:14 -06:00
Brady
eea5b69b6c Utilize new FillSchematic 2019-12-19 12:03:02 -06:00
Brady
6759917a2f Additional clean up 2019-12-19 11:58:47 -06:00
Brady
aa3bd80ab2 Clean ups 2019-12-19 11:40:38 -06:00
Brady
ea8d7fb3b9 Improve file extension fallback mechanism 2019-12-18 15:19:58 -06:00
Brady
b4ddf38116 Check if state is null 2019-12-18 10:27:34 -06:00
Brady
5c9f028103 Initial sponge support 2019-12-18 10:24:43 -06:00
Leijurv
937d4cc884 whoops 2019-12-13 20:46:12 -08:00
Leijurv
2c3e1f4232 builder stuff, fixes #1059 2019-12-13 20:09:04 -08:00
Leijurv
ddc681fe77 build repeat count 2019-11-24 11:11:28 -08:00
Conner Vercellino
0fba32853b Create .gitmessage 2019-11-20 12:26:37 -08:00
Leijurv
2b71b31cfa Merge pull request #1087 from cabaletta/ispassable-crash-fix
Fix isPassable crash
2019-11-10 22:52:29 -08:00
Leijurv
ed144e995b apparently this usage of > was an invalid javadoc command lol 2019-11-10 14:04:27 -08:00
Brady
7e3a2d3c0a Create a BlockStateInterface specialized IBlockAccess wrapper 2019-11-05 18:17:10 -06:00
Leijurv
152285043d Update USAGE.md 2019-11-05 11:50:27 -08:00
Leijurv
ce52201e45 Merge pull request #1097 from greg904/fix-goto-errmsg
Remove error message when running goto with less than 3 args
2019-10-29 21:33:27 -07:00
Leijurv
45ea776090 Update README.md 2019-10-28 10:47:20 -07:00
Leijurv
2ae16d8bb1 configurable block reach distance 2019-10-26 16:01:08 -07:00
Greg Depoire--Ferrer
23fc6c8b49 Add a space between sentences in error message 2019-10-25 14:49:57 +02:00
Greg Depoire--Ferrer
0db4b193e1 Remove hack, add comment, don't use default when arg is required 2019-10-25 14:49:08 +02:00
Greg Depoire--Ferrer
82d520d808 Don't print invalid type error to stderr 2019-10-25 14:42:36 +02:00
Brady
5201d39adf Retain old method signature 2019-10-24 15:20:23 -05:00
Brady
f02c33d95a Fix improper tick count incrementation 2019-10-23 17:47:20 -05:00
Brady
43ab4f7d3b Fix isPassable crash 2019-10-22 15:58:10 -05:00
Leijurv
a57668bd15 Merge pull request #1073 from 0-x-2-2/1.13.2
Merged master into 1.13.2 branch. 😎
2019-10-17 13:54:06 -07:00
0x22
a324b58f55 Merged master into 1.13.2 branch. 😎 2019-10-17 16:01:35 -04:00
Leijurv
6341f9fcb4 Merge pull request #1072 from 0-x-2-2/disable-autotest-mob-spawning
Disable harmful mob spawning in Travis auto test.
2019-10-17 12:05:24 -07:00
0x22
66ffd1e0d9 Disable harmful mob spawning in Travis auto test. 2019-10-17 14:35:28 -04:00
Leijurv
e65c854e6a Update USAGE.md 2019-10-15 11:25:35 -07:00
ads123ads
9f5d9bceaa The grammar mistakes were corrected 2019-10-15 15:34:22 +05:30
Brady
4eca960a4c Specify range in IWorldScanner#repack 2019-10-14 15:45:41 -05:00
Leijurv
69bceb43f8 Update USAGE.md 2019-10-12 13:07:12 -07:00
Leijurv
6a8807b0fa documentation stuff 2019-10-12 10:43:01 -07:00
Leijurv
105c7d438a v1.3.5 2019-10-11 17:29:27 -07:00
Leijurv
e49549117b v1.2.10 2019-10-11 17:08:28 -07:00
Xennex
bd345ae041 Update USAGE.md
added a few commands to the list of "fun / interesting / important ones that you might want to look at"
2019-10-07 09:50:10 -06:00
146 changed files with 2343 additions and 1072 deletions

View File

@@ -14,12 +14,22 @@ Baritone version:
Forge mods (if used):
## Exception, error or logs
You can find your logs in `%appdata%/.minecraft/logs/` (Windows) or `/Library/Application\ Support/minecraft/logs` (Mac).
Please find your `latest.log` or `debug.log` in this folder and attach it to the issue
Linux: `~/.minecraft/logs/`
Windows: `%appdata%/.minecraft/logs/`
Mac: `/Library/Application\ Support/minecraft/logs/`
## How to reproduce
Add your steps to reproduce the issue/bug experienced here.
## Modified settings
To get the modified settings run `#modified` in game
## Final checklist
- [x] I know how to properly use check boxes
- [ ] I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
- [ ] I have included logs, exceptions and / or steps to reproduce the issue.
- [ ] I have not used any OwO's or UwU's in this issue.
- [ ] I have not used any OwO's or UwU's in this issue.

View File

@@ -10,4 +10,5 @@ assignees: ''
With as much detail as possible, describe your question and what you may need help with.
## Final checklist
- [ ] I have not used any OwO's or UwU's in this issue.
- [x] I know how to properly use check boxes
- [ ] I have not used any OwO's or UwU's in this issue.

View File

@@ -16,4 +16,5 @@ If applicable, what settings/customizability should be offered to tweak the func
Describe how your suggestion would improve Baritone, or the reason behind it being added.
## Final checklist
- [ ] I have not used any OwO's or UwU's in this issue.
- [x] I know how to properly use check boxes
- [ ] I have not used any OwO's or UwU's in this issue.

31
.gitmessage Normal file
View File

@@ -0,0 +1,31 @@
<emoji> <title> (<ticket>)
# 📝 Update README.md (WD-1234)
# ✅ Add unit test for inputs (WD-1234)
# <emoji> can be:
# 🎨 :art: when improving structure of the code
# ⚡️ :zap: when improving performance
# 🔥 :fire: when removing code or files
# ✨ :sparkles: when introducing new features
# 🚧 :construction: when work in progress
# 🔨 :hammer: when refactoring code
# 📝 :memo: when writing docs
# 💄 :lipstick: when updating the UI and style files
# 📈 :chart_with_upwards_trend: when adding analytics or tracking code
# 🌐 :globe_with_meridians: when adding internationalization and localization
# ✏️ :pencil2: when fixing typos
# 🚚 :truck: when moving or renaming files
# ✅ :white_check_mark: when adding tests
# 👌 :ok_hand: when updating code due to code review changes
# 🐛 :bug: when fixing a bug
# 🚑 :ambulance: when doing a critical hotfix
# 🚨 :rotating_light: when removing linter warnings
# 🔀 :twisted_rightwards_arrows: when merging branches
# ⬆️ :arrow_up: when upgrading dependencies
# ⬇️ :arrow_down: when downgrading dependencies
# 🔧 :wrench: when changing configuration files
# 🔖 :bookmark: when releasing / version tagging
# 💚 :green_heart: when fixing the CI build

View File

@@ -9,8 +9,7 @@ install:
- travis_retry docker build -t cabaletta/baritone .
script:
- docker run --rm cabaletta/baritone ./gradlew javadoc
- docker run --name baritone cabaletta/baritone /bin/sh -c "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 128x128x24 -ac +extension GLX +render; DISPLAY=:99 BARITONE_AUTO_TEST=true ./gradlew runAutoTest; cat /code/autotest/success"
- docker run --name baritone cabaletta/baritone ./gradlew javadoc
- docker cp baritone:/code/dist dist
- ls dist
- cat dist/checksums.txt

View File

@@ -1,7 +1,5 @@
FROM debian:stretch
RUN echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/stretch-backports.list
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y
@@ -10,14 +8,8 @@ RUN apt install \
openjdk-8-jdk \
--assume-yes
RUN apt install -qq --assume-yes mesa-utils libgl1-mesa-glx libxcursor1 libxrandr2 libxxf86vm1 x11-xserver-utils xfonts-base xserver-common
COPY . /code
WORKDIR /code
# this .deb is specially patched to support lwjgl
# source: https://github.com/tectonicus/tectonicus/issues/60#issuecomment-154239173
RUN dpkg -i scripts/xvfb_1.16.4-1_amd64.deb
RUN ./gradlew build

View File

@@ -1,86 +1 @@
# Baritone
[![Build Status](https://travis-ci.com/cabaletta/baritone.svg?branch=master)](https://travis-ci.com/cabaletta/baritone/)
[![Release](https://img.shields.io/github/release/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/releases/)
[![License](https://img.shields.io/badge/license-LGPL--3.0%20with%20anime%20exception-green.svg)](LICENSE)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a73d037823b64a5faf597a18d71e3400)](https://www.codacy.com/app/leijurv/baritone?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cabaletta/baritone&amp;utm_campaign=Badge_Grade)
[![HitCount](http://hits.dwyl.com/cabaletta/baritone.svg)](http://hits.dwyl.com/cabaletta/baritone/)
[![GitHub All Releases](https://img.shields.io/github/downloads/cabaletta/baritone/total.svg)](https://github.com/cabaletta/baritone/releases/)
[![Minecraft](https://img.shields.io/badge/MC-1.12.2-brightgreen.svg)](https://github.com/cabaletta/baritone/tree/master/)
[![Minecraft](https://img.shields.io/badge/MC-1.13.2-brightgreen.svg)](https://github.com/cabaletta/baritone/tree/1.13.2/)
[![Minecraft](https://img.shields.io/badge/MC-1.14.4-brightgreen.svg)](https://github.com/cabaletta/baritone/tree/1.14.4/)
[![Code of Conduct](https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg?style=flat)](https://github.com/cabaletta/baritone/blob/master/CODE_OF_CONDUCT.md)
[![Known Vulnerabilities](https://snyk.io/test/github/cabaletta/baritone/badge.svg?targetFile=build.gradle)](https://snyk.io/test/github/cabaletta/baritone?targetFile=build.gradle)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/cabaletta/baritone/issues/)
[![Issues](https://img.shields.io/github/issues/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/issues/)
[![GitHub issues-closed](https://img.shields.io/github/issues-closed/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/issues?q=is%3Aissue+is%3Aclosed)
[![Pull Requests](https://img.shields.io/github/issues-pr/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/pulls/)
![Code size](https://img.shields.io/github/languages/code-size/cabaletta/baritone.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/cabaletta/baritone.svg)
![Lines of Code](https://tokei.rs/b1/github/cabaletta/baritone?category=code)
[![GitHub contributors](https://img.shields.io/github/contributors/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/graphs/contributors/)
[![GitHub commits](https://img.shields.io/github/commits-since/cabaletta/baritone/v1.0.0.svg)](https://github.com/cabaletta/baritone/commit/)
[![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.2.8%20/%20v1.3.4%20/%20v1.4.1-brightgreen.svg)](https://impactclient.net/)
[![ForgeHax integration](https://img.shields.io/badge/ForgeHax%20%22integration%22-scuffed-yellow.svg)](https://github.com/fr1kin/ForgeHax/)
[![Aristois add-on integration](https://img.shields.io/badge/Aristois%20add--on%20integration-v1.3.4%20/%20v1.4.1-green.svg)](https://gitlab.com/emc-mods-indrit/baritone_api)
[![WWE integration](https://img.shields.io/badge/WWE%20%22integration%22-master%3F-green.svg)](https://wweclient.com/)
[![Future integration](https://img.shields.io/badge/Future%20integration-Soon™%3F%3F%3F-red.svg)](https://futureclient.net/)
[![forthebadge](https://forthebadge.com/images/badges/built-with-swag.svg)](http://forthebadge.com/)
[![forthebadge](https://forthebadge.com/images/badges/mom-made-pizza-rolls.svg)](http://forthebadge.com/)
A Minecraft pathfinder bot.
Baritone is the pathfinding system used in [Impact](https://impactclient.net/) since 4.4. There's a [showcase video](https://www.youtube.com/watch?v=yI8hgW_m6dQ) made by @Adovin#3153 on Baritone's integration into Impact. [Here's](https://www.youtube.com/watch?v=StquF69-_wI) a video I made showing off what it can do.
The easiest way to install Baritone is to install [Impact](https://impactclient.net/), which comes with Baritone. The second easiest way (for 1.12.2 only) is to install the v1.2.* forge api jar from [releases](https://github.com/cabaletta/baritone/releases). Otherwise, see [Installation & setup](SETUP.md). Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it.
For 1.14.4, [click here](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1). Or [with optifine](https://github.com/cabaletta/baritone/issues/797).
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 and 1.13.2. 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).
Have committed at least once a day from Aug 1 2018 to Aug 1 2019.
1Leijurv3DWTrGAfmmiTphjhXLvQiHg7K2
# Getting Started
Here are some links to help to get started:
- [Features](FEATURES.md)
- [Installation & setup](SETUP.md)
- [API Javadocs](https://baritone.leijurv.com/)
- [Settings](https://baritone.leijurv.com/baritone/api/Settings.html#field.detail)
- [Usage (chat control)](USAGE.md)
# API
The API is heavily documented, you can find the Javadocs for the latest release [here](https://baritone.leijurv.com/).
Please note that usage of anything located outside of the ``baritone.api`` package is not supported by the API release
jar.
Below is an example of basic usage for changing some settings, and then pathing to a X/Z goal.
```
BaritoneAPI.getSettings().allowSprint.value = true;
BaritoneAPI.getSettings().primaryTimeoutMS.value = 2000L;
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ(10000, 20000));
```
# FAQ
## Can I use Baritone as a library in my custom utility client?
That's what it's for, sure! (As long as usage is in compliance with the LGPL 3.0 License)
## How is it so fast?
Magic. (Hours of [leijurv](https://github.com/leijurv/) enduring excruciating pain)
## Why is it called Baritone?
It's named for FitMC's deep sultry voice.
This branch of Baritone is deprecated. It will no longer recieve updates. Updates to older versions of Minecraft will not be merged into this branch, even if a newer branch is not deprecated (this branch will be skipped). Bug reports that only affect deprecated branches will not be addressed.

View File

@@ -2,7 +2,7 @@
The easiest way to install Baritone is to install [Impact](https://impactclient.net/), which comes with Baritone.
For 1.14.4, [click here](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1).
You can also use a custom version json for Minecraft, with the [1.14.4](https://www.dropbox.com/s/rkml3hjokd3qv0m/1.14.4-Baritone.zip?dl=1) version or the [1.15.2](https://www.dropbox.com/s/8rx6f0kts9hvd4f/1.15.2-Baritone.zip?dl=1) version
Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it.
@@ -47,6 +47,29 @@ You can verify whether or not it worked by running `.b version` in chat (only va
## Command Line
On Mac OSX and Linux, use `./gradlew` instead of `gradlew`.
If you have errors with a package missing please make sure you have setup your environment, and are using Oracle JDK 8.
To check which java you are using do
`java -version` in a command prompt or terminal.
If you are using anything above OpenJDK 8, it might not work because the Java distributions above JDK 8 using may not have the needed javax classes.
Open JDK 8 download: https://openjdk.java.net/install/
#### macOS guide
In order to get JDK 8, Try running the following command:
`% /usr/libexec/java_home -V`
If it doesn't work try this guide: https://stackoverflow.com/questions/46513639/how-to-downgrade-java-from-9-to-8-on-a-macos-eclipse-is-not-running-with-java-9
If you see something like
`% 1.8.0_VERSION, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_VERSION.jdk/Contents/Home`
in the list then you've got JDK 8 installed.
In order to get JDK 8 running in the **current terminal window** you will have to run this command:
`% export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)`
To add OpenJDK 8 to your PATH add the export line to the end of your `.zshrc / .bashrc` if you want it to apply to each new terminal. If you're using bash change the .bachrc and if you're using zsh change the .zshrc
Setting up the Environment:
```
@@ -54,6 +77,18 @@ $ gradlew setupDecompWorkspace
$ gradlew --refresh-dependencies
```
Building Baritone:
```
$ gradlew build
```
For minecraft 1.15.2+, run the following instead to include the Forge jars:
```
$ gradlew build -Pbaritone.forge_build
```
Running Baritone:
```
@@ -87,16 +122,6 @@ For information on how to build baritone, see [Building Baritone](#building-bari
![Image](https://i.imgur.com/hrLhG9u.png)
# Building
Make sure that you have properly [setup](#setup) the environment before trying to build it.
## Command Line
```
$ gradlew build
```
## IntelliJ
- Navigate to the gradle tasks on the right tab as follows

View File

@@ -8,11 +8,27 @@ Baritone commands can also by default be typed in the chatbox. However if you ma
To disable direct chat control (with no prefix), turn off the `chatControl` setting. To disable chat control with the `#` prefix, turn off the `prefixControl` setting. In Impact, `.b` cannot be disabled. Be careful that you don't leave yourself with all control methods disabled (if you do, reset your settings by deleting the file `minecraft/baritone/settings.txt` and relaunching).
# For Baritone 1.2.10+, 1.3.5+, 1.4.2+
Lots of the commands have changed, BUT `#help` is improved vastly (its clickable! commands have tab completion! oh my!).
Try `#help` I promise it won't just send you back here =)
"wtf where is cleararea" -> look at `#help sel`
"wtf where is goto death, goto waypoint" -> look at `#help wp`
just look at `#help` lmao
Watch this [showcase video](https://youtu.be/CZkLXWo4Fg4)!
# Commands
[Tutorial playlist](https://www.youtube.com/playlist?list=PLnwnJ1qsS7CoQl9Si-RTluuzCo_4Oulpa)
**All** of these commands may need a prefix before them, as above ^.
`help` for (rudimentary) help. You can see what it says [here](https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/utils/ExampleBaritoneControl.java#L47).
`help`
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`.
@@ -24,13 +40,13 @@ Some common examples:
- `goal clear` to clear the goal
- `cancel` or `stop` to stop everything
- `goto portal` or `goto ender_chest` or `goto block_type` to go to a block. (in Impact, `.goto` is an alias for `.b goto` for the most part)
- `mine diamond_ore iron_ore` to mine diamond ore or iron ore (turn on the setting `legitMine` to only mine ores that it can actually see. It will explore randomly around y=11 until it finds them.) An amount of blocks can also be specified, for example, `mine diamond_ore 64`.
- `click` to click your destination on the screen. Right click path to on top of the block, left click to path into it (either at foot level or eye level), and left click and drag to clear all blocks from an area.
- `follow playerName` to follow a player. `followplayers` to follow any players in range (combine with Kill Aura for a fun time). `followentities` to follow any entities. `followentity pig` to follow entities of a specific type.
- `save waypointName` to save a waypoint. `goto waypointName` to go to it.
- `build` to build a schematic. `build blah` will load `schematics/blah.schematic` and build it with the origin being your player feet. `build blah 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).
- `mine diamond_ore iron_ore` to mine diamond ore or iron ore (turn on the setting `legitMine` to only mine ores that it can actually see. It will explore randomly around y=11 until it finds them.) An amount of blocks can also be specified, for example, `mine 64 diamond_ore`.
- `click` to click your destination on the screen. Right click path to on top of the block, left click to path into it (either at foot level or eye level), and left click and drag to select an area (`#help sel` to see what you can do with that selection).
- `follow player playerName` to follow a player. `follow players` to follow any players in range (combine with Kill Aura for a fun time). `follow entities` to follow any entities. `follow entity pig` to follow entities of a specific type.
- `wp` for waypoints. A "tag" is like "home" (created automatically on right clicking a bed) or "death" (created automatically on death) or "user" (has to be created manually). So you might want `#wp save user coolbiome`, then to set the goal `#wp goal coolbiome` then `#path` to path to it. For death, `#wp goal death` will list waypoints under the "death" tag (remember stuff is clickable!)
- `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).
- `schematica` to build the schematic that is currently open in schematica
- `tunnel` to dig just straight ahead and make a tunnel
- `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.
- `farm` to automatically harvest, replant, or bone meal crops
- `axis` to go to an axis or diagonal axis at y=120 (`axisHeight` is a configurable setting, defaults to 120).
- `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.
@@ -38,13 +54,7 @@ Some common examples:
- `version` to get the version of Baritone you're running
- `damn` daniel
New commands:
- `sel` to manage selections
- some others
For the rest of the commands, you can take a look at the code [here](https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/utils/ExampleBaritoneControl.java).
For the rest of the commands, you can take a look at the code [here](https://baritone.leijurv.com/baritone/api/Settings.html).
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>.
@@ -65,6 +75,8 @@ There are about a hundred settings, but here are some fun / interesting / import
- `worldExploringChunkOffset`
- `acceptableThrowawayItems`
- `blocksToAvoidBreaking`
- `mineScanDroppedItems`
- `allowDiagonalAscend`
@@ -84,4 +96,4 @@ So you'll need to use the `#` prefix or edit `baritone/settings.txt` in your Min
## 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?
These are custom commands that they added; those aren't from Baritone.
The equivalent you're looking for is `goal x z` then `path`.
The equivalent you're looking for is `goto x z`.

View File

@@ -16,11 +16,10 @@
*/
group 'baritone'
version '1.4.3'
version '1.4.6'
buildscript {
repositories {
jcenter()
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
@@ -29,6 +28,7 @@ buildscript {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
jcenter()
}
dependencies {
@@ -127,8 +127,8 @@ repositories {
mavenCentral()
maven {
name = 'spongepowered-repo'
url = 'http://repo.spongepowered.org/maven/'
name = 'SpongePowered'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
@@ -172,6 +172,12 @@ javadoc {
jar {
from sourceSets.launch.output, sourceSets.api.output
if (!getProject().hasProperty("baritone.forge_build")) {
exclude "**/BaritoneForgeModXD.class"
exclude "**/mods.toml"
}
preserveFileTimestamps = false
reproducibleFileOrder = true

View File

@@ -22,6 +22,21 @@ import org.apache.commons.io.IOUtils;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.JavaVersion;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.internal.file.IdentityFileResolver;
import org.gradle.api.internal.plugins.DefaultConvention;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.compile.ForkOptions;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.internal.Pair;
import org.gradle.internal.jvm.Jvm;
import org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector;
import org.gradle.process.internal.DefaultExecActionFactory;
import java.io.*;
import java.net.URL;
@@ -86,6 +101,101 @@ public class ProguardTask extends BaritoneGradleTask {
}
}
private String getJavaBinPathForProguard() throws Exception {
String path;
try {
path = findJavaPathByGradleConfig();
if (path != null) return path;
}
catch (Exception ex) {
System.err.println("Unable to find java by javaCompile options");
ex.printStackTrace();
}
try {
path = findJavaByJavaHome();
if (path != null) return path;
}
catch(Exception ex) {
System.err.println("Unable to find java by JAVA_HOME");
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)");
}
private String findJavaByGradleCurrentRuntime() {
String path = Jvm.current().getJavaExecutable().getAbsolutePath();
if (this.validateJavaVersion(path)) {
System.out.println("Using Gradle's runtime Java for ProGuard");
return path;
}
return null;
}
private String findJavaByJavaHome() {
final String javaHomeEnv = System.getenv("JAVA_HOME");
if (javaHomeEnv != null) {
String path = Jvm.forHome(new File(javaHomeEnv)).getJavaExecutable().getAbsolutePath();
if (this.validateJavaVersion(path)) {
System.out.println("Detected Java path by JAVA_HOME");
return path;
}
}
return null;
}
private String findJavaPathByGradleConfig() {
final TaskCollection<JavaCompile> javaCompiles = super.getProject().getTasks().withType(JavaCompile.class);
final JavaCompile compileTask = javaCompiles.iterator().next();
final ForkOptions forkOptions = compileTask.getOptions().getForkOptions();
if (forkOptions != null) {
String javacPath = forkOptions.getExecutable();
if (javacPath != null) {
File javacFile = new File(javacPath);
if (javacFile.exists()) {
File[] maybeJava = javacFile.getParentFile().listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.equals("java");
}
});
if (maybeJava != null && maybeJava.length > 0) {
String path = maybeJava[0].getAbsolutePath();
if (this.validateJavaVersion(path)) {
System.out.println("Detected Java path by forkOptions");
return path;
}
}
}
}
}
return null;
}
private boolean validateJavaVersion(String java) {
final JavaVersion javaVersion = new DefaultJvmVersionDetector(new DefaultExecActionFactory(new IdentityFileResolver())).getJavaVersion(java);
if (!javaVersion.getMajorVersion().equals("8")) {
System.out.println("Failed to validate Java version " + javaVersion.toString() + " [" + java + "] for ProGuard libraryjars");
// throw new RuntimeException("Java version incorrect: " + javaVersion.getMajorVersion() + " for " + java);
return false;
}
System.out.println("Validated Java version " + javaVersion.toString() + " [" + java + "] for ProGuard libraryjars");
return true;
}
private void generateConfigs() throws Exception {
Files.copy(getRelativeFile(PROGUARD_CONFIG_TEMPLATE), getTemporaryFile(PROGUARD_CONFIG_DEST), REPLACE_EXISTING);
@@ -95,7 +205,7 @@ public class ProguardTask extends BaritoneGradleTask {
template.add(1, "-outjars " + this.getTemporaryFile(PROGUARD_EXPORT_PATH));
// Acquire the RT jar using "java -verbose". This doesn't work on Java 9+
Process p = new ProcessBuilder("java", "-verbose").start();
Process p = new ProcessBuilder(this.getJavaBinPathForProguard(), "-verbose").start();
String out = IOUtils.toString(p.getInputStream(), "UTF-8").split("\n")[0].split("Opened ")[1].replace("]", "");
template.add(2, "-libraryjars '" + out + "'");

55
scripts/proguard.pro vendored
View File

@@ -25,6 +25,13 @@
-keep class baritone.api.utils.MyChunkPos { *; } # even in standalone we need to keep this for gson reflect
# Keep any class or member annotated with @KeepName so we dont have to put everything in the script
-keep,allowobfuscation @interface baritone.KeepName
-keep @baritone.KeepName class *
-keepclassmembers class * {
@baritone.KeepName *;
}
# setting names are reflected from field names, so keep field names
-keepclassmembers class baritone.api.Settings {
public <fields>;
@@ -134,19 +141,19 @@
-assumenosideeffects public class java.lang.* extends java.lang.Number {
public static java.lang.String toString(byte);
public static java.lang.Byte valueOf(byte);
public static byte parseByte(java.lang.String);
public static byte parseByte(java.lang.String,int);
public static java.lang.Byte valueOf(java.lang.String,int);
public static java.lang.Byte valueOf(java.lang.String);
public static java.lang.Byte decode(java.lang.String);
# public static byte parseByte(java.lang.String);
# public static byte parseByte(java.lang.String,int);
# public static java.lang.Byte valueOf(java.lang.String,int);
# public static java.lang.Byte valueOf(java.lang.String);
# public static java.lang.Byte decode(java.lang.String);
public int compareTo(java.lang.Byte);
public static java.lang.String toString(short);
public static short parseShort(java.lang.String);
public static short parseShort(java.lang.String,int);
public static java.lang.Short valueOf(java.lang.String,int);
public static java.lang.Short valueOf(java.lang.String);
# public static short parseShort(java.lang.String);
# public static short parseShort(java.lang.String,int);
# public static java.lang.Short valueOf(java.lang.String,int);
# public static java.lang.Short valueOf(java.lang.String);
public static java.lang.Short valueOf(short);
public static java.lang.Short decode(java.lang.String);
# public static java.lang.Short decode(java.lang.String);
public static short reverseBytes(short);
public int compareTo(java.lang.Short);
public static java.lang.String toString(int,int);
@@ -154,10 +161,10 @@
public static java.lang.String toOctalString(int);
public static java.lang.String toBinaryString(int);
public static java.lang.String toString(int);
public static int parseInt(java.lang.String,int);
public static int parseInt(java.lang.String);
public static java.lang.Integer valueOf(java.lang.String,int);
public static java.lang.Integer valueOf(java.lang.String);
# public static int parseInt(java.lang.String,int);
# public static int parseInt(java.lang.String);
# public static java.lang.Integer valueOf(java.lang.String,int);
# public static java.lang.Integer valueOf(java.lang.String);
public static java.lang.Integer valueOf(int);
public static java.lang.Integer getInteger(java.lang.String);
public static java.lang.Integer getInteger(java.lang.String,int);
@@ -179,12 +186,12 @@
public static java.lang.String toOctalString(long);
public static java.lang.String toBinaryString(long);
public static java.lang.String toString(long);
public static long parseLong(java.lang.String,int);
public static long parseLong(java.lang.String);
public static java.lang.Long valueOf(java.lang.String,int);
public static java.lang.Long valueOf(java.lang.String);
# public static long parseLong(java.lang.String,int);
# public static long parseLong(java.lang.String);
# public static java.lang.Long valueOf(java.lang.String,int);
# public static java.lang.Long valueOf(java.lang.String);
public static java.lang.Long valueOf(long);
public static java.lang.Long decode(java.lang.String);
# public static java.lang.Long decode(java.lang.String);
public static java.lang.Long getLong(java.lang.String);
public static java.lang.Long getLong(java.lang.String,long);
public static java.lang.Long getLong(java.lang.String,java.lang.Long);
@@ -201,9 +208,9 @@
public int compareTo(java.lang.Long);
public static java.lang.String toString(float);
public static java.lang.String toHexString(float);
public static java.lang.Float valueOf(java.lang.String);
# public static java.lang.Float valueOf(java.lang.String);
public static java.lang.Float valueOf(float);
public static float parseFloat(java.lang.String);
# public static float parseFloat(java.lang.String);
public static boolean isNaN(float);
public static boolean isInfinite(float);
public static int floatToIntBits(float);
@@ -215,9 +222,9 @@
public int compareTo(java.lang.Float);
public static java.lang.String toString(double);
public static java.lang.String toHexString(double);
public static java.lang.Double valueOf(java.lang.String);
public static java.lang.Double valueOf(double);
public static double parseDouble(java.lang.String);
# public static java.lang.Double valueOf(java.lang.String);
# public static java.lang.Double valueOf(double);
# public static double parseDouble(java.lang.String);
public static boolean isNaN(double);
public static boolean isInfinite(double);
public static long doubleToLongBits(double);

Binary file not shown.

View File

@@ -20,13 +20,13 @@ package baritone.api;
import baritone.api.behavior.ILookBehavior;
import baritone.api.behavior.IPathingBehavior;
import baritone.api.cache.IWorldProvider;
import baritone.api.command.manager.ICommandManager;
import baritone.api.event.listener.IEventBus;
import baritone.api.pathing.calc.IPathingControlManager;
import baritone.api.process.*;
import baritone.api.selection.ISelectionManager;
import baritone.api.utils.IInputOverrideHandler;
import baritone.api.utils.IPlayerContext;
import baritone.api.command.manager.ICommandManager;
/**
* @author Brady

View File

@@ -20,6 +20,7 @@ package baritone.api;
import baritone.api.cache.IWorldScanner;
import baritone.api.command.ICommand;
import baritone.api.command.ICommandSystem;
import baritone.api.schematic.ISchematicSystem;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import java.util.List;
@@ -82,4 +83,9 @@ public interface IBaritoneProvider {
* @return The {@link ICommandSystem} instance.
*/
ICommandSystem getCommandSystem();
/**
* @return The {@link ISchematicSystem} instance.
*/
ISchematicSystem getSchematicSystem();
}

View File

@@ -30,8 +30,8 @@ import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
import java.util.List;
import java.util.*;
import java.util.function.Consumer;
/**
@@ -61,6 +61,19 @@ public final class Settings {
*/
public final Setting<Boolean> allowInventory = new Setting<>(false);
/**
* Disable baritone's auto-tool at runtime, but still assume that another mod will provide auto tool functionality
* <p>
* Specifically, path calculation will still assume that an auto tool will run at execution time, even though
* Baritone itself will not do that.
*/
public final Setting<Boolean> assumeExternalAutoTool = new Setting<>(false);
/**
* If this setting is on, no auto tool will occur at all, not at calculation time nor execution time
*/
public final Setting<Boolean> disableAutoTool = new Setting<>(false);
/**
* It doesn't actually take twenty ticks to place a block, this cost is so high
* because we want to generally conserve blocks which might be limited.
@@ -181,6 +194,29 @@ public final class Settings {
Blocks.TRAPPED_CHEST
)));
/**
* A list of blocks to be treated as if they're air.
* <p>
* If a schematic asks for air at a certain position, and that position currently contains a block on this list, it will be treated as correct.
*/
public final Setting<List<Block>> buildIgnoreBlocks = new Setting<>(new ArrayList<>(Arrays.asList(
)));
/**
* A list of blocks to become air
* <p>
* If a schematic asks for a block on this list, only air will be accepted at that location (and nothing on buildIgnoreBlocks)
*/
public final Setting<List<Block>> okIfAir = new Setting<>(new ArrayList<>(Arrays.asList(
)));
/**
* If this is true, the builder will treat all non-air blocks as correct. It will only place new blocks.
*/
public final Setting<Boolean> buildIgnoreExisting = new Setting<>(false);
/**
* If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block.
* <p>
@@ -231,7 +267,7 @@ public final class Settings {
/**
* If we overshoot a traverse and end up one block beyond the destination, mark it as successful anyway.
* <p>
* This helps with speed at >=20m/s
* This helps with speed exceeding 20m/s
*/
public final Setting<Boolean> overshootTraverse = new Setting<>(true);
@@ -250,6 +286,11 @@ public final class Settings {
*/
public final Setting<Double> randomLooking113 = new Setting<>(2d);
/**
* Block reach distance
*/
public final Setting<Float> blockReachDistance = new Setting<>(4.5f);
/**
* How many degrees to randomize the pitch and yaw every tick. Set to 0 to disable
*/
@@ -413,6 +454,11 @@ public final class Settings {
*/
public final Setting<Boolean> simplifyUnloadedYCoord = new Setting<>(true);
/**
* Whenever a block changes, repack the whole chunk that it's in
*/
public final Setting<Boolean> repackOnAnyBlockChange = new Setting<>(true);
/**
* If a movement takes this many ticks more than its initial cost estimate, cancel it
*/
@@ -485,6 +531,18 @@ public final class Settings {
*/
public final Setting<Boolean> backfill = new Setting<>(false);
/**
* Shows popup message in the upper right corner, similarly to when you make an advancement
*/
public final Setting<Boolean> logAsToast = new Setting<>(false);
/**
* The time of how long the message in the pop-up will display
* <p>
* If below 1000L (1sec), it's better to disable this
*/
public final Setting<Long> toastTimer = new Setting<>(5000L);
/**
* Print all the debug messages to chat
*/
@@ -682,6 +740,23 @@ public final class Settings {
*/
public final Setting<Integer> maxCachedWorldScanCount = new Setting<>(10);
/**
* Sets the minimum y level whilst mining - set to 0 to turn off.
*/
public final Setting<Integer> minYLevelWhileMining = new Setting<>(0);
/**
* This will only allow baritone to mine exposed ores, can be used to stop ore obfuscators on servers that use them.
*/
public final Setting<Boolean> allowOnlyExposedOres = new Setting<>(false);
/**
* When allowOnlyExposedOres is enabled this is the distance around to search.
* <p>
* It is recommended to keep this value low, as it dramatically increases calculation times.
*/
public final Setting<Integer> allowOnlyExposedOresDistance = new Setting<>(1);
/**
* When GetToBlock doesn't know any locations for the desired block, explore randomly instead of giving up.
*/
@@ -735,11 +810,27 @@ public final class Settings {
*/
public final Setting<Boolean> layerOrder = new Setting<>(false);
/**
* Start building the schematic at a specific layer.
* Can help on larger builds when schematic wants to break things its already built
*/
public final Setting<Integer> startAtLayer = new Setting<>(0);
/**
* If a layer is unable to be constructed, just skip it.
*/
public final Setting<Boolean> skipFailedLayers = new Setting<>(false);
/**
* How far to move before repeating the build. 0 to disable repeating on a certain axis, 0,0,0 to disable entirely
*/
public final Setting<Vec3i> buildRepeat = new Setting<>(new Vec3i(0, 0, 0));
/**
* How many times to buildrepeat. -1 for infinite.
*/
public final Setting<Integer> buildRepeatCount = new Setting<>(-1);
/**
* Allow standing above a block while mining it, in BuilderProcess
* <p>
@@ -789,6 +880,12 @@ public final class Settings {
*/
public final Setting<Boolean> schematicOrientationZ = new Setting<>(false);
/**
* The fallback used by the build command when no extension is specified. This may be useful if schematics of a
* particular format are used often, and the user does not wish to have to specify the extension with every usage.
*/
public final Setting<String> schematicFallbackExtension = new Setting<>("schematic");
/**
* Distance to scan every tick for updates. Expanding this beyond player reach distance (i.e. setting it to 6 or above)
* is only necessary in very large schematics where rescanning the whole thing is costly.
@@ -1018,6 +1115,35 @@ public final class Settings {
*/
public final Setting<Boolean> renderSelectionCorners = new Setting<>(true);
/**
* Desktop notifications
*/
public final Setting<Boolean> desktopNotifications = new Setting<>(false);
/**
* Desktop notification on path complete
*/
public final Setting<Boolean> notificationOnPathComplete = new Setting<>(true);
/**
* Desktop notification on farm fail
*/
public final Setting<Boolean> notificationOnFarmFail = new Setting<>(true);
/**
* Desktop notification on build finished
*/
public final Setting<Boolean> notificationOnBuildFinished = new Setting<>(true);
/**
* Desktop notification on explore finished
*/
public final Setting<Boolean> notificationOnExploreFinished = new Setting<>(true);
/**
* Desktop notification on mine fail
*/
public final Setting<Boolean> notificationOnMineFail = new Setting<>(true);
/**
* A map of lowercase setting field names to their respective setting

View File

@@ -81,6 +81,4 @@ public interface ICachedWorld {
* in a new thread by default.
*/
void save();
}

View File

@@ -77,10 +77,20 @@ public interface IWorldScanner {
}
/**
* Repacks 40 chunks around the player.
* Overload of {@link #repack(IPlayerContext, int)} where the value of the {@code range} parameter is {@code 40}.
*
* @param ctx The player context for that player.
* @return The number of chunks queued for repacking.
* @param ctx The player, describing the origin
* @return The amount of chunks successfully queued for repacking
*/
int repack(IPlayerContext ctx);
/**
* Queues the chunks in a square formation around the specified player, using the specified
* range, which represents 1/2 the square's dimensions, where the player is in the center.
*
* @param ctx The player, describing the origin
* @param range The range to repack
* @return The amount of chunks successfully queued for repacking
*/
int repack(IPlayerContext ctx, int range);
}

View File

@@ -34,9 +34,8 @@ import java.util.stream.Stream;
* So basically, you should use it because it provides a small amount of boilerplate,
* but you're not forced to use it.
*
* @see ICommand
*
* @author LoganDark
* @see ICommand
*/
public abstract class Command implements ICommand {

View File

@@ -46,8 +46,8 @@ public interface IArgParserManager {
/**
* Attempt to parse the specified argument with a stateless {@link IArgParser} that outputs the specified class.
*
* @param type The type to try and parse the argument into.
* @param arg The argument to parse.
* @param type The type to try and parse the argument into.
* @param arg The argument to parse.
* @return An instance of the specified class.
* @throws CommandInvalidTypeException If the parsing failed
*/

View File

@@ -18,8 +18,6 @@
package baritone.api.command.argument;
import baritone.api.command.ICommand;
import baritone.api.command.exception.CommandTooManyArgumentsException;
import baritone.api.utils.Helper;
import baritone.api.command.argparser.IArgParser;
import baritone.api.command.datatypes.IDatatype;
import baritone.api.command.datatypes.IDatatypeFor;
@@ -27,6 +25,8 @@ import baritone.api.command.datatypes.IDatatypePost;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.api.command.exception.CommandNotEnoughArgumentsException;
import baritone.api.command.exception.CommandTooManyArgumentsException;
import baritone.api.utils.Helper;
import net.minecraft.util.Direction;
import java.util.Deque;
@@ -223,7 +223,7 @@ public interface IArgConsumer {
* @param type The type to peek as
* @param index The index to peek
* @return An instance of the specified type
* @throws CommandInvalidTypeException If the parsing failed
* @throws CommandInvalidTypeException If the parsing failed
* @see IArgParser
* @see #peekAs(Class)
* @see #peekAsOrDefault(Class, Object, int)
@@ -240,7 +240,7 @@ public interface IArgConsumer {
*
* @param type The type to peek as
* @return An instance of the specified type
* @throws CommandInvalidTypeException If the parsing failed
* @throws CommandInvalidTypeException If the parsing failed
* @see IArgParser
* @see #peekAs(Class, int)
* @see #peekAsOrDefault(Class, Object)
@@ -458,7 +458,7 @@ public interface IArgConsumer {
*
* @param type The type to peek as
* @return An instance of the specified type
* @throws CommandInvalidTypeException If the parsing failed
* @throws CommandInvalidTypeException If the parsing failed
* @see IArgParser
* @see #get()
* @see #getAsOrDefault(Class, Object)

View File

@@ -87,7 +87,7 @@ public interface ICommandArgument {
*
* @param type The class to parse this argument into
* @return An instance of the specified type
* @throws CommandInvalidTypeException If the parsing failed
* @throws CommandInvalidTypeException If the parsing failed
*/
<T, S> T getAs(Class<T> type, Class<S> stateType, S state) throws CommandInvalidTypeException;

View File

@@ -17,8 +17,8 @@
package baritone.api.command.datatypes;
import baritone.api.utils.BlockOptionalMeta;
import baritone.api.command.exception.CommandException;
import baritone.api.utils.BlockOptionalMeta;
import java.util.stream.Stream;

View File

@@ -17,8 +17,8 @@
package baritone.api.command.datatypes;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.command.exception.CommandException;
import baritone.api.command.helpers.TabCompleteHelper;
import net.minecraft.util.Direction;
import java.util.Locale;

View File

@@ -20,8 +20,8 @@ package baritone.api.command.datatypes;
import baritone.api.IBaritone;
import baritone.api.cache.IWaypoint;
import baritone.api.cache.IWaypointCollection;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.command.exception.CommandException;
import baritone.api.command.helpers.TabCompleteHelper;
import java.util.Comparator;
import java.util.stream.Stream;

View File

@@ -24,9 +24,8 @@ import baritone.api.command.argument.IArgConsumer;
* Provides an {@link IDatatype} with contextual information so
* that it can perform the desired operation on the target level.
*
* @see IDatatype
*
* @author Brady
* @see IDatatype
* @since 9/26/2019
*/
public interface IDatatypeContext {

View File

@@ -34,11 +34,10 @@ public interface IDatatypeFor<T> extends IDatatype {
* if the expected input does not conform to a parseable value. As far as a {@link CommandException} being
* thrown is concerned, see the note below for specifics.
*
* @see IDatatypeContext
*
* @param ctx The context
* @return The parsed data-type
* @throws CommandException If there was an issue parsing using another type or arguments could not be polled.
* @see IDatatypeContext
*/
T get(IDatatypeContext ctx) throws CommandException;
}

View File

@@ -18,8 +18,8 @@
package baritone.api.command.datatypes;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.exception.CommandException;
import baritone.api.utils.BetterBlockPos;
import java.util.stream.Stream;

View File

@@ -18,16 +18,13 @@
package baritone.api.command.datatypes;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.pathing.goals.Goal;
import baritone.api.pathing.goals.GoalBlock;
import baritone.api.pathing.goals.GoalXZ;
import baritone.api.pathing.goals.GoalYLevel;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.exception.CommandException;
import net.minecraft.util.math.MathHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
public enum RelativeGoal implements IDatatypePost<Goal, BetterBlockPos> {
@@ -38,38 +35,26 @@ public enum RelativeGoal implements IDatatypePost<Goal, BetterBlockPos> {
if (origin == null) {
origin = BetterBlockPos.ORIGIN;
}
final IArgConsumer consumer = ctx.getConsumer();
List<IDatatypePostFunction<Double, Double>> coords = new ArrayList<>();
final IArgConsumer copy = consumer.copy(); // This is a hack and should be fixed in the future probably
for (int i = 0; i < 3; i++) {
if (copy.peekDatatypeOrNull(RelativeCoordinate.INSTANCE) != null) {
coords.add(o -> consumer.getDatatypePost(RelativeCoordinate.INSTANCE, o));
copy.get(); // Consume so we actually decrement the remaining arguments
}
GoalBlock goalBlock = consumer.peekDatatypePostOrNull(RelativeGoalBlock.INSTANCE, origin);
if (goalBlock != null) {
return goalBlock;
}
switch (coords.size()) {
case 0:
return new GoalBlock(origin);
case 1:
return new GoalYLevel(
MathHelper.floor(coords.get(0).apply((double) origin.y))
);
case 2:
return new GoalXZ(
MathHelper.floor(coords.get(0).apply((double) origin.x)),
MathHelper.floor(coords.get(1).apply((double) origin.z))
);
case 3:
return new GoalBlock(
MathHelper.floor(coords.get(0).apply((double) origin.x)),
MathHelper.floor(coords.get(1).apply((double) origin.y)),
MathHelper.floor(coords.get(2).apply((double) origin.z))
);
default:
throw new IllegalStateException("Unexpected coords size: " + coords.size());
GoalXZ goalXZ = consumer.peekDatatypePostOrNull(RelativeGoalXZ.INSTANCE, origin);
if (goalXZ != null) {
return goalXZ;
}
GoalYLevel goalYLevel = consumer.peekDatatypePostOrNull(RelativeGoalYLevel.INSTANCE, origin);
if (goalYLevel != null) {
return goalYLevel;
}
// when the user doesn't input anything, default to the origin
return new GoalBlock(origin);
}
@Override

View File

@@ -18,9 +18,9 @@
package baritone.api.command.datatypes;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.pathing.goals.GoalBlock;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.exception.CommandException;
import net.minecraft.util.math.MathHelper;
import java.util.stream.Stream;

View File

@@ -18,9 +18,9 @@
package baritone.api.command.datatypes;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.pathing.goals.GoalXZ;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.exception.CommandException;
import net.minecraft.util.math.MathHelper;
import java.util.stream.Stream;
@@ -37,7 +37,7 @@ public enum RelativeGoalXZ implements IDatatypePost<GoalXZ, BetterBlockPos> {
final IArgConsumer consumer = ctx.getConsumer();
return new GoalXZ(
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)),
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.y))
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.z))
);
}

View File

@@ -18,9 +18,9 @@
package baritone.api.command.datatypes;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.pathing.goals.GoalYLevel;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.exception.CommandException;
import net.minecraft.util.math.MathHelper;
import java.util.stream.Stream;

View File

@@ -22,4 +22,8 @@ public abstract class CommandErrorMessageException extends CommandException {
protected CommandErrorMessageException(String reason) {
super(reason);
}
protected CommandErrorMessageException(String reason, Throwable cause) {
super(reason, cause);
}
}

View File

@@ -22,4 +22,8 @@ public abstract class CommandException extends Exception implements ICommandExce
protected CommandException(String reason) {
super(reason);
}
protected CommandException(String reason, Throwable cause) {
super(reason, cause);
}
}

View File

@@ -23,12 +23,21 @@ public abstract class CommandInvalidArgumentException extends CommandErrorMessag
public final ICommandArgument arg;
protected CommandInvalidArgumentException(ICommandArgument arg, String reason) {
super(String.format(
"Error at argument #%s: %s",
arg.getIndex() == -1 ? "<unknown>" : Integer.toString(arg.getIndex() + 1),
reason
));
protected CommandInvalidArgumentException(ICommandArgument arg, String message) {
super(formatMessage(arg, message));
this.arg = arg;
}
protected CommandInvalidArgumentException(ICommandArgument arg, String message, Throwable cause) {
super(formatMessage(arg, message), cause);
this.arg = arg;
}
private static String formatMessage(ICommandArgument arg, String message) {
return String.format(
"Error at argument #%s: %s",
arg.getIndex() == -1 ? "<unknown>" : Integer.toString(arg.getIndex() + 1),
message
);
}
}

View File

@@ -26,7 +26,7 @@ public class CommandInvalidTypeException extends CommandInvalidArgumentException
}
public CommandInvalidTypeException(ICommandArgument arg, String expected, Throwable cause) {
super(arg, String.format("Expected %s.\nMore details: %s", expected, cause.getMessage()));
super(arg, String.format("Expected %s", expected), cause);
}
public CommandInvalidTypeException(ICommandArgument arg, String expected, String got) {
@@ -34,6 +34,6 @@ public class CommandInvalidTypeException extends CommandInvalidArgumentException
}
public CommandInvalidTypeException(ICommandArgument arg, String expected, String got, Throwable cause) {
super(arg, String.format("Expected %s, but got %s instead.\nMore details: %s", expected, got, cause.getMessage()));
super(arg, String.format("Expected %s, but got %s instead", expected, got), cause);
}
}

View File

@@ -37,8 +37,8 @@ public class CommandUnhandledException extends RuntimeException implements IComm
@Override
public void handle(ICommand command, List<ICommandArgument> args) {
HELPER.logDirect("An unhandled exception occurred." +
"The error is in your game's log, please report this at https://github.com/cabaletta/baritone/issues",
HELPER.logDirect("An unhandled exception occurred. " +
"The error is in your game's log, please report this at https://github.com/cabaletta/baritone/issues",
TextFormatting.RED);
this.printStackTrace();

View File

@@ -38,8 +38,8 @@ import static baritone.api.utils.Helper.HELPER;
public interface ICommandException {
/**
* @see Exception#getMessage()
* @return The exception details
* @see Exception#getMessage()
*/
String getMessage();

View File

@@ -17,10 +17,10 @@
package baritone.api.command.helpers;
import baritone.api.utils.Helper;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.utils.Helper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;

View File

@@ -19,10 +19,10 @@ package baritone.api.command.helpers;
import baritone.api.BaritoneAPI;
import baritone.api.Settings;
import baritone.api.event.events.TabCompleteEvent;
import baritone.api.utils.SettingsUtil;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.manager.ICommandManager;
import baritone.api.event.events.TabCompleteEvent;
import baritone.api.utils.SettingsUtil;
import net.minecraft.util.ResourceLocation;
import java.util.Comparator;
@@ -236,7 +236,6 @@ public class TabCompleteHelper {
* Appends every command in the specified {@link ICommandManager} to this {@link TabCompleteHelper}
*
* @param manager A command manager
*
* @return This {@link TabCompleteHelper}
*/
public TabCompleteHelper addCommands(ICommandManager manager) {

View File

@@ -18,8 +18,8 @@
package baritone.api.event.events;
import baritone.api.event.events.type.EventState;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.IPacket;
import net.minecraft.network.NetworkManager;
/**
* @author Brady

View File

@@ -18,6 +18,8 @@
package baritone.api.event.events;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.Vec3d;
/**
* @author Brady
@@ -68,14 +70,14 @@ public final class RotationMoveEvent {
/**
* Called when the player's motion is updated.
*
* @see Entity#moveRelative(float, float, float, float)
* @see Entity#moveRelative(float, Vec3d)
*/
MOTION_UPDATE,
/**
* Called when the player jumps.
*
* @see LivingEntity#jump
* @see LivingEntity
*/
JUMP
}

View File

@@ -18,7 +18,6 @@
package baritone.api.event.events;
import baritone.api.event.events.type.Cancellable;
import baritone.api.event.events.type.Overrideable;
/**
* @author LoganDark

View File

@@ -19,22 +19,20 @@ package baritone.api.event.events;
import baritone.api.event.events.type.EventState;
import java.util.function.BiFunction;
public final class TickEvent {
private static int overallTickCount;
private final EventState state;
private final Type type;
private final int count;
private static int overallTickCount;
public TickEvent(EventState state, Type type) {
public TickEvent(EventState state, Type type, int count) {
this.state = state;
this.type = type;
this.count = incrementCount();
}
private static synchronized int incrementCount() {
return overallTickCount++;
this.count = count;
}
public int getCount() {
@@ -49,6 +47,10 @@ public final class TickEvent {
return state;
}
public static synchronized BiFunction<EventState, Type, TickEvent> createNextProvider() {
final int count = overallTickCount++;
return (state, type) -> new TickEvent(state, type, count);
}
public enum Type {
/**

View File

@@ -21,9 +21,10 @@ import baritone.api.event.events.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.gui.screen.DeathScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.network.IPacket;
import net.minecraft.util.math.Vec3d;
/**
* @author Brady
@@ -80,7 +81,7 @@ public interface IGameEventListener {
* Runs before and after whenever a new world is loaded
*
* @param event The event
* @see Minecraft#loadWorld(ClientWorld, Screen)
* @see Minecraft#loadWorld(ClientWorld)
*/
void onWorldEvent(WorldEvent event);
@@ -88,7 +89,7 @@ public interface IGameEventListener {
* Runs before a outbound packet is sent
*
* @param event The event
* @see Packet
* @see IPacket
*/
void onSendPacket(PacketEvent event);
@@ -96,7 +97,7 @@ public interface IGameEventListener {
* Runs before an inbound packet is processed
*
* @param event The event
* @see Packet
* @see IPacket
*/
void onReceivePacket(PacketEvent event);
@@ -105,7 +106,7 @@ public interface IGameEventListener {
* and before and after the player jumps.
*
* @param event The event
* @see Entity#moveRelative(float, float, float, float)
* @see Entity#moveRelative(float, Vec3d)
*/
void onPlayerRotationMove(RotationMoveEvent event);
@@ -125,9 +126,9 @@ public interface IGameEventListener {
void onBlockInteract(BlockInteractEvent event);
/**
* Called when the local player dies, as indicated by the creation of the {@link GuiGameOver} screen.
* Called when the local player dies, as indicated by the creation of the {@link DeathScreen} screen.
*
* @see GuiGameOver
* @see DeathScreen
*/
void onPlayerDeath();

View File

@@ -31,7 +31,7 @@ public class GoalRunAway implements Goal {
private final BlockPos[] from;
private final double distanceSq;
private final int distanceSq;
private final Integer maintainY;
@@ -44,7 +44,7 @@ public class GoalRunAway implements Goal {
throw new IllegalArgumentException();
}
this.from = from;
this.distanceSq = distance * distance;
this.distanceSq = (int) (distance * distance);
this.maintainY = maintainY;
}
@@ -56,7 +56,7 @@ public class GoalRunAway implements Goal {
for (BlockPos p : from) {
int diffX = x - p.getX();
int diffZ = z - p.getZ();
double distSq = diffX * diffX + diffZ * diffZ;
int distSq = diffX * diffX + diffZ * diffZ;
if (distSq < distanceSq) {
return false;
}

View File

@@ -75,7 +75,7 @@ public interface IBaritoneProcess {
* to start eating this tick. {@code PauseForAutoEatProcess} should only actually right click once onTick is called with
* {@code isSafeToCancel} true though.
*
* @return Whethor or not if this control is temporary
* @return Whether or not if this control is temporary
*/
boolean isTemporary();

View File

@@ -17,7 +17,29 @@
package baritone.api.process;
import net.minecraft.util.math.BlockPos;
public interface IFarmProcess extends IBaritoneProcess {
void farm();
/**
* Begin to search for crops to farm with in specified aria
* from specified location.
*
* @param range The distance from center to farm from
* @param pos The center position to base the range from
*/
void farm(int range, BlockPos pos);
/**
* Begin to search for nearby crops to farm.
*/
default void farm() {farm(0, null);}
/**
* Begin to search for crops to farm with in specified aria
* from the position the command was executed.
*
* @param range The distance to search for crops to farm
*/
default void farm(int range) {farm(range, null);}
}

View File

@@ -23,6 +23,10 @@ public abstract class AbstractSchematic implements ISchematic {
protected int y;
protected int z;
public AbstractSchematic() {
this(0, 0, 0);
}
public AbstractSchematic(int x, int y, int z) {
this.x = x;
this.y = y;

View File

@@ -32,6 +32,10 @@ public class FillSchematic extends AbstractSchematic {
this.bom = bom;
}
public FillSchematic(int x, int y, int z, BlockState state) {
this(x, y, z, new BlockOptionalMeta(state.getBlock()));
}
public BlockOptionalMeta getBom() {
return bom;
}

View File

@@ -0,0 +1,44 @@
/*
* 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.api.schematic;
import baritone.api.command.registry.Registry;
import baritone.api.schematic.format.ISchematicFormat;
import java.io.File;
import java.util.Optional;
/**
* @author Brady
* @since 12/23/2019
*/
public interface ISchematicSystem {
/**
* @return The registry of supported schematic formats
*/
Registry<ISchematicFormat> getRegistry();
/**
* Attempts to find an {@link ISchematicFormat} that supports the specified schematic file.
*
* @param file A schematic file
* @return The corresponding format for the file, {@link Optional#empty()} if no candidates were found.
*/
Optional<ISchematicFormat> getByFile(File file);
}

View File

@@ -0,0 +1,59 @@
/*
* 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.api.schematic;
import net.minecraft.block.BlockState;
/**
* A static schematic is capable of providing the desired state at a given position without
* additional context. Schematics of this type are expected to have non-varying contents.
*
* @author Brady
* @see #getDirect(int, int, int)
* @since 12/24/2019
*/
public interface IStaticSchematic extends ISchematic {
/**
* Gets the {@link BlockState} for a given position in this schematic. It should be guaranteed
* that the return value of this method will not change given that the parameters are the same.
*
* @param x The X block position
* @param y The Y block position
* @param z The Z block position
* @return The desired state at the specified position.
*/
BlockState getDirect(int x, int y, int z);
/**
* Returns an {@link BlockState} array of size {@link #heightY()} which contains all
* desired block states in the specified vertical column. The index of {@link BlockState}s
* in the array are equivalent to their Y position in the schematic.
*
* @param x The X column position
* @param z The Z column position
* @return An {@link BlockState} array
*/
default BlockState[] getColumn(int x, int z) {
BlockState[] column = new BlockState[this.heightY()];
for (int i = 0; i < this.heightY(); i++) {
column[i] = getDirect(x, i, z);
}
return column;
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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.api.schematic.format;
import baritone.api.schematic.ISchematic;
import baritone.api.schematic.IStaticSchematic;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/**
* The base of a {@link ISchematic} file format
*
* @author Brady
* @since 12/23/2019
*/
public interface ISchematicFormat {
/**
* @return The parser for creating schematics of this format
*/
IStaticSchematic parse(InputStream input) throws IOException;
/**
* @param file The file to check against
* @return Whether or not the specified file matches this schematic format
*/
boolean isFileType(File file);
}

View File

@@ -20,13 +20,11 @@ package baritone.api.utils;
import baritone.api.utils.accessor.IItemStack;
import com.google.common.collect.ImmutableSet;
import io.netty.util.concurrent.ThreadPerTaskExecutor;
import net.minecraft.block.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.resources.*;
import net.minecraft.state.IProperty;
import net.minecraft.state.properties.*;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Unit;
import net.minecraft.util.math.BlockPos;
@@ -36,7 +34,6 @@ import net.minecraft.world.storage.loot.*;
import javax.annotation.Nonnull;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -49,7 +46,6 @@ public final class BlockOptionalMeta {
private final ImmutableSet<Integer> stateHashes;
private final ImmutableSet<Integer> stackHashes;
private static final Pattern pattern = Pattern.compile("^(.+?)(?::(\\d+))?$");
private static final Map<Object, Object> normalizations;
private static LootTableManager manager;
private static Map<Block, List<Item>> drops = new HashMap<>();
@@ -81,142 +77,6 @@ public final class BlockOptionalMeta {
stackHashes = getStackHashes(blockstates);
}
static {
Map<Object, Object> _normalizations = new HashMap<>();
Consumer<Enum> put = instance -> _normalizations.put(instance.getClass(), instance);
put.accept(Direction.NORTH);
put.accept(Direction.Axis.Y);
put.accept(Half.BOTTOM);
put.accept(StairsShape.STRAIGHT);
put.accept(AttachFace.FLOOR);
put.accept(DoubleBlockHalf.UPPER);
put.accept(SlabType.BOTTOM);
put.accept(DoorHingeSide.LEFT);
put.accept(BedPart.HEAD);
put.accept(RailShape.NORTH_SOUTH);
_normalizations.put(BannerBlock.ROTATION, 0);
_normalizations.put(BedBlock.OCCUPIED, false);
_normalizations.put(BrewingStandBlock.HAS_BOTTLE[0], false);
_normalizations.put(BrewingStandBlock.HAS_BOTTLE[1], false);
_normalizations.put(BrewingStandBlock.HAS_BOTTLE[2], false);
_normalizations.put(AbstractButtonBlock.POWERED, false);
// _normalizations.put(BlockCactus.AGE, 0);
// _normalizations.put(BlockCauldron.LEVEL, 0);
// _normalizations.put(BlockChorusFlower.AGE, 0);
_normalizations.put(ChorusPlantBlock.NORTH, false);
_normalizations.put(ChorusPlantBlock.EAST, false);
_normalizations.put(ChorusPlantBlock.SOUTH, false);
_normalizations.put(ChorusPlantBlock.WEST, false);
_normalizations.put(ChorusPlantBlock.UP, false);
_normalizations.put(ChorusPlantBlock.DOWN, false);
// _normalizations.put(BlockCocoa.AGE, 0);
// _normalizations.put(BlockCrops.AGE, 0);
_normalizations.put(SnowyDirtBlock.SNOWY, false);
_normalizations.put(DoorBlock.OPEN, false);
_normalizations.put(DoorBlock.POWERED, false);
// _normalizations.put(BlockFarmland.MOISTURE, 0);
_normalizations.put(FenceBlock.NORTH, false);
_normalizations.put(FenceBlock.EAST, false);
_normalizations.put(FenceBlock.WEST, false);
_normalizations.put(FenceBlock.SOUTH, false);
// _normalizations.put(BlockFenceGate.POWERED, false);
// _normalizations.put(BlockFenceGate.IN_WALL, false);
_normalizations.put(FireBlock.AGE, 0);
_normalizations.put(FireBlock.NORTH, false);
_normalizations.put(FireBlock.EAST, false);
_normalizations.put(FireBlock.SOUTH, false);
_normalizations.put(FireBlock.WEST, false);
_normalizations.put(FireBlock.UP, false);
// _normalizations.put(BlockFrostedIce.AGE, 0);
_normalizations.put(GrassBlock.SNOWY, false);
// _normalizations.put(BlockHopper.ENABLED, true);
// _normalizations.put(BlockLever.POWERED, false);
// _normalizations.put(BlockLiquid.LEVEL, 0);
// _normalizations.put(BlockMycelium.SNOWY, false);
// _normalizations.put(BlockNetherWart.AGE, false);
_normalizations.put(LeavesBlock.DISTANCE, false);
// _normalizations.put(BlockLeaves.DECAYABLE, false);
// _normalizations.put(BlockObserver.POWERED, false);
_normalizations.put(PaneBlock.NORTH, false);
_normalizations.put(PaneBlock.EAST, false);
_normalizations.put(PaneBlock.WEST, false);
_normalizations.put(PaneBlock.SOUTH, false);
// _normalizations.put(BlockPistonBase.EXTENDED, false);
// _normalizations.put(BlockPressurePlate.POWERED, false);
// _normalizations.put(BlockPressurePlateWeighted.POWER, false);
// _normalizations.put(BlockRailDetector.POWERED, false);
// _normalizations.put(BlockRailPowered.POWERED, false);
_normalizations.put(RedstoneWireBlock.NORTH, false);
_normalizations.put(RedstoneWireBlock.EAST, false);
_normalizations.put(RedstoneWireBlock.SOUTH, false);
_normalizations.put(RedstoneWireBlock.WEST, false);
// _normalizations.put(BlockReed.AGE, false);
_normalizations.put(SaplingBlock.STAGE, 0);
_normalizations.put(StandingSignBlock.ROTATION, 0);
_normalizations.put(StemBlock.AGE, 0);
_normalizations.put(TripWireBlock.NORTH, false);
_normalizations.put(TripWireBlock.EAST, false);
_normalizations.put(TripWireBlock.WEST, false);
_normalizations.put(TripWireBlock.SOUTH, false);
_normalizations.put(VineBlock.NORTH, false);
_normalizations.put(VineBlock.EAST, false);
_normalizations.put(VineBlock.SOUTH, false);
_normalizations.put(VineBlock.WEST, false);
_normalizations.put(VineBlock.UP, false);
_normalizations.put(WallBlock.UP, false);
_normalizations.put(WallBlock.NORTH, false);
_normalizations.put(WallBlock.EAST, false);
_normalizations.put(WallBlock.WEST, false);
_normalizations.put(WallBlock.SOUTH, false);
normalizations = Collections.unmodifiableMap(_normalizations);
}
private static <C extends Comparable<C>, P extends IProperty<C>> P castToIProperty(Object value) {
//noinspection unchecked
return (P) value;
}
private static <C extends Comparable<C>, P extends IProperty<C>> C castToIPropertyValue(P iproperty, Object value) {
//noinspection unchecked
return (C) value;
}
public static BlockState normalize(BlockState state) {
BlockState newState = state;
for (IProperty<?> property : state.getProperties()) {
Class<?> valueClass = property.getValueClass();
if (normalizations.containsKey(property)) {
try {
newState = newState.with(
castToIProperty(property),
castToIPropertyValue(property, normalizations.get(property))
);
} catch (IllegalArgumentException ignored) {}
} else if (normalizations.containsKey(state.get(property))) {
try {
newState = newState.with(
castToIProperty(property),
castToIPropertyValue(property, normalizations.get(state.get(property)))
);
} catch (IllegalArgumentException ignored) {}
} else if (normalizations.containsKey(valueClass)) {
try {
newState = newState.with(
castToIProperty(property),
castToIPropertyValue(property, normalizations.get(valueClass))
);
} catch (IllegalArgumentException ignored) {}
}
}
return newState;
}
public static int stateMeta(BlockState state) {
return state.hashCode();
}
private static Set<BlockState> getStates(@Nonnull Block block) {
return new HashSet<>(block.getStateContainer().getValidStates());
}

View File

@@ -18,12 +18,14 @@
package baritone.api.utils;
import baritone.api.BaritoneAPI;
import baritone.api.utils.gui.BaritoneToast;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import java.util.Arrays;
import java.util.Calendar;
import java.util.stream.Stream;
/**
@@ -47,7 +49,9 @@ public interface Helper {
static ITextComponent getPrefix() {
// Inner text component
ITextComponent baritone = new StringTextComponent(BaritoneAPI.getSettings().shortBaritonePrefix.value ? "B" : "Baritone");
final Calendar now = Calendar.getInstance();
final boolean xd = now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) <= 3;
ITextComponent baritone = new StringTextComponent(xd ? "Baritoe" : BaritoneAPI.getSettings().shortBaritonePrefix.value ? "B" : "Baritone");
baritone.getStyle().setColor(TextFormatting.LIGHT_PURPLE);
// Outer brackets
@@ -60,6 +64,35 @@ public interface Helper {
return prefix;
}
/**
* Send a message to display as a toast popup
*
* @param title The title to display in the popup
* @param message The message to display in the popup
*/
default void logToast(ITextComponent title, ITextComponent message) {
mc.execute(() -> BaritoneToast.addOrUpdate(mc.getToastGui(), title, message, BaritoneAPI.getSettings().toastTimer.value));
}
/**
* Send a message to display as a toast popup
*
* @param title The title to display in the popup
* @param message The message to display in the popup
*/
default void logToast(String title, String message) {
logToast(new StringTextComponent(title), new StringTextComponent(message));
}
/**
* Send a message to display as a toast popup
*
* @param message The message to display in the popup
*/
default void logToast(String message) {
logToast(Helper.getPrefix(), new StringTextComponent(message));
}
/**
* Send a message to chat only if chatDebug is on
*
@@ -71,7 +104,27 @@ public interface Helper {
//System.out.println(message);
return;
}
logDirect(message);
// We won't log debug chat into toasts
// Because only a madman would want that extreme spam -_-
logDirect(message, false);
}
/**
* Send components to chat with the [Baritone] prefix
*
* @param logAsToast Whether to log as a toast notification
* @param components The components to send
*/
default void logDirect(boolean logAsToast, ITextComponent... components) {
ITextComponent component = new StringTextComponent("");
component.appendSibling(getPrefix());
component.appendSibling(new StringTextComponent(" "));
Arrays.asList(components).forEach(component::appendSibling);
if (logAsToast) {
logToast(getPrefix(), component);
} else {
mc.execute(() -> BaritoneAPI.getSettings().logger.value.accept(component));
}
}
/**
@@ -80,11 +133,23 @@ public interface Helper {
* @param components The components to send
*/
default void logDirect(ITextComponent... components) {
ITextComponent component = new StringTextComponent("");
component.appendSibling(getPrefix());
component.appendSibling(new StringTextComponent(" "));
Arrays.asList(components).forEach(component::appendSibling);
mc.execute(() -> BaritoneAPI.getSettings().logger.value.accept(component));
logDirect(BaritoneAPI.getSettings().logAsToast.value, components);
}
/**
* Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a
* direct response to a chat command)
*
* @param message The message to display in chat
* @param color The color to print that message in
* @param logAsToast Whether to log as a toast notification
*/
default void logDirect(String message, TextFormatting color, boolean logAsToast) {
Stream.of(message.split("\n")).forEach(line -> {
ITextComponent component = new StringTextComponent(line.replace("\t", " "));
component.getStyle().setColor(color);
logDirect(logAsToast, component);
});
}
/**
@@ -95,11 +160,18 @@ public interface Helper {
* @param color The color to print that message in
*/
default void logDirect(String message, TextFormatting color) {
Stream.of(message.split("\n")).forEach(line -> {
ITextComponent component = new StringTextComponent(line.replace("\t", " "));
component.getStyle().setColor(color);
logDirect(component);
});
logDirect(message, color, BaritoneAPI.getSettings().logAsToast.value);
}
/**
* Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a
* direct response to a chat command)
*
* @param message The message to display in chat
* @param logAsToast Whether to log as a toast notification
*/
default void logDirect(String message, boolean logAsToast) {
logDirect(message, TextFormatting.GRAY, logAsToast);
}
/**
@@ -109,6 +181,6 @@ public interface Helper {
* @param message The message to display in chat
*/
default void logDirect(String message) {
logDirect(message, TextFormatting.GRAY);
logDirect(message, BaritoneAPI.getSettings().logAsToast.value);
}
}

View File

@@ -22,7 +22,10 @@ import net.minecraft.block.SlabBlock;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import java.util.Optional;
@@ -87,6 +90,10 @@ public interface IPlayerContext {
return new Rotation(player().rotationYaw, player().rotationPitch);
}
static double eyeHeight(boolean ifSneaking) {
return ifSneaking ? 1.27 : 1.62;
}
/**
* Returns the block that the crosshair is currently placed over. Updated once per tick.
*
@@ -103,17 +110,4 @@ public interface IPlayerContext {
default boolean isLookingAt(BlockPos pos) {
return getSelectedBlock().equals(Optional.of(pos));
}
/**
* Returns the entity that the crosshair is currently placed over. Updated once per tick.
*
* @return The entity
*/
default Optional<Entity> getSelectedEntity() {
RayTraceResult result = objectMouseOver();
if (result != null && result.getType() == RayTraceResult.Type.ENTITY) {
return Optional.of(((EntityRayTraceResult) result).getEntity());
}
return Optional.empty();
}
}

View File

@@ -17,6 +17,7 @@
package baritone.api.utils;
import baritone.api.BaritoneAPI;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ClickType;
@@ -56,6 +57,6 @@ public interface IPlayerController {
void setHittingBlock(boolean hittingBlock);
default double getBlockReachDistance() {
return this.getGameType().isCreative() ? 5.0F : 4.5F;
return this.getGameType().isCreative() ? 5.0F : BaritoneAPI.getSettings().blockReachDistance.value;
}
}

View File

@@ -41,7 +41,16 @@ public final class RayTraceUtils {
* @return The calculated raytrace result
*/
public static RayTraceResult rayTraceTowards(Entity entity, Rotation rotation, double blockReachDistance) {
Vec3d start = entity.getEyePosition(1.0F);
return rayTraceTowards(entity, rotation, blockReachDistance, false);
}
public static RayTraceResult rayTraceTowards(Entity entity, Rotation rotation, double blockReachDistance, boolean wouldSneak) {
Vec3d start;
if (wouldSneak) {
start = inferSneakingEyePosition(entity);
} else {
start = entity.getEyePosition(1.0F); // do whatever is correct
}
Vec3d direction = RotationUtils.calcVec3dFromRotation(rotation);
Vec3d end = start.add(
direction.x * blockReachDistance,
@@ -50,4 +59,8 @@ public final class RayTraceUtils {
);
return entity.world.rayTraceBlocks(new RayTraceContext(start, end, RayTraceContext.BlockMode.OUTLINE, RayTraceContext.FluidMode.NONE, entity));
}
public static Vec3d inferSneakingEyePosition(Entity entity) {
return new Vec3d(entity.posX, entity.posY + IPlayerContext.eyeHeight(true), entity.posZ);
}
}

View File

@@ -143,6 +143,10 @@ public final class RotationUtils {
return reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance());
}
public static Optional<Rotation> reachable(IPlayerContext ctx, BlockPos pos, boolean wouldSneak) {
return reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance(), wouldSneak);
}
/**
* Determines if the specified entity is able to reach the center of any of the sides
* of the specified block. It first checks if the block center is reachable, and if so,
@@ -156,6 +160,10 @@ public final class RotationUtils {
* @return The optional rotation
*/
public static Optional<Rotation> reachable(ClientPlayerEntity entity, BlockPos pos, double blockReachDistance) {
return reachable(entity, pos, blockReachDistance, false);
}
public static Optional<Rotation> reachable(ClientPlayerEntity entity, BlockPos pos, double blockReachDistance, boolean wouldSneak) {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(entity);
if (baritone.getPlayerContext().isLookingAt(pos)) {
/*
@@ -168,9 +176,18 @@ public final class RotationUtils {
*
* or if you're a normal person literally all this does it ensure that we don't nudge the pitch to a normal level
*/
return Optional.of(new Rotation(entity.rotationYaw, entity.rotationPitch + 0.0001F));
Rotation hypothetical = new Rotation(entity.rotationYaw, entity.rotationPitch + 0.0001F);
if (wouldSneak) {
// the concern here is: what if we're looking at it now, but as soon as we start sneaking we no longer are
RayTraceResult result = RayTraceUtils.rayTraceTowards(entity, hypothetical, blockReachDistance, true);
if (result != null && result.getType() == RayTraceResult.Type.BLOCK && ((BlockRayTraceResult) result).getPos().equals(pos)) {
return Optional.of(hypothetical); // yes, if we sneaked we would still be looking at the block
}
} else {
return Optional.of(hypothetical);
}
}
Optional<Rotation> possibleRotation = reachableCenter(entity, pos, blockReachDistance);
Optional<Rotation> possibleRotation = reachableCenter(entity, pos, blockReachDistance, wouldSneak);
//System.out.println("center: " + possibleRotation);
if (possibleRotation.isPresent()) {
return possibleRotation;
@@ -185,7 +202,7 @@ public final class RotationUtils {
double xDiff = shape.getStart(Direction.Axis.X) * sideOffset.x + shape.getEnd(Direction.Axis.X) * (1 - sideOffset.x);
double yDiff = shape.getStart(Direction.Axis.Y) * sideOffset.y + shape.getEnd(Direction.Axis.Y) * (1 - sideOffset.y);
double zDiff = shape.getStart(Direction.Axis.Z) * sideOffset.z + shape.getEnd(Direction.Axis.Z) * (1 - sideOffset.z);
possibleRotation = reachableOffset(entity, pos, new Vec3d(pos).add(xDiff, yDiff, zDiff), blockReachDistance);
possibleRotation = reachableOffset(entity, pos, new Vec3d(pos).add(xDiff, yDiff, zDiff), blockReachDistance, wouldSneak);
if (possibleRotation.isPresent()) {
return possibleRotation;
}
@@ -204,9 +221,10 @@ public final class RotationUtils {
* @param blockReachDistance The block reach distance of the entity
* @return The optional rotation
*/
public static Optional<Rotation> reachableOffset(Entity entity, BlockPos pos, Vec3d offsetPos, double blockReachDistance) {
Rotation rotation = calcRotationFromVec3d(entity.getEyePosition(1.0F), offsetPos, new Rotation(entity.rotationYaw, entity.rotationPitch));
RayTraceResult result = RayTraceUtils.rayTraceTowards(entity, rotation, blockReachDistance);
public static Optional<Rotation> reachableOffset(Entity entity, BlockPos pos, Vec3d offsetPos, double blockReachDistance, boolean wouldSneak) {
Vec3d eyes = wouldSneak ? RayTraceUtils.inferSneakingEyePosition(entity) : entity.getEyePosition(1.0F);
Rotation rotation = calcRotationFromVec3d(eyes, offsetPos, new Rotation(entity.rotationYaw, entity.rotationPitch));
RayTraceResult result = RayTraceUtils.rayTraceTowards(entity, rotation, blockReachDistance, wouldSneak);
//System.out.println(result);
if (result != null && result.getType() == RayTraceResult.Type.BLOCK) {
if (((BlockRayTraceResult) result).getPos().equals(pos)) {
@@ -228,7 +246,7 @@ public final class RotationUtils {
* @param blockReachDistance The block reach distance of the entity
* @return The optional rotation
*/
public static Optional<Rotation> reachableCenter(Entity entity, BlockPos pos, double blockReachDistance) {
return reachableOffset(entity, pos, VecUtils.calculateBlockCenter(entity.world, pos), blockReachDistance);
public static Optional<Rotation> reachableCenter(Entity entity, BlockPos pos, double blockReachDistance, boolean wouldSneak) {
return reachableOffset(entity, pos, VecUtils.calculateBlockCenter(entity.world, pos), blockReachDistance, wouldSneak);
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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.api.utils.gui;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.toasts.IToast;
import net.minecraft.client.gui.toasts.ToastGui;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
public class BaritoneToast implements IToast {
private String title;
private String subtitle;
private long firstDrawTime;
private boolean newDisplay;
private long totalShowTime;
public BaritoneToast(ITextComponent titleComponent, ITextComponent subtitleComponent, long totalShowTime) {
this.title = titleComponent.getFormattedText();
this.subtitle = subtitleComponent == null ? null : subtitleComponent.getFormattedText();
this.totalShowTime = totalShowTime;
}
public Visibility draw(ToastGui toastGui, long delta) {
if (this.newDisplay) {
this.firstDrawTime = delta;
this.newDisplay = false;
}
toastGui.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/toasts.png"));
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 255.0f);
toastGui.blit(0, 0, 0, 32, 160, 32);
if (this.subtitle == null) {
toastGui.getMinecraft().fontRenderer.drawString(this.title, 18, 12, -11534256);
} else {
toastGui.getMinecraft().fontRenderer.drawString(this.title, 18, 7, -11534256);
toastGui.getMinecraft().fontRenderer.drawString(this.subtitle, 18, 18, -16777216);
}
return delta - this.firstDrawTime < totalShowTime ? Visibility.SHOW : Visibility.HIDE;
}
public void setDisplayedText(ITextComponent titleComponent, ITextComponent subtitleComponent) {
this.title = titleComponent.getFormattedText();
this.subtitle = subtitleComponent == null ? null : subtitleComponent.getFormattedText();
this.newDisplay = true;
}
public static void addOrUpdate(ToastGui toast, ITextComponent title, ITextComponent subtitle, long totalShowTime) {
BaritoneToast baritonetoast = toast.getToast(BaritoneToast.class, new Object());
if (baritonetoast == null) {
toast.add(new BaritoneToast(title, subtitle, totalShowTime));
} else {
baritonetoast.setDisplayedText(title, subtitle);
}
}
}

View File

@@ -17,14 +17,16 @@
package baritone.launch.mixins;
import baritone.Baritone;
import baritone.api.BaritoneAPI;
import baritone.api.IBaritone;
import baritone.api.event.events.ChunkEvent;
import baritone.api.event.events.type.EventState;
import baritone.cache.CachedChunk;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.network.play.ClientPlayNetHandler;
import net.minecraft.network.play.server.SChunkDataPacket;
import net.minecraft.network.play.server.SCombatPacket;
import net.minecraft.network.play.server.SUnloadChunkPacket;
import net.minecraft.network.play.server.*;
import net.minecraft.util.math.ChunkPos;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -47,7 +49,8 @@ public class MixinClientPlayNetHandler {
)
private void preRead(SPacketChunkData packetIn, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
if (ibaritone.getPlayerContext().player().connection == (NetHandlerPlayClient) (Object) this) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(
EventState.PRE,
@@ -66,7 +69,8 @@ public class MixinClientPlayNetHandler {
)
private void postHandleChunkData(SChunkDataPacket packetIn, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
if (ibaritone.getPlayerContext().player().connection == (ClientPlayNetHandler) (Object) this) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(
EventState.POST,
@@ -85,7 +89,8 @@ public class MixinClientPlayNetHandler {
)
private void preChunkUnload(SUnloadChunkPacket packet, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
if (ibaritone.getPlayerContext().player().connection == (ClientPlayNetHandler) (Object) this) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(EventState.PRE, ChunkEvent.Type.UNLOAD, packet.getX(), packet.getZ())
);
@@ -99,7 +104,8 @@ public class MixinClientPlayNetHandler {
)
private void postChunkUnload(SUnloadChunkPacket packet, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
if (ibaritone.getPlayerContext().player().connection == (ClientPlayNetHandler) (Object) this) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(EventState.POST, ChunkEvent.Type.UNLOAD, packet.getX(), packet.getZ())
);
@@ -107,6 +113,69 @@ public class MixinClientPlayNetHandler {
}
}
@Inject(
method = "handleBlockChange",
at = @At("RETURN")
)
private void postHandleBlockChange(SChangeBlockPacket packetIn, CallbackInfo ci) {
if (!Baritone.settings().repackOnAnyBlockChange.value) {
return;
}
if (!CachedChunk.BLOCKS_TO_KEEP_TRACK_OF.contains(packetIn.getState().getBlock())) {
return;
}
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(
EventState.POST,
ChunkEvent.Type.POPULATE_FULL,
packetIn.getPos().getX() >> 4,
packetIn.getPos().getZ() >> 4
)
);
}
}
}
@Inject(
method = "handleMultiBlockChange",
at = @At("RETURN")
)
private void postHandleMultiBlockChange(SMultiBlockChangePacket packetIn, CallbackInfo ci) {
if (!Baritone.settings().repackOnAnyBlockChange.value) {
return;
}
if (packetIn.getChangedBlocks().length == 0) {
return;
}
https:
//docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.15
{
for (SMultiBlockChangePacket.UpdateData update : packetIn.getChangedBlocks()) {
if (CachedChunk.BLOCKS_TO_KEEP_TRACK_OF.contains(update.getBlockState().getBlock())) {
break https;
}
}
return;
}
ChunkPos pos = new ChunkPos(packetIn.getChangedBlocks()[0].getPos());
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(
EventState.POST,
ChunkEvent.Type.POPULATE_FULL,
pos.x,
pos.z
)
);
}
}
}
@Inject(
method = "handleCombatEvent",
at = @At(
@@ -116,7 +185,8 @@ public class MixinClientPlayNetHandler {
)
private void onPlayerDeath(SCombatPacket packetIn, CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
if (ibaritone.getPlayerContext().player().connection == (ClientPlayNetHandler) (Object) this) {
ClientPlayerEntity player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPlayNetHandler) (Object) this) {
ibaritone.getGameEventHandler().onPlayerDeath();
}
}

View File

@@ -24,7 +24,6 @@ import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

View File

@@ -23,7 +23,6 @@ import baritone.api.event.events.BlockInteractEvent;
import baritone.api.event.events.TickEvent;
import baritone.api.event.events.WorldEvent;
import baritone.api.event.events.type.EventState;
import baritone.utils.BaritoneAutoTest;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.gui.screen.Screen;
@@ -41,6 +40,8 @@ import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.function.BiFunction;
/**
* @author Brady
* @since 7/31/2018
@@ -61,17 +62,6 @@ public class MixinMinecraft {
BaritoneAPI.getProvider().getPrimaryBaritone();
}
@Inject(
method = "init",
at = @At(
value = "INVOKE",
target = "net/minecraft/client/Minecraft.startTimerHackThread()V"
)
)
private void preInit(CallbackInfo ci) {
BaritoneAutoTest.INSTANCE.onPreInit();
}
@Inject(
method = "runTick",
at = @At(
@@ -84,13 +74,15 @@ public class MixinMinecraft {
)
)
private void runTick(CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
final BiFunction<EventState, TickEvent.Type, TickEvent> tickProvider = TickEvent.createNextProvider();
TickEvent.Type type = ibaritone.getPlayerContext().player() != null && ibaritone.getPlayerContext().world() != null
for (IBaritone baritone : BaritoneAPI.getProvider().getAllBaritones()) {
TickEvent.Type type = baritone.getPlayerContext().player() != null && baritone.getPlayerContext().world() != null
? TickEvent.Type.IN
: TickEvent.Type.OUT;
ibaritone.getGameEventHandler().onTick(new TickEvent(EventState.PRE, type));
baritone.getGameEventHandler().onTick(tickProvider.apply(EventState.PRE, type));
}
}
@@ -141,7 +133,7 @@ public class MixinMinecraft {
)
private boolean passEvents(Screen screen) {
// allow user input is only the primary baritone
return (BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().getCurrent() != null && player != null) || screen.passEvents;
return (BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing() && player != null) || screen.passEvents;
}
@Inject(

View File

@@ -29,5 +29,5 @@ public abstract class MixinScreen implements IGuiScreen {
@Override
@Invoker("openLink")
public abstract void openLink(URI url);
public abstract void openLinkInvoker(URI url);
}

View File

@@ -25,11 +25,14 @@ import baritone.api.utils.Helper;
import baritone.api.utils.IPlayerContext;
import baritone.behavior.*;
import baritone.cache.WorldProvider;
import baritone.command.manager.CommandManager;
import baritone.event.GameEventHandler;
import baritone.process.*;
import baritone.selection.SelectionManager;
import baritone.utils.*;
import baritone.command.manager.CommandManager;
import baritone.utils.BlockStateInterface;
import baritone.utils.GuiClick;
import baritone.utils.InputOverrideHandler;
import baritone.utils.PathingControlManager;
import baritone.utils.player.PrimaryPlayerContext;
import net.minecraft.client.Minecraft;
@@ -104,23 +107,19 @@ public class Baritone implements IBaritone {
this.pathingControlManager = new PathingControlManager(this);
{
followProcess = new FollowProcess(this);
mineProcess = new MineProcess(this);
customGoalProcess = new CustomGoalProcess(this); // very high iq
getToBlockProcess = new GetToBlockProcess(this);
builderProcess = new BuilderProcess(this);
exploreProcess = new ExploreProcess(this);
backfillProcess = new BackfillProcess(this);
farmProcess = new FarmProcess(this);
this.pathingControlManager.registerProcess(followProcess = new FollowProcess(this));
this.pathingControlManager.registerProcess(mineProcess = new MineProcess(this));
this.pathingControlManager.registerProcess(customGoalProcess = new CustomGoalProcess(this)); // very high iq
this.pathingControlManager.registerProcess(getToBlockProcess = new GetToBlockProcess(this));
this.pathingControlManager.registerProcess(builderProcess = new BuilderProcess(this));
this.pathingControlManager.registerProcess(exploreProcess = new ExploreProcess(this));
this.pathingControlManager.registerProcess(backfillProcess = new BackfillProcess(this));
this.pathingControlManager.registerProcess(farmProcess = new FarmProcess(this));
}
this.worldProvider = new WorldProvider();
this.selectionManager = new SelectionManager(this);
this.commandManager = new CommandManager(this);
if (BaritoneAutoTest.ENABLE_AUTO_TEST) {
this.gameEventHandler.registerEventListener(BaritoneAutoTest.INSTANCE);
}
}
@Override

View File

@@ -21,9 +21,11 @@ import baritone.api.IBaritone;
import baritone.api.IBaritoneProvider;
import baritone.api.cache.IWorldScanner;
import baritone.api.command.ICommandSystem;
import baritone.command.BaritoneChatControl;
import baritone.api.schematic.ISchematicSystem;
import baritone.cache.WorldScanner;
import baritone.command.CommandSystem;
import baritone.command.ExampleBaritoneControl;
import baritone.utils.schematic.SchematicSystem;
import java.util.Collections;
import java.util.List;
@@ -42,7 +44,7 @@ public final class BaritoneProvider implements IBaritoneProvider {
this.all = Collections.singletonList(this.primary);
// Setup chat control, just for the primary instance
new BaritoneChatControl(this.primary);
new ExampleBaritoneControl(this.primary);
}
@Override
@@ -64,4 +66,9 @@ public final class BaritoneProvider implements IBaritoneProvider {
public ICommandSystem getCommandSystem() {
return CommandSystem.INSTANCE;
}
@Override
public ISchematicSystem getSchematicSystem() {
return SchematicSystem.INSTANCE;
}
}

View File

@@ -0,0 +1,21 @@
/*
* 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;
// Annotation for classes and class members that should not be renamed by proguard
public @interface KeepName {}

View File

@@ -103,7 +103,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
@Override
public void onPlayerSprintState(SprintStateEvent event) {
if (current != null) {
if (isPathing()) {
event.setState(current.isSprinting());
}
}

View File

@@ -26,6 +26,7 @@ import baritone.api.utils.Helper;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.Chunk;
import java.io.IOException;
@@ -33,6 +34,8 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
/**
@@ -56,7 +59,17 @@ public final class CachedWorld implements ICachedWorld, Helper {
*/
private final String directory;
private final LinkedBlockingQueue<Chunk> toPack = new LinkedBlockingQueue<>();
/**
* Queue of positions to pack. Refers to the toPackMap, in that every element of this queue will be a
* key in that map.
*/
private final LinkedBlockingQueue<ChunkPos> toPackQueue = new LinkedBlockingQueue<>();
/**
* All chunk positions pending packing. This map will be updated in-place if a new update to the chunk occurs
* while waiting in the queue for the packer thread to get to it.
*/
private final Map<ChunkPos, Chunk> toPackMap = new ConcurrentHashMap<>();
private final int dimension;
@@ -89,10 +102,8 @@ public final class CachedWorld implements ICachedWorld, Helper {
@Override
public final void queueForPacking(Chunk chunk) {
try {
toPack.put(chunk);
} catch (InterruptedException e) {
e.printStackTrace();
if (toPackMap.put(chunk.getPos(), chunk) == null) {
toPackQueue.add(chunk.getPos());
}
}
@@ -184,7 +195,9 @@ public final class CachedWorld implements ICachedWorld, Helper {
int distZ = ((region.getZ() << 9) + 256) - pruneCenter.getZ();
double dist = Math.sqrt(distX * distX + distZ * distZ);
if (dist > 1024) {
logDebug("Deleting cached region " + region.getX() + "," + region.getZ() + " from ram");
if (!Baritone.settings().censorCoordinates.value) {
logDebug("Deleting cached region " + region.getX() + "," + region.getZ() + " from ram");
}
cachedRegions.remove(getRegionID(region.getX(), region.getZ()));
}
}
@@ -291,13 +304,9 @@ public final class CachedWorld implements ICachedWorld, Helper {
public void run() {
while (true) {
// TODO: Add CachedWorld unloading to remove the redundancy of having this
LinkedBlockingQueue<Chunk> queue = toPack;
if (queue == null) {
break;
}
try {
Chunk chunk = queue.take();
ChunkPos pos = toPackQueue.take();
Chunk chunk = toPackMap.remove(pos);
CachedChunk cached = ChunkPacker.pack(chunk);
CachedWorld.this.updateCachedChunk(cached);
//System.out.println("Processed chunk at " + chunk.x + "," + chunk.z);

View File

@@ -27,6 +27,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.multiplayer.ClientChunkProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.AbstractChunkProvider;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
@@ -109,6 +110,41 @@ public enum WorldScanner implements IWorldScanner {
return res;
}
@Override
public int repack(IPlayerContext ctx) {
return this.repack(ctx, 40);
}
@Override
public int repack(IPlayerContext ctx, int range) {
AbstractChunkProvider chunkProvider = ctx.world().getChunkProvider();
ICachedWorld cachedWorld = ctx.worldData().getCachedWorld();
BetterBlockPos playerPos = ctx.playerFeet();
int playerChunkX = playerPos.getX() >> 4;
int playerChunkZ = playerPos.getZ() >> 4;
int minX = playerChunkX - range;
int minZ = playerChunkZ - range;
int maxX = playerChunkX + range;
int maxZ = playerChunkZ + range;
int queued = 0;
for (int x = minX; x <= maxX; x++) {
for (int z = minZ; z <= maxZ; z++) {
Chunk chunk = chunkProvider.getChunk(x, z, false);
if (chunk != null && !chunk.isEmpty()) {
queued++;
cachedWorld.queueForPacking(chunk);
}
}
}
return queued;
}
private boolean scanChunkInto(int chunkX, int chunkZ, Chunk chunk, BlockOptionalMetaLookup filter, Collection<BlockPos> result, int max, int yLevelThreshold, int playerY, int[] coordinateIterationOrder) {
ChunkSection[] chunkInternalStorageArray = chunk.getSections();
boolean foundWithinY = false;
@@ -145,26 +181,4 @@ public enum WorldScanner implements IWorldScanner {
}
return foundWithinY;
}
public int repack(IPlayerContext ctx) {
ClientChunkProvider chunkProvider = (ClientChunkProvider) ctx.world().getChunkProvider();
ICachedWorld cachedWorld = ctx.worldData().getCachedWorld();
BetterBlockPos playerPos = ctx.playerFeet();
int playerChunkX = playerPos.getX() >> 4;
int playerChunkZ = playerPos.getZ() >> 4;
int queued = 0;
for (int x = playerChunkX - 40; x <= playerChunkX + 40; x++) {
for (int z = playerChunkZ - 40; z <= playerChunkZ + 40; z++) {
Chunk chunk = chunkProvider.getChunk(x, z, null, false);
if (chunk != null && !chunk.isEmpty()) {
queued++;
cachedWorld.queueForPacking(chunk);
}
}
}
return queued;
}
}

View File

@@ -18,8 +18,8 @@
package baritone.command;
import baritone.api.command.ICommandSystem;
import baritone.command.argparser.ArgParserManager;
import baritone.api.command.argparser.IArgParserManager;
import baritone.command.argparser.ArgParserManager;
/**
* @author Brady

View File

@@ -20,20 +20,20 @@ package baritone.command;
import baritone.api.BaritoneAPI;
import baritone.api.IBaritone;
import baritone.api.Settings;
import baritone.utils.accessor.IGuiScreen;
import baritone.api.command.argument.ICommandArgument;
import baritone.api.command.exception.CommandNotEnoughArgumentsException;
import baritone.api.command.exception.CommandNotFoundException;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.command.manager.ICommandManager;
import baritone.api.event.events.ChatEvent;
import baritone.api.event.events.TabCompleteEvent;
import baritone.api.event.listener.AbstractGameEventListener;
import baritone.api.utils.Helper;
import baritone.api.utils.SettingsUtil;
import baritone.api.command.argument.ICommandArgument;
import baritone.api.command.exception.CommandNotEnoughArgumentsException;
import baritone.api.command.exception.CommandNotFoundException;
import baritone.command.argument.ArgConsumer;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.command.manager.ICommandManager;
import baritone.command.argument.CommandArguments;
import baritone.command.manager.CommandManager;
import baritone.utils.accessor.IGuiScreen;
import net.minecraft.util.Tuple;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
@@ -49,12 +49,12 @@ import java.util.stream.Stream;
import static baritone.api.command.IBaritoneChatControl.FORCE_COMMAND_PREFIX;
public class BaritoneChatControl implements Helper, AbstractGameEventListener {
public class ExampleBaritoneControl implements Helper, AbstractGameEventListener {
private static final Settings settings = BaritoneAPI.getSettings();
private final ICommandManager manager;
public BaritoneChatControl(IBaritone baritone) {
public ExampleBaritoneControl(IBaritone baritone) {
this.manager = baritone.getCommandManager();
baritone.getGameEventHandler().registerEventListener(this);
}
@@ -100,7 +100,7 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener {
return false;
} else if (msg.trim().equalsIgnoreCase("orderpizza")) {
try {
((IGuiScreen) mc.currentScreen).openLink(new URI("https://www.dominos.com/en/pages/order/"));
((IGuiScreen) mc.currentScreen).openLinkInvoker(new URI("https://www.dominos.com/en/pages/order/"));
} catch (NullPointerException | URISyntaxException ignored) {}
return false;
}

View File

@@ -18,6 +18,7 @@
package baritone.command.argument;
import baritone.api.IBaritone;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.argument.ICommandArgument;
import baritone.api.command.datatypes.IDatatype;
import baritone.api.command.datatypes.IDatatypeContext;
@@ -27,7 +28,6 @@ import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.api.command.exception.CommandNotEnoughArgumentsException;
import baritone.api.command.exception.CommandTooManyArgumentsException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.manager.ICommandManager;
import java.util.ArrayList;
@@ -316,8 +316,7 @@ public class ArgConsumer implements IArgConsumer {
try {
return datatype.apply(this.context, original);
} catch (Exception e) {
e.printStackTrace();
throw new CommandInvalidTypeException(hasAny() ? peek() : consumed(), datatype.getClass().getSimpleName());
throw new CommandInvalidTypeException(hasAny() ? peek() : consumed(), datatype.getClass().getSimpleName(), e);
}
}
@@ -346,7 +345,7 @@ public class ArgConsumer implements IArgConsumer {
try {
return datatype.get(this.context);
} catch (Exception e) {
throw new CommandInvalidTypeException(hasAny() ? peek() : consumed(), datatype.getClass().getSimpleName());
throw new CommandInvalidTypeException(hasAny() ? peek() : consumed(), datatype.getClass().getSimpleName(), e);
}
}

View File

@@ -17,9 +17,9 @@
package baritone.command.argument;
import baritone.command.argparser.ArgParserManager;
import baritone.api.command.argument.ICommandArgument;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.command.argparser.ArgParserManager;
import java.util.stream.Stream;

View File

@@ -48,9 +48,9 @@ public final class CommandArguments {
int lastEnd = -1;
while (argMatcher.find()) {
args.add(new CommandArgument(
args.size(),
argMatcher.group(),
string.substring(argMatcher.start())
args.size(),
argMatcher.group(),
string.substring(argMatcher.start())
));
lastEnd = argMatcher.end();
}

View File

@@ -18,11 +18,11 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.pathing.goals.Goal;
import baritone.api.pathing.goals.GoalAxis;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import java.util.Arrays;
import java.util.List;

View File

@@ -18,11 +18,11 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.process.IGetToBlockProcess;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.process.IGetToBlockProcess;
import java.util.Arrays;
import java.util.List;

View File

@@ -17,20 +17,20 @@
package baritone.command.defaults;
import baritone.Baritone;
import baritone.api.IBaritone;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.RelativeBlockPos;
import baritone.api.command.datatypes.RelativeFile;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import net.minecraft.client.Minecraft;
import baritone.api.utils.BetterBlockPos;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.stream.Stream;
public class BuildCommand extends Command {
@@ -44,8 +44,8 @@ public class BuildCommand extends Command {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
File file = args.getDatatypePost(RelativeFile.INSTANCE, schematicsDir).getAbsoluteFile();
if (!file.getName().toLowerCase(Locale.US).endsWith(".schematic")) {
file = new File(file.getAbsolutePath() + ".schematic");
if (FilenameUtils.getExtension(file.getAbsolutePath()).isEmpty()) {
file = new File(file.getAbsolutePath() + "." + Baritone.settings().schematicFallbackExtension.value);
}
BetterBlockPos origin = ctx.playerFeet();
BetterBlockPos buildOrigin;
@@ -58,7 +58,7 @@ public class BuildCommand extends Command {
}
boolean success = baritone.getBuilderProcess().build(file.getName(), file, buildOrigin);
if (!success) {
throw new CommandInvalidStateException("Couldn't load the schematic");
throw new CommandInvalidStateException("Couldn't load the schematic. Make sure to use the FULL file name, including the extension (e.g. blah.schematic).");
}
logDirect(String.format("Successfully loaded schematic for building\nOrigin: %s", buildOrigin));
}

View File

@@ -1,61 +0,0 @@
/*
* 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.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
public class CancelCommand extends Command {
public CancelCommand(IBaritone baritone) {
super(baritone, "cancel", "stop");
}
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
baritone.getPathingBehavior().cancelEverything();
logDirect("ok canceled");
}
@Override
public Stream<String> tabComplete(String label, IArgConsumer args) {
return Stream.empty();
}
@Override
public String getShortDesc() {
return "Cancel what Baritone is currently doing";
}
@Override
public List<String> getLongDesc() {
return Arrays.asList(
"The cancel command tells Baritone to stop whatever it's currently doing.",
"",
"Usage:",
"> cancel"
);
}
}

View File

@@ -19,11 +19,11 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.cache.IRememberedInventory;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.utils.BetterBlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;

View File

@@ -19,8 +19,8 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import java.util.Arrays;
import java.util.List;

View File

@@ -18,11 +18,11 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.pathing.goals.GoalBlock;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.pathing.goals.GoalBlock;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;

View File

@@ -24,52 +24,54 @@ import java.util.*;
public final class DefaultCommands {
private DefaultCommands() {}
private DefaultCommands() {
}
public static List<ICommand> createAll(IBaritone baritone) {
Objects.requireNonNull(baritone);
List<ICommand> commands = new ArrayList<>(Arrays.asList(
new HelpCommand(baritone),
new SetCommand(baritone),
new CommandAlias(baritone, Arrays.asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
new CommandAlias(baritone, "reset", "Reset all settings or just one", "set reset"),
new GoalCommand(baritone),
new GotoCommand(baritone),
new PathCommand(baritone),
new ProcCommand(baritone),
new VersionCommand(baritone),
new RepackCommand(baritone),
new BuildCommand(baritone),
new SchematicaCommand(baritone),
new ComeCommand(baritone),
new AxisCommand(baritone),
new CancelCommand(baritone),
new ForceCancelCommand(baritone),
new GcCommand(baritone),
new InvertCommand(baritone),
new TunnelCommand(baritone),
new RenderCommand(baritone),
new FarmCommand(baritone),
new ChestsCommand(baritone),
new FollowCommand(baritone),
new ExploreFilterCommand(baritone),
new ReloadAllCommand(baritone),
new SaveAllCommand(baritone),
new ExploreCommand(baritone),
new BlacklistCommand(baritone),
new FindCommand(baritone),
new MineCommand(baritone),
new ClickCommand(baritone),
new ThisWayCommand(baritone),
new WaypointsCommand(baritone),
new CommandAlias(baritone, "sethome", "Sets your home waypoint", "waypoints save home"),
new CommandAlias(baritone, "home", "Set goal to your home waypoint", "waypoints goal home"),
new SelCommand(baritone)
new HelpCommand(baritone),
new SetCommand(baritone),
new CommandAlias(baritone, Arrays.asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
new CommandAlias(baritone, "reset", "Reset all settings or just one", "set reset"),
new GoalCommand(baritone),
new GotoCommand(baritone),
new PathCommand(baritone),
new ProcCommand(baritone),
new VersionCommand(baritone),
new RepackCommand(baritone),
new BuildCommand(baritone),
new SchematicaCommand(baritone),
new ComeCommand(baritone),
new AxisCommand(baritone),
new ForceCancelCommand(baritone),
new GcCommand(baritone),
new InvertCommand(baritone),
new TunnelCommand(baritone),
new RenderCommand(baritone),
new FarmCommand(baritone),
new ChestsCommand(baritone),
new FollowCommand(baritone),
new ExploreFilterCommand(baritone),
new ReloadAllCommand(baritone),
new SaveAllCommand(baritone),
new ExploreCommand(baritone),
new BlacklistCommand(baritone),
new FindCommand(baritone),
new MineCommand(baritone),
new ClickCommand(baritone),
new SurfaceCommand(baritone),
new ThisWayCommand(baritone),
new WaypointsCommand(baritone),
new CommandAlias(baritone, "sethome", "Sets your home waypoint", "waypoints save home"),
new CommandAlias(baritone, "home", "Path to your home waypoint", "waypoints goto home"),
new SelCommand(baritone)
));
PauseResumeCommands prc = new PauseResumeCommands(baritone);
ExecutionControlCommands prc = new ExecutionControlCommands(baritone);
commands.add(prc.pauseCommand);
commands.add(prc.resumeCommand);
commands.add(prc.pausedCommand);
commands.add(prc.cancelCommand);
return Collections.unmodifiableList(commands);
}
}

View File

@@ -18,13 +18,13 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.process.IBaritoneProcess;
import baritone.api.process.PathingCommand;
import baritone.api.process.PathingCommandType;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import java.util.Arrays;
import java.util.List;
@@ -37,13 +37,14 @@ import java.util.stream.Stream;
* TO USE THIS to pause and resume Baritone. Make your own process that returns {@link PathingCommandType#REQUEST_PAUSE
* REQUEST_PAUSE} as needed.
*/
public class PauseResumeCommands {
public class ExecutionControlCommands {
Command pauseCommand;
Command resumeCommand;
Command pausedCommand;
Command cancelCommand;
public PauseResumeCommands(IBaritone baritone) {
public ExecutionControlCommands(IBaritone baritone) {
// array for mutability, non-field so reflection can't touch it
final boolean[] paused = {false};
baritone.getPathingControlManager().registerProcess(
@@ -64,7 +65,8 @@ public class PauseResumeCommands {
}
@Override
public void onLostControl() {}
public void onLostControl() {
}
@Override
public double priority() {
@@ -77,7 +79,7 @@ public class PauseResumeCommands {
}
}
);
pauseCommand = new Command(baritone, "pause") {
pauseCommand = new Command(baritone, "pause", "p") {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
@@ -110,7 +112,7 @@ public class PauseResumeCommands {
);
}
};
resumeCommand = new Command(baritone, "resume") {
resumeCommand = new Command(baritone, "resume", "r") {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
@@ -169,5 +171,36 @@ public class PauseResumeCommands {
);
}
};
cancelCommand = new Command(baritone, "cancel", "c", "stop") {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
if (paused[0]) {
paused[0] = false;
}
baritone.getPathingBehavior().cancelEverything();
logDirect("ok canceled");
}
@Override
public Stream<String> tabComplete(String label, IArgConsumer args) {
return Stream.empty();
}
@Override
public String getShortDesc() {
return "Cancel what Baritone is currently doing";
}
@Override
public List<String> getLongDesc() {
return Arrays.asList(
"The cancel command tells Baritone to stop whatever it's currently doing.",
"",
"Usage:",
"> cancel"
);
}
};
}
}

View File

@@ -18,11 +18,11 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.pathing.goals.GoalXZ;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.RelativeGoalXZ;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.pathing.goals.GoalXZ;
import java.util.Arrays;
import java.util.List;

View File

@@ -19,11 +19,11 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.RelativeFile;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.api.command.argument.IArgConsumer;
import com.google.gson.JsonSyntaxException;
import java.io.File;

View File

@@ -18,9 +18,13 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.cache.IWaypoint;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.ForWaypoints;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.utils.BetterBlockPos;
import java.util.Arrays;
import java.util.List;
@@ -34,8 +38,30 @@ public class FarmCommand extends Command {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
baritone.getFarmProcess().farm();
args.requireMax(2);
int range = 0;
BetterBlockPos origin = null;
//range
if (args.has(1)) {
range = args.getAs(Integer.class);
}
//waypoint
if (args.has(1)) {
IWaypoint[] waypoints = args.getDatatypeFor(ForWaypoints.INSTANCE);
IWaypoint waypoint = null;
switch (waypoints.length) {
case 0:
throw new CommandInvalidStateException("No waypoints found");
case 1:
waypoint = waypoints[0];
break;
default:
throw new CommandInvalidStateException("Multiple waypoints were found");
}
origin = waypoint.getLocation();
}
baritone.getFarmProcess().farm(range, origin);
logDirect("Farming");
}
@@ -55,7 +81,9 @@ public class FarmCommand extends Command {
"The farm command starts farming nearby plants. It harvests mature crops and plants new ones.",
"",
"Usage:",
"> farm"
"> farm - farms every crop it can find.",
"> farm <range> - farm crops within range from the starting position.",
"> farm <range> <waypoint> - farm crops within range from waypoint."
);
}
}

View File

@@ -18,11 +18,11 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.BlockById;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.utils.BetterBlockPos;
import net.minecraft.block.Block;
import net.minecraft.util.registry.Registry;

View File

@@ -17,13 +17,14 @@
package baritone.command.defaults;
import baritone.KeepName;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.EntityClassById;
import baritone.api.command.datatypes.IDatatypeFor;
import baritone.api.command.datatypes.NearbyPlayer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.helpers.TabCompleteHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
@@ -132,6 +133,7 @@ public class FollowCommand extends Command {
);
}
@KeepName
private enum FollowGroup {
ENTITIES(LivingEntity.class::isInstance),
PLAYERS(PlayerEntity.class::isInstance); /* ,
@@ -144,6 +146,7 @@ public class FollowCommand extends Command {
}
}
@KeepName
private enum FollowList {
ENTITY(EntityClassById.INSTANCE),
PLAYER(NearbyPlayer.INSTANCE);

View File

@@ -20,8 +20,8 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.behavior.IPathingBehavior;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import java.util.Arrays;
import java.util.List;

View File

@@ -19,8 +19,8 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import java.util.Arrays;
import java.util.List;

View File

@@ -18,15 +18,15 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.pathing.goals.Goal;
import baritone.api.process.ICustomGoalProcess;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.RelativeCoordinate;
import baritone.api.command.datatypes.RelativeGoal;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.pathing.goals.Goal;
import baritone.api.process.ICustomGoalProcess;
import baritone.api.utils.BetterBlockPos;
import java.util.Arrays;
import java.util.List;

View File

@@ -19,12 +19,12 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.BlockById;
import baritone.api.command.datatypes.ForBlockOptionalMeta;
import baritone.api.command.datatypes.RelativeCoordinate;
import baritone.api.command.datatypes.RelativeGoal;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.pathing.goals.Goal;
import baritone.api.utils.BetterBlockPos;
import baritone.api.utils.BlockOptionalMeta;
@@ -41,9 +41,13 @@ public class GotoCommand extends Command {
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
if (args.peekDatatypeOrNull(RelativeCoordinate.INSTANCE) != null) { // if we have a numeric first argument...
// If we have a numeric first argument, then parse arguments as coordinates.
// Note: There is no reason to want to go where you're already at so there
// is no need to handle the case of empty arguments.
if (args.peekDatatypeOrNull(RelativeCoordinate.INSTANCE) != null) {
args.requireMax(3);
BetterBlockPos origin = baritone.getPlayerContext().playerFeet();
Goal goal = args.getDatatypePostOrNull(RelativeGoal.INSTANCE, origin);
Goal goal = args.getDatatypePost(RelativeGoal.INSTANCE, origin);
logDirect(String.format("Going to: %s", goal.toString()));
baritone.getCustomGoalProcess().setGoalAndPath(goal);
return;
@@ -68,7 +72,7 @@ public class GotoCommand extends Command {
@Override
public List<String> getLongDesc() {
return Arrays.asList(
"The got command tells Baritone to head towards a given goal or block.",
"The goto command tells Baritone to head towards a given goal or block.",
"",
"Wherever a coordinate is expected, you can use ~ just like in regular Minecraft commands. Or, you can just use regular numbers.",
"",

View File

@@ -20,9 +20,9 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.ICommand;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandNotFoundException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.helpers.Paginator;
import baritone.api.command.helpers.TabCompleteHelper;
import net.minecraft.util.text.ITextComponent;

View File

@@ -18,13 +18,13 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.pathing.goals.Goal;
import baritone.api.pathing.goals.GoalInverted;
import baritone.api.process.ICustomGoalProcess;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import java.util.Arrays;
import java.util.List;

View File

@@ -18,12 +18,12 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.utils.BlockOptionalMeta;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.BlockById;
import baritone.api.command.datatypes.ForBlockOptionalMeta;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.utils.BlockOptionalMeta;
import baritone.cache.WorldScanner;
import java.util.ArrayList;

View File

@@ -19,8 +19,8 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.process.ICustomGoalProcess;
import baritone.cache.WorldScanner;

View File

@@ -18,13 +18,13 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.pathing.calc.IPathingControlManager;
import baritone.api.process.IBaritoneProcess;
import baritone.api.process.PathingCommand;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.argument.IArgConsumer;
import java.util.Arrays;
import java.util.List;

View File

@@ -19,8 +19,8 @@ package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import java.util.Arrays;
import java.util.List;

View File

@@ -18,10 +18,10 @@
package baritone.command.defaults;
import baritone.api.IBaritone;
import baritone.api.utils.BetterBlockPos;
import baritone.api.command.Command;
import baritone.api.command.exception.CommandException;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.exception.CommandException;
import baritone.api.utils.BetterBlockPos;
import java.util.Arrays;
import java.util.List;

Some files were not shown because too many files have changed in this diff Show More