Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some #farm improvements #4561

Open
wants to merge 7 commits into
base: 1.21.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,45 @@ public final class Settings {
*/
public final Setting<Integer> farmMaxScanSize = new Setting<>(256);

/**
* Prioritize pickup crop drops before another farm task
*/
public final Setting<Boolean> farmPrioritizePickup = new Setting<>(false);

/**
* true = farm farm farm, i don't want to stop!
* false = allow farm to stop or fail
*/
public final Setting<Boolean> farmContinuously = new Setting<>(false);

/**
* How much farm task queue is enough for Baritone to resume the continuous farm?
* {@link #farmContinuously}
*/
public final Setting<Integer> farmContinuouslyThreshold = new Setting<>(16);

/**
* How long Baritone should wait (in seconds) to check if continuous farm threshold is fulfilled?
* {@link #farmContinuously}
*/
public final Setting<Long> farmContinuouslyIntervalSecs = new Setting<>(TimeUnit.MINUTES.toSeconds(2));

/**
* Farm whitelist, only interact with crop that is on the {@link #farmWhitelist} list
*/
public final Setting<Boolean> farmEnableWhitelist = new Setting<>(false);

/**
* Crop block that Baritone is allowed to farm and collect
* {@link #farmEnableWhitelist}
*/

public final Setting<List<Block>> farmWhitelist = new Setting<>(new ArrayList<>(Arrays.asList(
Blocks.WHEAT,
Blocks.POTATOES,
Blocks.CARROTS
)));

/**
* When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too.
* <p>
Expand Down Expand Up @@ -1397,7 +1436,7 @@ public final class Settings {
/**
* Desktop notification on farm fail
*/
public final Setting<Boolean> notificationOnFarmFail = new Setting<>(true);
public final Setting<Boolean> notificationOnFarmProcess = new Setting<>(true);

/**
* Desktop notification on build finished
Expand Down
6 changes: 6 additions & 0 deletions src/api/java/baritone/api/process/IFarmProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@

public interface IFarmProcess extends IBaritoneProcess {

/**
* Resume or pause the Farm Continuously
*/
void pause();
void resume();

/**
* Begin to search for crops to farm with in specified aria
* from specified location.
Expand Down
Loading