From 472e89239cd1f0d8e6847368e093ed62a8f2df49 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 5 Nov 2018 18:07:47 -0600 Subject: [PATCH] IBaritoneProcess javadoc update --- .../api/process/IBaritoneProcess.java | 52 +++++++++++-------- .../api/process/ICustomGoalProcess.java | 1 + .../baritone/api/process/IFollowProcess.java | 1 - .../api/process/IGetToBlockProcess.java | 1 + 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/api/java/baritone/api/process/IBaritoneProcess.java b/src/api/java/baritone/api/process/IBaritoneProcess.java index a214d06d..db7588ab 100644 --- a/src/api/java/baritone/api/process/IBaritoneProcess.java +++ b/src/api/java/baritone/api/process/IBaritoneProcess.java @@ -18,6 +18,8 @@ package baritone.api.process; import baritone.api.IBaritone; +import baritone.api.behavior.IPathingBehavior; +import baritone.api.event.events.PathEvent; /** * A process that can control the PathingBehavior. @@ -31,59 +33,67 @@ import baritone.api.IBaritone; * @author leijurv */ public interface IBaritoneProcess { + /** * Would this process like to be in control? * - * @return true if yes + * @return Whether or not this process would like to be in contorl. */ boolean isActive(); /** - * This process is in control of pathing. What should Baritone do? + * Called when this process is in control of pathing; Returns what Baritone should do. * - * @param calcFailed true if this specific process was in control last tick, and there was a CALC_FAILED event last tick - * @param isSafeToCancel true if a REQUEST_PAUSE would happen this tick, and PathingBehavior wouldn't actually tick. - * false if the PathExecutor reported pausing would be unsafe at the end of the last tick. - * Effectively "could request cancel or pause and have it happen right away" - * @return what the PathingBehavior should do + * @param calcFailed {@code true} if this specific process was in control last tick, + * and there was a {@link PathEvent#CALC_FAILED} event last tick + * @param isSafeToCancel {@code true} if a {@link PathingCommandType#REQUEST_PAUSE} would happen this tick, and + * {@link IPathingBehavior} wouldn't actually tick. {@code false} if the PathExecutor reported + * pausing would be unsafe at the end of the last tick. Effectively "could request cancel or + * pause and have it happen right away" + * @return What the {@link IPathingBehavior} should do */ PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel); /** - * Is this control temporary? - * If a process is temporary, it doesn't call onLostControl on the processes that aren't execute because of it - * For example, CombatPauserProcess and PauseForAutoEatProcess should return isTemporary true always, - * and should return isActive true only if there's something in range this tick, or if the player would like to start eating this tick. - * PauseForAutoEatProcess should only actually right click once onTick is called with isSafeToCancel true though. + * Returns whether or not this process should be treated as "temporary". + *

+ * If a process is temporary, it doesn't call {@link #onLostControl} on the processes that aren't execute because of it. + *

+ * For example, {@code CombatPauserProcess} and {@code PauseForAutoEatProcess} should return {@code true} always, + * and should return {@link #isActive} {@code true} only if there's something in range this tick, or if the player would like + * to start eating this tick. {@code PauseForAutoEatProcess} should only actually right click once onTick is called with + * {@code isSafeToCancel} true though. * - * @return true if temporary + * @return Whethor or not if this control is temporary */ boolean isTemporary(); /** - * Called if isActive returned true, but another non-temporary process has control. Effectively the same as cancel. - * You want control but you don't get it. + * Called if {@link #isActive} returned {@code true}, but another non-temporary + * process has control. Effectively the same as cancel. You want control but you + * don't get it. */ void onLostControl(); /** - * How to decide which Process gets control if they all report isActive? It's the one with the highest priority. + * Used to determine which Process gains control if multiple are reporting {@link #isActive()}. The one + * that returns the highest value will be given control. * - * @return a double representing the priority + * @return A double representing the priority */ double priority(); /** - * which bot is this associated with (5000000iq forward thinking) + * Returns which bot this process is associated with. (5000000iq forward thinking) * - * @return the IBaritone object + * @return The Bot associated with this process */ IBaritone associatedWith(); /** - * What this process should be displayed to the user as (maybe in a HUD? hint hint) + * Returns a user-friendly name for this process. Suitable for a HUD. * - * @return a display name that's suitable for a HUD (hint hint) + * @return A display name that's suitable for a HUD */ String displayName(); } diff --git a/src/api/java/baritone/api/process/ICustomGoalProcess.java b/src/api/java/baritone/api/process/ICustomGoalProcess.java index c3492df9..0484d4c5 100644 --- a/src/api/java/baritone/api/process/ICustomGoalProcess.java +++ b/src/api/java/baritone/api/process/ICustomGoalProcess.java @@ -20,6 +20,7 @@ package baritone.api.process; import baritone.api.pathing.goals.Goal; public interface ICustomGoalProcess extends IBaritoneProcess { + void setGoal(Goal goal); void path(); diff --git a/src/api/java/baritone/api/process/IFollowProcess.java b/src/api/java/baritone/api/process/IFollowProcess.java index 262ce43f..cb9ecde6 100644 --- a/src/api/java/baritone/api/process/IFollowProcess.java +++ b/src/api/java/baritone/api/process/IFollowProcess.java @@ -17,7 +17,6 @@ package baritone.api.process; -import baritone.api.process.IBaritoneProcess; import net.minecraft.entity.Entity; /** diff --git a/src/api/java/baritone/api/process/IGetToBlockProcess.java b/src/api/java/baritone/api/process/IGetToBlockProcess.java index feaeb747..ff3dc9b5 100644 --- a/src/api/java/baritone/api/process/IGetToBlockProcess.java +++ b/src/api/java/baritone/api/process/IGetToBlockProcess.java @@ -23,5 +23,6 @@ import net.minecraft.block.Block; * but it rescans the world every once in a while so it doesn't get fooled by its cache */ public interface IGetToBlockProcess extends IBaritoneProcess { + void getToBlock(Block block); }