mirror of https://github.com/cabaletta/baritone
commit
e7412d0d46
|
@ -657,7 +657,12 @@ public final class Settings {
|
||||||
public final Setting<Integer> exploreMaintainY = new Setting<>(64);
|
public final Setting<Integer> exploreMaintainY = new Setting<>(64);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replant nether wart while farming
|
* Replant normal Crops while farming and leave cactus and sugarcane to regrow
|
||||||
|
*/
|
||||||
|
public final Setting<Boolean> replantCrops = new Setting<>(true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replant nether wart while farming. This setting only has an effect when replantCrops is also enabled
|
||||||
*/
|
*/
|
||||||
public final Setting<Boolean> replantNetherWart = new Setting<>(false);
|
public final Setting<Boolean> replantNetherWart = new Setting<>(false);
|
||||||
|
|
||||||
|
|
|
@ -112,14 +112,20 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
|
||||||
SUGARCANE(Blocks.REEDS, null) {
|
SUGARCANE(Blocks.REEDS, null) {
|
||||||
@Override
|
@Override
|
||||||
public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) {
|
public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) {
|
||||||
|
if (Baritone.settings().replantCrops.value) {
|
||||||
return world.getBlockState(pos.down()).getBlock() instanceof BlockReed;
|
return world.getBlockState(pos.down()).getBlock() instanceof BlockReed;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
CACTUS(Blocks.CACTUS, null) {
|
CACTUS(Blocks.CACTUS, null) {
|
||||||
@Override
|
@Override
|
||||||
public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) {
|
public boolean readyToHarvest(World world, BlockPos pos, IBlockState state) {
|
||||||
|
if (Baritone.settings().replantCrops.value) {
|
||||||
return world.getBlockState(pos.down()).getBlock() instanceof BlockCactus;
|
return world.getBlockState(pos.down()).getBlock() instanceof BlockCactus;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
public final Block block;
|
public final Block block;
|
||||||
public final Predicate<IBlockState> readyToHarvest;
|
public final Predicate<IBlockState> readyToHarvest;
|
||||||
|
@ -166,10 +172,13 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
|
||||||
for (Harvest harvest : Harvest.values()) {
|
for (Harvest harvest : Harvest.values()) {
|
||||||
scan.add(harvest.block);
|
scan.add(harvest.block);
|
||||||
}
|
}
|
||||||
|
if (Baritone.settings().replantCrops.value) {
|
||||||
scan.add(Blocks.FARMLAND);
|
scan.add(Blocks.FARMLAND);
|
||||||
if (Baritone.settings().replantNetherWart.value) {
|
if (Baritone.settings().replantNetherWart.value) {
|
||||||
scan.add(Blocks.SOUL_SAND);
|
scan.add(Blocks.SOUL_SAND);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Baritone.settings().mineGoalUpdateInterval.value != 0 && tickCount++ % Baritone.settings().mineGoalUpdateInterval.value == 0) {
|
if (Baritone.settings().mineGoalUpdateInterval.value != 0 && tickCount++ % Baritone.settings().mineGoalUpdateInterval.value == 0) {
|
||||||
Baritone.getExecutor().execute(() -> locations = WorldScanner.INSTANCE.scanChunkRadius(ctx, scan, 256, 10, 10));
|
Baritone.getExecutor().execute(() -> locations = WorldScanner.INSTANCE.scanChunkRadius(ctx, scan, 256, 10, 10));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue