-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partial support for multiple #goto targets #4104
base: master
Are you sure you want to change the base?
Conversation
Goto will work with multiple block arguments. Special block actions (ex. right click on arrival) will only trigger if they apply to all arguments.
default void getToBlock(Block block) { | ||
getToBlock(new BlockOptionalMeta(block)); | ||
} | ||
void getToBlock(List<BlockOptionalMeta> blocks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The List<BlockOptionalMeta>
should be a BlockOptionalMetaLookup
positions.removeIf(blacklist::contains); | ||
knownLocations = positions; | ||
} | ||
|
||
private Goal createGoal(BlockPos pos) { | ||
if (walkIntoInsteadOfAdjacent(gettingTo.getBlock())) { | ||
// determines which actions to take (action done iff should be done for all target blocks)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to assume unclickable for unknown positions and decide per block for known positions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need to update the tab completion and help text.
private String strGettingTo() { | ||
return gettingTo.stream().map(bom -> bom.toString()).collect(Collectors.joining("/")); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use the string representation of the BlockOptionalMetaLookup
.
@@ -113,7 +118,8 @@ public double heuristic() { | |||
} | |||
if (goal.isInGoal(ctx.playerFeet()) && goal.isInGoal(baritone.getPathingBehavior().pathStart()) && isSafeToCancel) { | |||
// we're there | |||
if (rightClickOnArrival(gettingTo.getBlock())) { | |||
// currently don't know matched position/BOM, so will only right click if all BOM's in gettingTo are right clickable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this does certainly make things easier it will almost certainly result in false bug reports.
Maybe try clicking on any target location for which createGoal(pos).isInGoal(playerPos)
is true and if there is no such position succeed right away.
Goto will work with multiple block arguments.
Special actions (ex. right click on arrival) will only trigger if they apply to all arguments.
(enhancement requested in #3599 )