Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Cyclotome
Copy link

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 )

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);
Copy link
Collaborator

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))
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Comment on lines +48 to +51
private String strGettingTo() {
return gettingTo.stream().map(bom -> bom.toString()).collect(Collectors.joining("/"));
}

Copy link
Collaborator

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants