fixes to parkour place
This commit is contained in:
parent
6b45b84784
commit
d7a646789e
@ -104,6 +104,11 @@ public class Settings {
|
|||||||
*/
|
*/
|
||||||
public Setting<Boolean> allowParkour = new Setting<>(false);
|
public Setting<Boolean> allowParkour = new Setting<>(false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like parkour, but even more unreliable!
|
||||||
|
*/
|
||||||
|
public Setting<Boolean> allowParkourPlace = new Setting<>(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For example, if you have Mining Fatigue or Haste, adjust the costs of breaking blocks accordingly.
|
* For example, if you have Mining Fatigue or Haste, adjust the costs of breaking blocks accordingly.
|
||||||
*/
|
*/
|
||||||
|
@ -81,7 +81,7 @@ public class MovementParkour extends Movement {
|
|||||||
if (!MovementHelper.fullyPassable(src.up(2))) {
|
if (!MovementHelper.fullyPassable(src.up(2))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (int i = 2; i <= 4; i++) {
|
for (int i = 2; i <= (context.canSprint() ? 4 : 3); i++) {
|
||||||
BlockPos dest = src.offset(dir, i);
|
BlockPos dest = src.offset(dir, i);
|
||||||
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?
|
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?
|
||||||
for (int y = 0; y < 4; y++) {
|
for (int y = 0; y < 4; y++) {
|
||||||
@ -93,6 +93,12 @@ public class MovementParkour extends Movement {
|
|||||||
return new MovementParkour(src, i, dir);
|
return new MovementParkour(src, i, dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!context.canSprint()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!Baritone.settings().allowParkourPlace.get()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
BlockPos dest = src.offset(dir, 4);
|
BlockPos dest = src.offset(dir, 4);
|
||||||
BlockPos positionToPlace = dest.down();
|
BlockPos positionToPlace = dest.down();
|
||||||
IBlockState toPlace = BlockStateInterface.get(positionToPlace);
|
IBlockState toPlace = BlockStateInterface.get(positionToPlace);
|
||||||
@ -133,11 +139,17 @@ public class MovementParkour extends Movement {
|
|||||||
@Override
|
@Override
|
||||||
protected double calculateCost(CalculationContext context) {
|
protected double calculateCost(CalculationContext context) {
|
||||||
// MUST BE KEPT IN SYNC WITH generate
|
// MUST BE KEPT IN SYNC WITH generate
|
||||||
|
if (!context.canSprint() && dist >= 4) {
|
||||||
|
return COST_INF;
|
||||||
|
}
|
||||||
boolean placing = false;
|
boolean placing = false;
|
||||||
if (!MovementHelper.canWalkOn(dest.down())) {
|
if (!MovementHelper.canWalkOn(dest.down())) {
|
||||||
if (dist != 4) {
|
if (dist != 4) {
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
|
if (!Baritone.settings().allowParkourPlace.get()) {
|
||||||
|
return COST_INF;
|
||||||
|
}
|
||||||
BlockPos positionToPlace = dest.down();
|
BlockPos positionToPlace = dest.down();
|
||||||
IBlockState toPlace = BlockStateInterface.get(positionToPlace);
|
IBlockState toPlace = BlockStateInterface.get(positionToPlace);
|
||||||
if (!context.hasThrowaway()) {
|
if (!context.hasThrowaway()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user