Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

add the 'replace' parameter like the real '/fill' command to the 'sel' function of baritone

NONAME-2121237 opened this issue ยท 2 comments

commented

When I use the 'sel' function to clear the block, I find that the baritone will get stuck in the wayfinding calculation at a distance, and when there are blocks in the selection area that cannot be destroyed by the survival mode such as bedrock and folding door, the baritone will always try to destroy it with empty hands
I hope to add the 'replace' parameter like the real '/fill' command to the 'sel' function of baritone, and also add a skip list during block cleaning (after all, some mods will also add unbreakable blocks).
I am using minecraft version 1.19.2

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
commented

as you can see in the comand description (Line 309) there already is a option to replace blocks.

public List<String> getLongDesc() {
return Arrays.asList(
"The sel command allows you to manipulate Baritone's selections, similarly to WorldEdit.",
"",
"Using these selections, you can clear areas, fill them with blocks, or something else.",
"",
"The expand/contract/shift commands use a kind of selector to choose which selections to target. Supported ones are a/all, n/newest, and o/oldest.",
"",
"Usage:",
"> sel pos1/p1/1 - Set position 1 to your current position.",
"> sel pos1/p1/1 <x> <y> <z> - Set position 1 to a relative position.",
"> sel pos2/p2/2 - Set position 2 to your current position.",
"> sel pos2/p2/2 <x> <y> <z> - Set position 2 to a relative position.",
"",
"> sel clear/c - Clear the selection.",
"> sel undo/u - Undo the last action (setting positions, creating selections, etc.)",
"> sel set/fill/s/f [block] - Completely fill all selections with a block.",
"> sel walls/w [block] - Fill in the walls of the selection with a specified block.",
"> sel shell/shl [block] - The same as walls, but fills in a ceiling and floor too.",
"> sel cleararea/ca - Basically 'set air'.",
"> sel replace/r <blocks...> <with> - Replaces blocks with another block.",
"> sel copy/cp <x> <y> <z> - Copy the selected area relative to the specified or your position.",
"> sel paste/p <x> <y> <z> - Build the copied area relative to the specified or your position.",
"",
"> sel expand <target> <direction> <blocks> - Expand the targets.",
"> sel contract <target> <direction> <blocks> - Contract the targets.",
"> sel shift <target> <direction> <blocks> - Shift the targets (does not resize)."
);
}

about the skip list, you can add any block to the buildIgnorBlock list and baritone will not break it when clearing out a selection.

/**
* A list of blocks to be treated as if they're air.
* <p>
* If a schematic asks for air at a certain position, and that position currently contains a block on this list, it will be treated as correct.
*/
public final Setting<List<Block>> buildIgnoreBlocks = new Setting<>(new ArrayList<>(Arrays.asList(

there are more settings about the building behavior of baritone you may want to check out.

commented

I'm sorry I didn't read the baritone instructions carefully. I'm sorry to disturb you.
Thank you for your help