builder stuff, fixes #1059
This commit is contained in:
@@ -184,6 +184,20 @@ public final class Settings {
|
|||||||
Blocks.WALL_SIGN
|
Blocks.WALL_SIGN
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(
|
||||||
|
|
||||||
|
)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this is true, the builder will treat all non-air blocks as correct. It will only place new blocks.
|
||||||
|
*/
|
||||||
|
public final Setting<Boolean> buildIgnoreExisting = new Setting<>(true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block.
|
* If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block.
|
||||||
* <p>
|
* <p>
|
||||||
|
@@ -764,11 +764,20 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean valid(IBlockState current, IBlockState desired) {
|
private boolean valid(IBlockState current, IBlockState desired) {
|
||||||
|
if (desired == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// TODO more complicated comparison logic I guess
|
// TODO more complicated comparison logic I guess
|
||||||
if (current.getBlock() instanceof BlockLiquid && Baritone.settings().okIfWater.value) {
|
if (current.getBlock() instanceof BlockLiquid && Baritone.settings().okIfWater.value) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return desired == null || current.equals(desired);
|
if (desired.getBlock() instanceof BlockAir && Baritone.settings().buildIgnoreBlocks.value.contains(current.getBlock())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(current.getBlock() instanceof BlockAir) && Baritone.settings().buildIgnoreExisting.value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return current.equals(desired);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BuilderCalculationContext extends CalculationContext {
|
public class BuilderCalculationContext extends CalculationContext {
|
||||||
|
Reference in New Issue
Block a user