This commit is contained in:
Brady 2020-03-07 17:34:27 -06:00
parent 217e0da4a6
commit c8856cfea4
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -206,7 +206,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
continue; // irrelevant
}
IBlockState curr = bcc.bsi.get0(x, y, z);
if (curr.getBlock() != Blocks.AIR && !(curr.getBlock() instanceof BlockLiquid) && !valid(curr, desired)) {
if (curr.getBlock() != Blocks.AIR && !(curr.getBlock() instanceof BlockLiquid) && !valid(curr, desired, false)) {
BetterBlockPos pos = new BetterBlockPos(x, y, z);
Optional<Rotation> rot = RotationUtils.reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance());
if (rot.isPresent()) {
@ -247,7 +247,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
continue; // irrelevant
}
IBlockState curr = bcc.bsi.get0(x, y, z);
if (MovementHelper.isReplaceable(x, y, z, curr, bcc.bsi) && !valid(curr, desired)) {
if (MovementHelper.isReplaceable(x, y, z, curr, bcc.bsi) && !valid(curr, desired, false)) {
if (dy == 1 && bcc.bsi.get0(x, y + 1, z).getBlock() == Blocks.AIR) {
continue;
}
@ -314,7 +314,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
);
ctx.player().rotationYaw = originalYaw;
ctx.player().rotationPitch = originalPitch;
if (valid(wouldBePlaced, desired)) {
if (valid(wouldBePlaced, desired, true)) {
return OptionalInt.of(i);
}
}
@ -457,7 +457,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
outer:
for (IBlockState desired : desirableOnHotbar) {
for (int i = 0; i < 9; i++) {
if (valid(approxPlaceable.get(i), desired)) {
if (valid(approxPlaceable.get(i), desired, true)) {
usefulSlots.add(i);
continue outer;
}
@ -468,7 +468,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
outer:
for (int i = 9; i < 36; i++) {
for (IBlockState desired : noValidHotbarOption) {
if (valid(approxPlaceable.get(i), desired)) {
if (valid(approxPlaceable.get(i), desired, true)) {
baritone.getInventoryBehavior().attemptToPutOnHotbar(i, usefulSlots::contains);
break outer;
}
@ -524,7 +524,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
if (desired != null) {
// we care about this position
BetterBlockPos pos = new BetterBlockPos(x, y, z);
if (valid(bcc.bsi.get0(x, y, z), desired)) {
if (valid(bcc.bsi.get0(x, y, z), desired, false)) {
incorrectPositions.remove(pos);
observedCompleted.add(BetterBlockPos.longHash(pos));
} else {
@ -551,7 +551,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
}
if (bcc.bsi.worldContainsLoadedChunk(blockX, blockZ)) { // check if its in render distance, not if its in cache
// we can directly observe this block, it is in render distance
if (valid(bcc.bsi.get0(blockX, blockY, blockZ), schematic.desiredState(x, y, z, current, this.approxPlaceable))) {
if (valid(bcc.bsi.get0(blockX, blockY, blockZ), schematic.desiredState(x, y, z, current, this.approxPlaceable), false)) {
observedCompleted.add(BetterBlockPos.longHash(blockX, blockY, blockZ));
} else {
incorrectPositions.add(new BetterBlockPos(blockX, blockY, blockZ));
@ -769,7 +769,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
return result;
}
private boolean valid(IBlockState current, IBlockState desired) {
private boolean valid(IBlockState current, IBlockState desired, boolean itemVerify) {
if (desired == null) {
return true;
}
@ -780,7 +780,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
if (desired.getBlock() instanceof BlockAir && Baritone.settings().buildIgnoreBlocks.value.contains(current.getBlock())) {
return true;
}
if (!(current.getBlock() instanceof BlockAir) && Baritone.settings().buildIgnoreExisting.value) {
if (!(current.getBlock() instanceof BlockAir) && Baritone.settings().buildIgnoreExisting.value && !itemVerify) {
return true;
}
return current.equals(desired);
@ -862,7 +862,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
}
// it should be a real block
// is it already that block?
if (valid(bsi.get0(x, y, z), sch)) {
if (valid(bsi.get0(x, y, z), sch, false)) {
return Baritone.settings().breakCorrectBlockPenaltyMultiplier.value;
} else {
// can break if it's wrong