From 39c6d81b9ec59355afaa9e34c7655a17254e9ccd Mon Sep 17 00:00:00 2001 From: babbaj Date: Sun, 20 Jan 2019 06:20:49 -0500 Subject: [PATCH 01/19] Never send chat message when using prefix --- .../utils/ExampleBaritoneControl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 508a5e1b..a207faf8 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -77,6 +77,8 @@ public class ExampleBaritoneControl extends Behavior implements Helper { "costs - (debug) all movement costs from current location\n" + "damn - Daniel "; + private static final String COMMAND_PREFIX = "#"; + public ExampleBaritoneControl(Baritone baritone) { super(baritone); } @@ -87,14 +89,17 @@ public class ExampleBaritoneControl extends Behavior implements Helper { return; } String msg = event.getMessage(); - if (Baritone.settings().prefix.get()) { - if (!msg.startsWith("#")) { - return; + if (Baritone.settings().prefix.get()) { + if (msg.startsWith(COMMAND_PREFIX)) { + if (!runCommand(msg.substring(COMMAND_PREFIX.length()))) { + logDirect("Invalid command"); + } + event.cancel(); // always cancel if using prefix + } + } else { + if (runCommand(msg)) { + event.cancel(); } - msg = msg.substring(1); - } - if (runCommand(msg)) { - event.cancel(); } } @@ -121,7 +126,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { for (String line : HELP_MSG.split("\n")) { logDirect(line); } - return false; + return true; } if (msg.contains(" ")) { String[] data = msg.split(" "); From 5ab0bb3c0d32ffc12a7dcc621c42fcbd8cd2de38 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 20 Jan 2019 13:53:55 -0800 Subject: [PATCH 02/19] nice round number --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bffdc24..f34b651d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A Minecraft pathfinder bot. Baritone is the pathfinding system used in [Impact](https://impactdevelopment.github.io/) 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. This project is an updated version of [MineBot](https://github.com/leijurv/MineBot/), -the original version of the bot for Minecraft 1.8, rebuilt for 1.12.2. Baritone focuses on reliability and particularly performance (it's over [29x faster](https://github.com/cabaletta/baritone/pull/180#issuecomment-423822928) than MineBot at calculating paths). +the original version of the bot for Minecraft 1.8, rebuilt for 1.12.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). Here are some links to help to get started: From 30e30189663490e461d119a56309cbd18107d31b Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 20 Jan 2019 15:31:30 -0800 Subject: [PATCH 03/19] trigger brady --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f34b651d..ca5f995b 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,11 @@ [![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) [![Minecraft](https://img.shields.io/badge/MC-1.12.2-green.svg)](https://minecraft.gamepedia.com/1.12.2) -[![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.0.0--hotfix--4-brightgreen.svg)](https://impactdevelopment.github.io/) +[![Asuna integration](https://img.shields.io/badge/Asuna%20integration-builder%20branch-brightgreen.svg)](https://github.com/EmotionalLove/Asuna/) +[![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.0.0--hotfix--4-green.svg)](https://impactdevelopment.github.io/) [![KAMI integration](https://img.shields.io/badge/KAMI%20integration-v1.0.0-orange.svg)](https://github.com/zeroeightysix/KAMI/) -[![Asuna integration](https://img.shields.io/badge/Asuna%20integration-v1.0.0-orange.svg)](https://github.com/EmotionalLove/Asuna/) -[![Future integration](https://img.shields.io/badge/Future%20integration-%3F%3F%3F-red.svg)](https://futureclient.net/) +[![WWE integration](https://img.shields.io/badge/WWE%20integration-v1.0.0%3F%3F-orange.svg)](https://wweclient.com/) +[![Future integration](https://img.shields.io/badge/Future%20integration-Soon™%3F%3F%3F-red.svg)](https://futureclient.net/) A Minecraft pathfinder bot. From 3c6c640f50cafc46a29164befe768fe7e816e125 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 20 Jan 2019 15:41:36 -0800 Subject: [PATCH 04/19] unused --- src/main/java/baritone/behavior/PathingBehavior.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 92eb242e..74cc46ee 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -36,7 +36,6 @@ import baritone.utils.Helper; import baritone.utils.PathRenderer; import baritone.utils.pathing.Favoring; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.chunk.EmptyChunk; import java.util.ArrayList; import java.util.Comparator; From eceba131642d502ef360523c98b465bd28067597 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 20 Jan 2019 16:26:23 -0800 Subject: [PATCH 05/19] diss wwe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca5f995b..173ee74a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Asuna integration](https://img.shields.io/badge/Asuna%20integration-builder%20branch-brightgreen.svg)](https://github.com/EmotionalLove/Asuna/) [![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.0.0--hotfix--4-green.svg)](https://impactdevelopment.github.io/) [![KAMI integration](https://img.shields.io/badge/KAMI%20integration-v1.0.0-orange.svg)](https://github.com/zeroeightysix/KAMI/) -[![WWE integration](https://img.shields.io/badge/WWE%20integration-v1.0.0%3F%3F-orange.svg)](https://wweclient.com/) +[![WWE integration](https://img.shields.io/badge/WWE%20%22integration%22-v1.0.0%3F%3F%20smh%20license%20violations-orange.svg)](https://wweclient.com/) [![Future integration](https://img.shields.io/badge/Future%20integration-Soon™%3F%3F%3F-red.svg)](https://futureclient.net/) A Minecraft pathfinder bot. From 1753bc18c1f0e2122012985b01b39f2a1be45916 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 21 Jan 2019 23:32:41 -0800 Subject: [PATCH 06/19] forgehax --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 173ee74a..fb096630 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ [![KAMI integration](https://img.shields.io/badge/KAMI%20integration-v1.0.0-orange.svg)](https://github.com/zeroeightysix/KAMI/) [![WWE integration](https://img.shields.io/badge/WWE%20%22integration%22-v1.0.0%3F%3F%20smh%20license%20violations-orange.svg)](https://wweclient.com/) [![Future integration](https://img.shields.io/badge/Future%20integration-Soon™%3F%3F%3F-red.svg)](https://futureclient.net/) +[![ForgeHax integration](https://img.shields.io/badge/ForgeHax%20integration-Soon™-red.svg)](https://github.com/fr1kin/ForgeHax) A Minecraft pathfinder bot. From 253d67ce784f2f5a0481c2a5dc440b77470ffeea Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 22 Jan 2019 12:01:06 -0600 Subject: [PATCH 07/19] final final final final --- src/api/java/baritone/api/event/events/SprintStateEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/event/events/SprintStateEvent.java b/src/api/java/baritone/api/event/events/SprintStateEvent.java index 6027c79e..60672801 100644 --- a/src/api/java/baritone/api/event/events/SprintStateEvent.java +++ b/src/api/java/baritone/api/event/events/SprintStateEvent.java @@ -21,7 +21,7 @@ package baritone.api.event.events; * @author Brady * @since 1/18/2019 */ -public class SprintStateEvent { +public final class SprintStateEvent { private Boolean state; From b75f4bf9a922b3d214dad526229d42185139136a Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 22 Jan 2019 13:32:37 -0600 Subject: [PATCH 08/19] Reformat --- src/api/java/baritone/api/process/IBaritoneProcess.java | 4 ++-- src/main/java/baritone/utils/ExampleBaritoneControl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/process/IBaritoneProcess.java b/src/api/java/baritone/api/process/IBaritoneProcess.java index c2eb2f49..01e833c0 100644 --- a/src/api/java/baritone/api/process/IBaritoneProcess.java +++ b/src/api/java/baritone/api/process/IBaritoneProcess.java @@ -25,8 +25,8 @@ import baritone.api.event.events.PathEvent; *

* Differences between a baritone process and a behavior: *

    - *
  • Only one baritone process can be active at a time
  • - *
  • PathingBehavior can only be controlled by a process
  • + *
  • Only one baritone process can be active at a time
  • + *
  • PathingBehavior can only be controlled by a process
  • *
*

* That's it actually diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index a207faf8..245b4e9b 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -89,7 +89,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { return; } String msg = event.getMessage(); - if (Baritone.settings().prefix.get()) { + if (Baritone.settings().prefix.get()) { if (msg.startsWith(COMMAND_PREFIX)) { if (!runCommand(msg.substring(COMMAND_PREFIX.length()))) { logDirect("Invalid command"); From 314f2804005785eab4d4685966cc8e4efe11c53c Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 22 Jan 2019 17:25:53 -0800 Subject: [PATCH 09/19] pigs --- .../baritone/launch/mixins/MixinEntityPlayerSP.java | 11 +++++++++++ src/main/java/baritone/behavior/LookBehavior.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/launch/java/baritone/launch/mixins/MixinEntityPlayerSP.java b/src/launch/java/baritone/launch/mixins/MixinEntityPlayerSP.java index 48ac8c94..bbf92011 100644 --- a/src/launch/java/baritone/launch/mixins/MixinEntityPlayerSP.java +++ b/src/launch/java/baritone/launch/mixins/MixinEntityPlayerSP.java @@ -23,6 +23,7 @@ import baritone.api.event.events.ChatEvent; import baritone.api.event.events.PlayerUpdateEvent; import baritone.api.event.events.SprintStateEvent; import baritone.api.event.events.type.EventState; +import baritone.behavior.LookBehavior; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.PlayerCapabilities; @@ -102,4 +103,14 @@ public class MixinEntityPlayerSP { BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getGameEventHandler().onPlayerSprintState(event); return event.getState() == null ? keyBinding.isKeyDown() : event.getState(); } + + @Inject( + method = "updateRidden", + at = @At( + value = "HEAD" + ) + ) + private void updateRidden(CallbackInfo cb) { + ((LookBehavior) BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getLookBehavior()).pig(); + } } diff --git a/src/main/java/baritone/behavior/LookBehavior.java b/src/main/java/baritone/behavior/LookBehavior.java index 31e76913..c2d0326c 100644 --- a/src/main/java/baritone/behavior/LookBehavior.java +++ b/src/main/java/baritone/behavior/LookBehavior.java @@ -95,6 +95,12 @@ public final class LookBehavior extends Behavior implements ILookBehavior { } } + public void pig() { + if (this.target != null) { + ctx.player().rotationYaw = this.target.getYaw(); + } + } + @Override public void onPlayerRotationMove(RotationMoveEvent event) { if (this.target != null && !this.force) { From 863471b5f193e07ed6bff03f97cd8e0cbfd3b355 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 23 Jan 2019 21:25:38 -0800 Subject: [PATCH 10/19] don't create a new bsi for every selection box every tick --- src/main/java/baritone/utils/PathRenderer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/PathRenderer.java b/src/main/java/baritone/utils/PathRenderer.java index deca0951..9f07efdf 100644 --- a/src/main/java/baritone/utils/PathRenderer.java +++ b/src/main/java/baritone/utils/PathRenderer.java @@ -216,8 +216,9 @@ public final class PathRenderer implements Helper { double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks; double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks; double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks; + BlockStateInterface bsi = new BlockStateInterface(BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext()); // TODO this assumes same dimension between primary baritone and render view? is this safe? positions.forEach(pos -> { - IBlockState state = BlockStateInterface.get(BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext(), pos); + IBlockState state = bsi.get0(pos); AxisAlignedBB toDraw; if (state.getBlock().equals(Blocks.AIR)) { toDraw = Blocks.DIRT.getDefaultState().getSelectedBoundingBox(player.world, pos); From 82ab79e915860f848018a53e6dd883a953df468a Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 24 Jan 2019 14:34:18 -0600 Subject: [PATCH 11/19] CLI setup --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index fb096630..4f386e00 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,13 @@ Here are some links to help to get started: ## Command Line On Mac OSX and Linux, use `./gradlew` instead of `gradlew`. +Setting up the Environment: + +``` +$ gradlew setupDecompWorkspace +$ gradlew --refresh-dependencies +``` + Running Baritone: ``` From 6b6f8cadb28835efb5528442d166772d430effa3 Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 24 Jan 2019 15:06:01 -0600 Subject: [PATCH 12/19] Image tutorial epic haha --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4f386e00..8877ddf5 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Here are some links to help to get started: # Setup +- Clone or download Baritone + + ![Image](https://i.imgur.com/kbqBtoN.png) + - If you choose to download, make sure you extract the ZIP archive. +- Follow one of the instruction sets below, based on your preference + ## Command Line On Mac OSX and Linux, use `./gradlew` instead of `gradlew`. @@ -45,19 +51,59 @@ Running Baritone: $ gradlew runClient ``` -Building Baritone: +For information on how to build baritone, see [Building Baritone](#building-baritone) + +## IntelliJ +- Open the project in IntelliJ as a Gradle project + + ![Image](https://i.imgur.com/jw7Q6vY.png) + +- Run the Gradle tasks `setupDecompWorkspace` then `genIntellijRuns` + + ![Image](https://i.imgur.com/QEfVvWP.png) + +- Refresh the Gradle project (or, to be safe, just restart IntelliJ) + + ![Image](https://i.imgur.com/3V7EdWr.png) + +- Select the "Minecraft Client" launch config + + ![Image](https://i.imgur.com/1qz2QGV.png) + +- Click on ``Edit Configurations...`` from the same dropdown and select the "Minecraft Client" config + + ![Image](https://i.imgur.com/s4ly0ZF.png) + +- In `Edit Configurations...` you need to select `baritone_launch` for `Use classpath of module:`. + + ![Image](https://i.imgur.com/hrLhG9u.png) + +# Building + +## Command Line + ``` $ gradlew build ``` -To replace out Impact 4.4's Baritone build with a customized one, switch to the `impact4.4-compat` branch, build Baritone as above then copy `dist/baritone-api-$VERSION$.jar` into `minecraft/libraries/cabaletta/baritone-api/1.0.0/baritone-api-1.0.0.jar`, replacing the jar that was previously there. You also need to edit `minecraft/versions/1.12.2-Impact_4.4/1.12.2-Impact_4.4.json`, find the line `"name": "cabaletta:baritone-api:1.0.0"`, remove the comma from the end, and entirely remove the line that's immediately after (starts with `"url"`). +## IntelliJ -## IntelliJ's Gradle UI -- Open the project in IntelliJ as a Gradle project -- Run the Gradle tasks `setupDecompWorkspace` then `genIntellijRuns` -- Refresh the Gradle project (or, to be safe, just restart IntelliJ) -- Select the "Minecraft Client" launch config -- In `Edit Configurations...` you may need to select `baritone_launch` for `Use classpath of module:`. +- Navigate to the gradle tasks on the right tab as follows + + ![Image](https://i.imgur.com/PE6r9iN.png) + +- Right click on **build** and press **Run** + +## Artifacts + +Building Baritone will result in 3 artifacts created in the ``dist`` directory. + +- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features. +- **Standalone**: Everything is obfuscated. This should be used in environments where there are no other mods present that would like to use Baritone's features. +- **Unoptimized**: Nothing is obfuscated. This shouldn't be used ever in production. + +## More Info +To replace out Impact 4.4's Baritone build with a customized one, switch to the `impact4.4-compat` branch, build Baritone as above then copy `dist/baritone-api-$VERSION$.jar` into `minecraft/libraries/cabaletta/baritone-api/1.0.0/baritone-api-1.0.0.jar`, replacing the jar that was previously there. You also need to edit `minecraft/versions/1.12.2-Impact_4.4/1.12.2-Impact_4.4.json`, find the line `"name": "cabaletta:baritone-api:1.0.0"`, remove the comma from the end, and entirely remove the line that's immediately after (starts with `"url"`). # Chat control [Defined Here](src/main/java/baritone/utils/ExampleBaritoneControl.java) From 772d5fb0ccf332f2d52ada6d094601825f0a3723 Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 24 Jan 2019 15:09:04 -0600 Subject: [PATCH 13/19] SETUP.md --- README.md | 76 +----------------------------------------------------- SETUP.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 75 deletions(-) create mode 100644 SETUP.md diff --git a/README.md b/README.md index 8877ddf5..c24681e0 100644 --- a/README.md +++ b/README.md @@ -29,81 +29,7 @@ Here are some links to help to get started: # Setup -- Clone or download Baritone - - ![Image](https://i.imgur.com/kbqBtoN.png) - - If you choose to download, make sure you extract the ZIP archive. -- Follow one of the instruction sets below, based on your preference - -## Command Line -On Mac OSX and Linux, use `./gradlew` instead of `gradlew`. - -Setting up the Environment: - -``` -$ gradlew setupDecompWorkspace -$ gradlew --refresh-dependencies -``` - -Running Baritone: - -``` -$ gradlew runClient -``` - -For information on how to build baritone, see [Building Baritone](#building-baritone) - -## IntelliJ -- Open the project in IntelliJ as a Gradle project - - ![Image](https://i.imgur.com/jw7Q6vY.png) - -- Run the Gradle tasks `setupDecompWorkspace` then `genIntellijRuns` - - ![Image](https://i.imgur.com/QEfVvWP.png) - -- Refresh the Gradle project (or, to be safe, just restart IntelliJ) - - ![Image](https://i.imgur.com/3V7EdWr.png) - -- Select the "Minecraft Client" launch config - - ![Image](https://i.imgur.com/1qz2QGV.png) - -- Click on ``Edit Configurations...`` from the same dropdown and select the "Minecraft Client" config - - ![Image](https://i.imgur.com/s4ly0ZF.png) - -- In `Edit Configurations...` you need to select `baritone_launch` for `Use classpath of module:`. - - ![Image](https://i.imgur.com/hrLhG9u.png) - -# Building - -## Command Line - -``` -$ gradlew build -``` - -## IntelliJ - -- Navigate to the gradle tasks on the right tab as follows - - ![Image](https://i.imgur.com/PE6r9iN.png) - -- Right click on **build** and press **Run** - -## Artifacts - -Building Baritone will result in 3 artifacts created in the ``dist`` directory. - -- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features. -- **Standalone**: Everything is obfuscated. This should be used in environments where there are no other mods present that would like to use Baritone's features. -- **Unoptimized**: Nothing is obfuscated. This shouldn't be used ever in production. - -## More Info -To replace out Impact 4.4's Baritone build with a customized one, switch to the `impact4.4-compat` branch, build Baritone as above then copy `dist/baritone-api-$VERSION$.jar` into `minecraft/libraries/cabaletta/baritone-api/1.0.0/baritone-api-1.0.0.jar`, replacing the jar that was previously there. You also need to edit `minecraft/versions/1.12.2-Impact_4.4/1.12.2-Impact_4.4.json`, find the line `"name": "cabaletta:baritone-api:1.0.0"`, remove the comma from the end, and entirely remove the line that's immediately after (starts with `"url"`). +Information on how to setup baritone can be found [here](SETUP.md). # Chat control [Defined Here](src/main/java/baritone/utils/ExampleBaritoneControl.java) diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 00000000..777b34da --- /dev/null +++ b/SETUP.md @@ -0,0 +1,77 @@ +# Setup + +- Clone or download Baritone + + ![Image](https://i.imgur.com/kbqBtoN.png) + - If you choose to download, make sure you extract the ZIP archive. +- Follow one of the instruction sets below, based on your preference + +## Command Line +On Mac OSX and Linux, use `./gradlew` instead of `gradlew`. + +Setting up the Environment: + +``` +$ gradlew setupDecompWorkspace +$ gradlew --refresh-dependencies +``` + +Running Baritone: + +``` +$ gradlew runClient +``` + +For information on how to build baritone, see [Building Baritone](#building-baritone) + +## IntelliJ +- Open the project in IntelliJ as a Gradle project + + ![Image](https://i.imgur.com/jw7Q6vY.png) + +- Run the Gradle tasks `setupDecompWorkspace` then `genIntellijRuns` + + ![Image](https://i.imgur.com/QEfVvWP.png) + +- Refresh the Gradle project (or, to be safe, just restart IntelliJ) + + ![Image](https://i.imgur.com/3V7EdWr.png) + +- Select the "Minecraft Client" launch config + + ![Image](https://i.imgur.com/1qz2QGV.png) + +- Click on ``Edit Configurations...`` from the same dropdown and select the "Minecraft Client" config + + ![Image](https://i.imgur.com/s4ly0ZF.png) + +- In `Edit Configurations...` you need to select `baritone_launch` for `Use classpath of module:`. + + ![Image](https://i.imgur.com/hrLhG9u.png) + +# Building + +## Command Line + +``` +$ gradlew build +``` + +## IntelliJ + +- Navigate to the gradle tasks on the right tab as follows + + ![Image](https://i.imgur.com/PE6r9iN.png) + +- Right click on **build** and press **Run** + +## Artifacts + +Building Baritone will result in 3 artifacts created in the ``dist`` directory. + +- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features. +- **Standalone**: Everything is obfuscated. This should be used in environments where there are no other mods present that would like to use Baritone's features. +- **Unoptimized**: Nothing is obfuscated. This shouldn't be used ever in production. + +## More Info +To replace out Impact 4.4's Baritone build with a customized one, switch to the `impact4.4-compat` branch, build Baritone as above then copy `dist/baritone-api-$VERSION$.jar` into `minecraft/libraries/cabaletta/baritone-api/1.0.0/baritone-api-1.0.0.jar`, replacing the jar that was previously there. You also need to edit `minecraft/versions/1.12.2-Impact_4.4/1.12.2-Impact_4.4.json`, find the line `"name": "cabaletta:baritone-api:1.0.0"`, remove the comma from the end, and entirely remove the line that's immediately after (starts with `"url"`). From aba48cca53a2007934fa6066270b6bf422cb6960 Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 24 Jan 2019 15:21:16 -0600 Subject: [PATCH 14/19] Organize some markdown files --- IMPACT.md | 1 - INSTALL.md | 12 ++---------- README.md | 6 ++---- SETUP.md | 2 ++ 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 IMPACT.md diff --git a/IMPACT.md b/IMPACT.md deleted file mode 100644 index cc12252e..00000000 --- a/IMPACT.md +++ /dev/null @@ -1 +0,0 @@ -Impact 4.4 is out. See INSTALL.md \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md index 9df3d6bf..f05e0280 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,11 +1,10 @@ # Integration between Baritone and Impact Impact 4.4 has Baritone included. -These instructions apply to Impact 4.3 (and potentially other hacked clients). +These instructions apply to Impact 4.3 (and potentially other "hacked clients"). To run Baritone on Vanilla, just follow the instructions in the README (it's `./gradlew runClient`). - ## An Introduction There are some basic steps to getting Baritone setup with Impact. - Acquiring a build of Baritone @@ -26,14 +25,7 @@ Any official release will be GPG signed by leijurv (44A3EA646EADAC6A) and ZeroMe The build is fully deterministic and reproducible, and you can verify Travis did it properly by running `docker build --no-cache -t cabaletta/baritone . && docker run --rm cabaletta/baritone cat /code/dist/checksums.txt` yourself and comparing the shasum. This works identically on Travis, Mac, and Linux (if you have docker on Windows, I'd be grateful if you could let me know if it works there too). ### Building Baritone yourself -There are a few steps to this -- Clone this repository -- Setup the project as instructed in the README -- Run the ``build`` gradle task. You can either do this using IntelliJ's gradle UI or through a -command line - - Windows: ``gradlew build`` - - Mac/Linux: ``./gradlew build`` -- The build should be exported into ``/build/libs/baritone-X.Y.Z.jar`` +You can either build Baritone through a command line or through IntelliJ's UI, information on that can be found [here](SETUP.md#building). ## Placing Baritone in the libraries directory ``/libraries`` is a neat directory in your Minecraft Installation Directory diff --git a/README.md b/README.md index c24681e0..df1422cc 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,10 @@ Here are some links to help to get started: - [Features](FEATURES.md) +- [Setup](SETUP.md) + - [Installation](INSTALL.md) -# Setup - -Information on how to setup baritone can be found [here](SETUP.md). - # Chat control [Defined Here](src/main/java/baritone/utils/ExampleBaritoneControl.java) diff --git a/SETUP.md b/SETUP.md index 777b34da..6400990d 100644 --- a/SETUP.md +++ b/SETUP.md @@ -51,6 +51,8 @@ For information on how to build baritone, see [Building Baritone](#building-bari # Building +Make sure that you have properly [setup](#setup) the environment before trying to build it. + ## Command Line ``` From b1452c714ae4cd4ef94f92cfef36193b1d9b4f20 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 24 Jan 2019 16:06:53 -0800 Subject: [PATCH 15/19] b a d g e s --- FEATURES.md | 2 +- README.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FEATURES.md b/FEATURES.md index cd2a90fe..e3714a8c 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -11,6 +11,7 @@ - **Avoiding dangerous blocks** Obviously, it knows not to walk through fire or on magma, not to corner over lava (that deals some damage), not to break any blocks touching a liquid (it might drown), etc. - **Parkour** Sprint jumping over 1, 2, or 3 block gaps - **Parkour place** Sprint jumping over a 3 block gap and placing the block to land on while executing the jump. It's really cool. +- **Pigs** It can sort of control pigs. I wouldn't rely on it though. # Pathing method Baritone uses A*, with some modifications: @@ -46,7 +47,6 @@ Things it doesn't have yet See issues for more. Things it may not ever have, from most likely to least likely =( -- Pigs - Boats - Horses (2x3 path instead of 1x2) - Elytra diff --git a/README.md b/README.md index df1422cc..d017113b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,12 @@ [![HitCount](http://hits.dwyl.com/cabaletta/baritone.svg)](http://hits.dwyl.com/cabaletta/baritone) [![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/) +[![Pull Requests](https://img.shields.io/github/issues-pr/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/pulls/) +![GitHub repo size](https://img.shields.io/github/repo-size/cabaletta/baritone.svg) [![Minecraft](https://img.shields.io/badge/MC-1.12.2-green.svg)](https://minecraft.gamepedia.com/1.12.2) +[![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/) [![Asuna integration](https://img.shields.io/badge/Asuna%20integration-builder%20branch-brightgreen.svg)](https://github.com/EmotionalLove/Asuna/) [![Impact integration](https://img.shields.io/badge/Impact%20integration-v1.0.0--hotfix--4-green.svg)](https://impactdevelopment.github.io/) [![KAMI integration](https://img.shields.io/badge/KAMI%20integration-v1.0.0-orange.svg)](https://github.com/zeroeightysix/KAMI/) From 4f355ed4a25798f6862b62c54c5fdd093fea2ace Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 24 Jan 2019 16:10:21 -0800 Subject: [PATCH 16/19] two more --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d017113b..ebca5b20 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ [![WWE integration](https://img.shields.io/badge/WWE%20%22integration%22-v1.0.0%3F%3F%20smh%20license%20violations-orange.svg)](https://wweclient.com/) [![Future integration](https://img.shields.io/badge/Future%20integration-Soon™%3F%3F%3F-red.svg)](https://futureclient.net/) [![ForgeHax integration](https://img.shields.io/badge/ForgeHax%20integration-Soon™-red.svg)](https://github.com/fr1kin/ForgeHax) +[![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. From fca5457ab93a040cbcfaa584e606c663395aba4d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 24 Jan 2019 16:25:35 -0800 Subject: [PATCH 17/19] gotta have closed issues too --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ebca5b20..df2f9394 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![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/) ![GitHub repo size](https://img.shields.io/github/repo-size/cabaletta/baritone.svg) [![Minecraft](https://img.shields.io/badge/MC-1.12.2-green.svg)](https://minecraft.gamepedia.com/1.12.2) From bb4188307046c0daf54688196cd7d7a45d5733e4 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 24 Jan 2019 16:31:12 -0800 Subject: [PATCH 18/19] did someone say add another badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index df2f9394..8fa78e8c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ [![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) [![Minecraft](https://img.shields.io/badge/MC-1.12.2-green.svg)](https://minecraft.gamepedia.com/1.12.2) [![GitHub contributors](https://img.shields.io/github/contributors/cabaletta/baritone.svg)](https://github.com/cabaletta/baritone/graphs/contributors/) From f274f5a0eface7f29bdab3ecf7d7c2c5836902e4 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 24 Jan 2019 21:00:44 -0800 Subject: [PATCH 19/19] windows is epic gamer --- src/main/java/baritone/cache/WorldProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/cache/WorldProvider.java b/src/main/java/baritone/cache/WorldProvider.java index 83cf460d..fe2efa4e 100644 --- a/src/main/java/baritone/cache/WorldProvider.java +++ b/src/main/java/baritone/cache/WorldProvider.java @@ -24,6 +24,7 @@ import baritone.utils.accessor.IAnvilChunkLoader; import baritone.utils.accessor.IChunkProviderServer; import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.world.WorldServer; +import org.apache.commons.lang3.SystemUtils; import java.io.File; import java.io.FileOutputStream; @@ -76,7 +77,11 @@ public class WorldProvider implements IWorldProvider, Helper { directory = new File(directory, "baritone"); readme = directory; } else { // Otherwise, the server must be remote... - directory = new File(Baritone.getDir(), mc.getCurrentServerData().serverIP); + String folderName = mc.getCurrentServerData().serverIP; + if (SystemUtils.IS_OS_WINDOWS) { + folderName = folderName.replace(":", "_"); + } + directory = new File(Baritone.getDir(), folderName); readme = Baritone.getDir(); }