Add partial support for multiple #goto targets#4104
Open
Cyclotome wants to merge 1 commit into
Open
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.
ZacSharp
requested changes
Sep 4, 2023
| default void getToBlock(Block block) { | ||
| getToBlock(new BlockOptionalMeta(block)); | ||
| } | ||
| void getToBlock(List<BlockOptionalMeta> blocks); |
Collaborator
There was a problem hiding this comment.
The List<BlockOptionalMeta> should be a BlockOptionalMetaLookup
|
|
||
| private Goal createGoal(BlockPos pos) { | ||
| if (walkIntoInsteadOfAdjacent(gettingTo.getBlock())) { | ||
| // determines which actions to take (action done iff should be done for all target blocks)) |
Collaborator
There was a problem hiding this comment.
I think it's better to assume unclickable for unknown positions and decide per block for known positions.
Collaborator
There was a problem hiding this comment.
You'll also need to update the tab completion and help text.
Comment on lines
+48
to
+51
| private String strGettingTo() { | ||
| return gettingTo.stream().map(bom -> bom.toString()).collect(Collectors.joining("/")); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Just use the string representation of the BlockOptionalMetaLookup.
| 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 |
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 )