This commit is contained in:
Leijurv 2018-08-27 12:12:19 -07:00
commit fe8e9202e2
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
4 changed files with 11 additions and 3 deletions

View File

@ -5,10 +5,18 @@ the original version of the bot for Minecraft 1.8, rebuilt for 1.12.2.
# Setup # Setup
- Open the project in IntelliJ as a Gradle project - Open the project in IntelliJ as a Gradle project
- Run the Gradle task `setupDecompWorkspace` - Run the Gradle task `setupDecompWorkspace`
- Refresh the Gradle project
- Run the Gradle task `genIntellijRuns` - Run the Gradle task `genIntellijRuns`
- Restart IntelliJ and import Gradle changes - Restart IntelliJ and import Gradle changes
- Select the "Minecraft Client" launch config and run - Select the "Minecraft Client" launch config and run
## Command Line
```
$ gradlew setupDecompWorkspace
$ gradlew --refresh-dependencies
$ gradlew genIntellijRuns
```
# Chat control # Chat control
<a href="https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/utils/ExampleBaritoneControl.java">Defined here</a> <a href="https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/utils/ExampleBaritoneControl.java">Defined here</a>

View File

@ -323,7 +323,7 @@ public class Settings {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> List<Setting<T>> getByValueType(Class<T> klass) { public <T> List<Setting<T>> getAllValuesByType(Class<T> klass) {
List<Setting<T>> result = new ArrayList<>(); List<Setting<T>> result = new ArrayList<>();
for (Setting<?> setting : allSettings) { for (Setting<?> setting : allSettings) {
if (setting.klass.equals(klass)) { if (setting.klass.equals(klass)) {

View File

@ -190,7 +190,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
return Optional.of(new Path(startNode, bestSoFar[i], numNodes)); return Optional.of(new Path(startNode, bestSoFar[i], numNodes));
} }
} }
displayChatMessageRaw("Even with a cost coefficient of " + COEFFICIENTS[COEFFICIENTS.length - 1] + ", I couldn't get more than " + bestDist + " blocks =("); displayChatMessageRaw("Even with a cost coefficient of " + COEFFICIENTS[COEFFICIENTS.length - 1] + ", I couldn't get more than " + bestDist + " blocks");
displayChatMessageRaw("No path found =("); displayChatMessageRaw("No path found =(");
currentlyRunning = null; currentlyRunning = null;
return Optional.empty(); return Optional.empty();

View File

@ -286,7 +286,7 @@ public class ExampleBaritoneControl extends Behavior {
event.cancel(); event.cancel();
return; return;
} }
List<Settings.Setting<Boolean>> toggleable = Baritone.settings().getByValueType(Boolean.class); List<Settings.Setting<Boolean>> toggleable = Baritone.settings().getAllValuesByType(Boolean.class);
for (Settings.Setting<Boolean> setting : toggleable) { for (Settings.Setting<Boolean> setting : toggleable) {
if (msg.equalsIgnoreCase(setting.getName())) { if (msg.equalsIgnoreCase(setting.getName())) {
setting.value ^= true; setting.value ^= true;