Option to ignore direction of certain blocks during building (because otherwise baritone just keeps breaking and replacing the same block)

This commit is contained in:
Entropy5 2021-12-17 06:24:34 +01:00
parent 0ca84a790b
commit 3adfa16db8
2 changed files with 12 additions and 0 deletions

View File

@ -258,6 +258,11 @@ public final class Settings {
*/
public final Setting<Boolean> buildIgnoreExisting = new Setting<>(false);
/**
* If this is true, the builder will ignore directionality of certain blocks like glazed terracotta.
*/
public final Setting<Boolean> buildIgnoreDirection = new Setting<>(false);
/**
* If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block.
* <p>

View File

@ -48,6 +48,9 @@ import baritone.utils.schematic.schematica.SchematicaHelper;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.BlockGlazedTerracotta;
import net.minecraft.block.BlockBone;
import net.minecraft.block.BlockHay;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
@ -836,6 +839,10 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
if (desired == null) {
return true;
}
if ((current.getBlock() instanceof BlockGlazedTerracotta || current.getBlock() instanceof BlockBone || current.getBlock() instanceof BlockHay)
&& Baritone.settings().buildIgnoreDirection.value && current.getBlock() == desired.getBlock()) {
return true;
}
if (current.getBlock() instanceof BlockLiquid && Baritone.settings().okIfWater.value) {
return true;
}