Add right-click auto replant setting (mod compat, pams harvest craft)

This commit is contained in:
0xf8 2023-06-08 22:58:42 -04:00
parent 574cb74397
commit 6ba8e5ea5b
Signed by: 0xf8
GPG Key ID: 446580D758689584
2 changed files with 14 additions and 3 deletions

View File

@ -884,6 +884,11 @@ public final class Settings {
*/ */
public final Setting<Boolean> replantCrops = new Setting<>(true); public final Setting<Boolean> replantCrops = new Setting<>(true);
/**
* Right click crops, don't break
*/
public final Setting<Boolean> assumeAutoReplant = new Setting<>(false);
/** /**
* Replant nether wart while farming. This setting only has an effect when replantCrops is also enabled * Replant nether wart while farming. This setting only has an effect when replantCrops is also enabled
*/ */

View File

@ -235,9 +235,15 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
Optional<Rotation> rot = RotationUtils.reachable(ctx, pos); Optional<Rotation> rot = RotationUtils.reachable(ctx, pos);
if (rot.isPresent() && isSafeToCancel) { if (rot.isPresent() && isSafeToCancel) {
baritone.getLookBehavior().updateTarget(rot.get(), true); baritone.getLookBehavior().updateTarget(rot.get(), true);
MovementHelper.switchToBestToolFor(ctx, ctx.world().getBlockState(pos)); if (Baritone.settings().assumeAutoReplant.value) {
if (ctx.isLookingAt(pos)) { if (ctx.isLookingAt(pos)) {
baritone.getInputOverrideHandler().setInputForceState(Input.CLICK_LEFT, true); baritone.getInputOverrideHandler().setInputForceState(Input.CLICK_RIGHT, true);
}
} else {
MovementHelper.switchToBestToolFor(ctx, ctx.world().getBlockState(pos));
if (ctx.isLookingAt(pos)) {
baritone.getInputOverrideHandler().setInputForceState(Input.CLICK_LEFT, true);
}
} }
return new PathingCommand(null, PathingCommandType.REQUEST_PAUSE); return new PathingCommand(null, PathingCommandType.REQUEST_PAUSE);
} }