thebes uwu

This commit is contained in:
Leijurv 2020-06-27 22:25:47 -07:00
parent 80c8294f5f
commit e42c19bfec
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 14 additions and 2 deletions

View File

@ -30,8 +30,8 @@ import java.awt.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.*;
import java.util.List; import java.util.List;
import java.util.*;
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@ -193,6 +193,15 @@ public final class Settings {
))); )));
/**
* A list of blocks to become air
* <p>
* If a schematic asks for a block on this list, only air will be accepted at that location (and nothing on buildIgnoreBlocks)
*/
public final Setting<List<Block>> okIfAir = 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. * If this is true, the builder will treat all non-air blocks as correct. It will only place new blocks.
*/ */

View File

@ -206,6 +206,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
continue; // irrelevant continue; // irrelevant
} }
IBlockState curr = bcc.bsi.get0(x, y, z); IBlockState curr = bcc.bsi.get0(x, y, z);
Blocks.ICE;
if (curr.getBlock() != Blocks.AIR && !(curr.getBlock() instanceof BlockLiquid) && !valid(curr, desired, false)) { if (curr.getBlock() != Blocks.AIR && !(curr.getBlock() instanceof BlockLiquid) && !valid(curr, desired, false)) {
BetterBlockPos pos = new BetterBlockPos(x, y, z); BetterBlockPos pos = new BetterBlockPos(x, y, z);
Optional<Rotation> rot = RotationUtils.reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance()); Optional<Rotation> rot = RotationUtils.reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance());
@ -773,10 +774,12 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
if (desired == null) { if (desired == null) {
return true; return true;
} }
// 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;
} }
if (current.getBlock() instanceof BlockAir && Baritone.settings().okIfAir.value.contains(desired.getBlock())) {
return true;
}
if (desired.getBlock() instanceof BlockAir && Baritone.settings().buildIgnoreBlocks.value.contains(current.getBlock())) { if (desired.getBlock() instanceof BlockAir && Baritone.settings().buildIgnoreBlocks.value.contains(current.getBlock())) {
return true; return true;
} }