add renderSelectionBoxes, fixes #378

This commit is contained in:
Leijurv 2019-04-08 20:32:47 -08:00
parent e54652941b
commit 6b6eea2d8c
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 13 additions and 8 deletions

View File

@ -438,6 +438,11 @@ public final class Settings {
*/
public final Setting<Boolean> renderGoal = new Setting<>(true);
/**
* Render selection boxes
*/
public final Setting<Boolean> renderSelectionBoxes = new Setting<>(true);
/**
* Ignore depth when rendering the goal
*/

View File

@ -83,6 +83,14 @@ public final class PathRenderer implements Helper {
if (goal != null && Baritone.settings().renderGoal.value) {
drawDankLitGoalBox(renderView, goal, partialTicks, Baritone.settings().colorGoalBox.value);
}
PathExecutor current = behavior.getCurrent(); // this should prevent most race conditions?
PathExecutor next = behavior.getNext(); // like, now it's not possible for current!=null to be true, then suddenly false because of another thread
if (current != null && Baritone.settings().renderSelectionBoxes.value) {
drawManySelectionBoxes(renderView, current.toBreak(), Baritone.settings().colorBlocksToBreak.value);
drawManySelectionBoxes(renderView, current.toPlace(), Baritone.settings().colorBlocksToPlace.value);
drawManySelectionBoxes(renderView, current.toWalkInto(), Baritone.settings().colorBlocksToWalkInto.value);
}
if (!Baritone.settings().renderPath.value) {
return;
}
@ -91,9 +99,6 @@ public final class PathRenderer implements Helper {
//long start = System.nanoTime();
PathExecutor current = behavior.getCurrent(); // this should prevent most race conditions?
PathExecutor next = behavior.getNext(); // like, now it's not possible for current!=null to be true, then suddenly false because of another thread
// Render the current path, if there is one
if (current != null && current.getPath() != null) {
int renderBegin = Math.max(current.getPosition() - 3, 0);
@ -104,11 +109,6 @@ public final class PathRenderer implements Helper {
}
//long split = System.nanoTime();
if (current != null) {
drawManySelectionBoxes(renderView, current.toBreak(), Baritone.settings().colorBlocksToBreak.value);
drawManySelectionBoxes(renderView, current.toPlace(), Baritone.settings().colorBlocksToPlace.value);
drawManySelectionBoxes(renderView, current.toWalkInto(), Baritone.settings().colorBlocksToWalkInto.value);
}
// If there is a path calculation currently running, render the path calculation process
behavior.getInProgress().ifPresent(currentlyRunning -> {