IBaritoneProcess javadoc update

This commit is contained in:
Brady 2018-11-05 18:07:47 -06:00
parent 5692e79e02
commit 472e89239c
No known key found for this signature in database
GPG Key ID: 73A788379A197567
4 changed files with 33 additions and 22 deletions

View File

@ -18,6 +18,8 @@
package baritone.api.process; package baritone.api.process;
import baritone.api.IBaritone; import baritone.api.IBaritone;
import baritone.api.behavior.IPathingBehavior;
import baritone.api.event.events.PathEvent;
/** /**
* A process that can control the PathingBehavior. * A process that can control the PathingBehavior.
@ -31,59 +33,67 @@ import baritone.api.IBaritone;
* @author leijurv * @author leijurv
*/ */
public interface IBaritoneProcess { public interface IBaritoneProcess {
/** /**
* Would this process like to be in control? * 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(); 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 calcFailed {@code true} if this specific process was in control last tick,
* @param isSafeToCancel true if a REQUEST_PAUSE would happen this tick, and PathingBehavior wouldn't actually tick. * and there was a {@link PathEvent#CALC_FAILED} event last tick
* false if the PathExecutor reported pausing would be unsafe at the end of the last tick. * @param isSafeToCancel {@code true} if a {@link PathingCommandType#REQUEST_PAUSE} would happen this tick, and
* Effectively "could request cancel or pause and have it happen right away" * {@link IPathingBehavior} wouldn't actually tick. {@code false} if the PathExecutor reported
* @return what the PathingBehavior should do * 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); PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel);
/** /**
* Is this control temporary? * Returns whether or not this process should be treated as "temporary".
* If a process is temporary, it doesn't call onLostControl on the processes that aren't execute because of it * <p>
* For example, CombatPauserProcess and PauseForAutoEatProcess should return isTemporary true always, * If a process is temporary, it doesn't call {@link #onLostControl} on the processes that aren't execute because of it.
* 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. * <p>
* PauseForAutoEatProcess should only actually right click once onTick is called with isSafeToCancel true though. * 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(); boolean isTemporary();
/** /**
* Called if isActive returned true, but another non-temporary process has control. Effectively the same as cancel. * Called if {@link #isActive} returned {@code true}, but another non-temporary
* You want control but you don't get it. * process has control. Effectively the same as cancel. You want control but you
* don't get it.
*/ */
void onLostControl(); 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(); 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(); 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(); String displayName();
} }

View File

@ -20,6 +20,7 @@ package baritone.api.process;
import baritone.api.pathing.goals.Goal; import baritone.api.pathing.goals.Goal;
public interface ICustomGoalProcess extends IBaritoneProcess { public interface ICustomGoalProcess extends IBaritoneProcess {
void setGoal(Goal goal); void setGoal(Goal goal);
void path(); void path();

View File

@ -17,7 +17,6 @@
package baritone.api.process; package baritone.api.process;
import baritone.api.process.IBaritoneProcess;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
/** /**

View File

@ -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 * but it rescans the world every once in a while so it doesn't get fooled by its cache
*/ */
public interface IGetToBlockProcess extends IBaritoneProcess { public interface IGetToBlockProcess extends IBaritoneProcess {
void getToBlock(Block block); void getToBlock(Block block);
} }