Merge branch 'master' into 1.13.2
This commit is contained in:
@@ -135,7 +135,7 @@ public class CalculationContext {
|
|||||||
return get(x, y, z).getBlock();
|
return get(x, y, z).getBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double costOfPlacingAt(int x, int y, int z) {
|
public double costOfPlacingAt(int x, int y, int z, IBlockState current) {
|
||||||
if (!hasThrowaway) { // only true if allowPlace is true, see constructor
|
if (!hasThrowaway) { // only true if allowPlace is true, see constructor
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ public class CalculationContext {
|
|||||||
return placeBlockCost;
|
return placeBlockCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double breakCostMultiplierAt(int x, int y, int z) {
|
public double breakCostMultiplierAt(int x, int y, int z, IBlockState current) {
|
||||||
if (!allowBreak) {
|
if (!allowBreak) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
if (!state.getFluidState().isEmpty()) {
|
if (!state.getFluidState().isEmpty()) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
double mult = context.breakCostMultiplierAt(x, y, z);
|
double mult = context.breakCostMultiplierAt(x, y, z, state);
|
||||||
if (mult >= COST_INF) {
|
if (mult >= COST_INF) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class MovementAscend extends Movement {
|
|||||||
IBlockState toPlace = context.get(destX, y, destZ);
|
IBlockState toPlace = context.get(destX, y, destZ);
|
||||||
double additionalPlacementCost = 0;
|
double additionalPlacementCost = 0;
|
||||||
if (!MovementHelper.canWalkOn(context.bsi, destX, y, destZ, toPlace)) {
|
if (!MovementHelper.canWalkOn(context.bsi, destX, y, destZ, toPlace)) {
|
||||||
additionalPlacementCost = context.costOfPlacingAt(destX, y, destZ);
|
additionalPlacementCost = context.costOfPlacingAt(destX, y, destZ, toPlace);
|
||||||
if (additionalPlacementCost >= COST_INF) {
|
if (additionalPlacementCost >= COST_INF) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,11 +148,11 @@ public class MovementParkour extends Movement {
|
|||||||
// time 2 pop off with that dank skynet parkour place
|
// time 2 pop off with that dank skynet parkour place
|
||||||
int destX = x + 4 * xDiff;
|
int destX = x + 4 * xDiff;
|
||||||
int destZ = z + 4 * zDiff;
|
int destZ = z + 4 * zDiff;
|
||||||
double placeCost = context.costOfPlacingAt(destX, y - 1, destZ);
|
IBlockState toReplace = context.get(destX, y - 1, destZ);
|
||||||
|
double placeCost = context.costOfPlacingAt(destX, y - 1, destZ, toReplace);
|
||||||
if (placeCost >= COST_INF) {
|
if (placeCost >= COST_INF) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IBlockState toReplace = context.get(destX, y - 1, destZ);
|
|
||||||
if (!MovementHelper.isReplaceable(destX, y - 1, destZ, toReplace, context.bsi)) {
|
if (!MovementHelper.isReplaceable(destX, y - 1, destZ, toReplace, context.bsi)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class MovementPillar extends Movement {
|
|||||||
double placeCost = 0;
|
double placeCost = 0;
|
||||||
if (!ladder) {
|
if (!ladder) {
|
||||||
// we need to place a block where we started to jump on it
|
// we need to place a block where we started to jump on it
|
||||||
placeCost = context.costOfPlacingAt(x, y, z);
|
placeCost = context.costOfPlacingAt(x, y, z, fromState);
|
||||||
if (placeCost >= COST_INF) {
|
if (placeCost >= COST_INF) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class MovementTraverse extends Movement {
|
|||||||
// this happens when assume walk on water is true and this is a traverse in water, which isn't allowed
|
// this happens when assume walk on water is true and this is a traverse in water, which isn't allowed
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
double placeCost = context.costOfPlacingAt(destX, y - 1, destZ);
|
double placeCost = context.costOfPlacingAt(destX, y - 1, destZ, destOn);
|
||||||
if (placeCost >= COST_INF) {
|
if (placeCost >= COST_INF) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -814,11 +814,11 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double costOfPlacingAt(int x, int y, int z) {
|
public double costOfPlacingAt(int x, int y, int z, IBlockState current) {
|
||||||
if (isPossiblyProtected(x, y, z) || !worldBorder.canPlaceAt(x, z)) { // make calculation fail properly if we can't build
|
if (isPossiblyProtected(x, y, z) || !worldBorder.canPlaceAt(x, z)) { // make calculation fail properly if we can't build
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
IBlockState sch = getSchematic(x, y, z, bsi.get0(x, y, z));
|
IBlockState sch = getSchematic(x, y, z, current);
|
||||||
if (sch != null) {
|
if (sch != null) {
|
||||||
// TODO this can return true even when allowPlace is off.... is that an issue?
|
// TODO this can return true even when allowPlace is off.... is that an issue?
|
||||||
if (sch.getBlock() instanceof BlockAir) {
|
if (sch.getBlock() instanceof BlockAir) {
|
||||||
@@ -848,11 +848,11 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double breakCostMultiplierAt(int x, int y, int z) {
|
public double breakCostMultiplierAt(int x, int y, int z, IBlockState current) {
|
||||||
if (!allowBreak || isPossiblyProtected(x, y, z)) {
|
if (!allowBreak || isPossiblyProtected(x, y, z)) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
IBlockState sch = getSchematic(x, y, z, bsi.get0(x, y, z));
|
IBlockState sch = getSchematic(x, y, z, current);
|
||||||
if (sch != null) {
|
if (sch != null) {
|
||||||
if (sch.getBlock() instanceof BlockAir) {
|
if (sch.getBlock() instanceof BlockAir) {
|
||||||
// it should be air
|
// it should be air
|
||||||
|
|||||||
Reference in New Issue
Block a user