diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 22125a77..80dcf5ce 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -657,7 +657,12 @@ public final class Settings { public final Setting exploreMaintainY = new Setting<>(64); /** - * Replant nether wart while farming + * Replant normal Crops while farming and leave cactus and sugarcane to regrow + */ + public final Setting replantCrops = new Setting<>(true); + + /** + * Replant nether wart while farming. This setting only has an effect when replantCrops is also enabled */ public final Setting replantNetherWart = new Setting<>(false); diff --git a/src/main/java/baritone/process/FarmProcess.java b/src/main/java/baritone/process/FarmProcess.java index 350b1ac8..00273a9f 100644 --- a/src/main/java/baritone/process/FarmProcess.java +++ b/src/main/java/baritone/process/FarmProcess.java @@ -112,13 +112,19 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro SUGARCANE(Blocks.REEDS, null) { @Override public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) { - return world.getBlockState(pos.down()).getBlock() instanceof BlockReed; + if (Baritone.settings().replantCrops.value) { + return world.getBlockState(pos.down()).getBlock() instanceof BlockReed; + } + return true; } }, CACTUS(Blocks.CACTUS, null) { @Override public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) { - return world.getBlockState(pos.down()).getBlock() instanceof BlockCactus; + if (Baritone.settings().replantCrops.value) { + return world.getBlockState(pos.down()).getBlock() instanceof BlockCactus; + } + return true; } }; public final Block block; @@ -166,10 +172,13 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro for (Harvest harvest : Harvest.values()) { scan.add(harvest.block); } - scan.add(Blocks.FARMLAND); - if (Baritone.settings().replantNetherWart.value) { - scan.add(Blocks.SOUL_SAND); + if (Baritone.settings().replantCrops.value) { + scan.add(Blocks.FARMLAND); + if (Baritone.settings().replantNetherWart.value) { + scan.add(Blocks.SOUL_SAND); + } } + if (Baritone.settings().mineGoalUpdateInterval.value != 0 && tickCount++ % Baritone.settings().mineGoalUpdateInterval.value == 0) { Baritone.getExecutor().execute(() -> locations = WorldScanner.INSTANCE.scanChunkRadius(ctx, scan, 256, 10, 10)); }