Skip to content

Add partial support for multiple #goto targets#4104

Open
Cyclotome wants to merge 1 commit into
cabaletta:masterfrom
Cyclotome:multigoto
Open

Add partial support for multiple #goto targets#4104
Cyclotome wants to merge 1 commit into
cabaletta:masterfrom
Cyclotome:multigoto

Conversation

@Cyclotome

Copy link
Copy Markdown

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
Copy Markdown
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


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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
Copy Markdown
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