Create better example action
This commit is contained in:
parent
f0488b24dd
commit
927c7f21b6
@ -28,14 +28,14 @@ public class ActionState {
|
|||||||
* <p>
|
* <p>
|
||||||
* TODO: Decide desiredMovement type
|
* TODO: Decide desiredMovement type
|
||||||
*/
|
*/
|
||||||
protected BlockPos position;
|
public BlockPos position;
|
||||||
/**
|
/**
|
||||||
* Yaw and pitch angles that must be matched
|
* Yaw and pitch angles that must be matched
|
||||||
* <p>
|
* <p>
|
||||||
* getFirst() -> YAW
|
* getFirst() -> YAW
|
||||||
* getSecond() -> PITCH
|
* getSecond() -> PITCH
|
||||||
*/
|
*/
|
||||||
protected Tuple<Float, Float> rotation;
|
public Tuple<Float, Float> rotation;
|
||||||
|
|
||||||
public ActionGoal(BlockPos position, Tuple<Float, Float> rotation) {
|
public ActionGoal(BlockPos position, Tuple<Float, Float> rotation) {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
|
@ -1,17 +1,22 @@
|
|||||||
package baritone.bot.pathing.action.actions;
|
package baritone.bot.pathing.action.actions;
|
||||||
|
|
||||||
|
import baritone.bot.InputOverrideHandler;
|
||||||
import baritone.bot.pathing.action.Action;
|
import baritone.bot.pathing.action.Action;
|
||||||
import baritone.bot.pathing.action.ActionState;
|
import baritone.bot.pathing.action.ActionState;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
public class ActionAscend extends Action {
|
public class ActionAscend extends Action {
|
||||||
|
|
||||||
ActionAscend(BlockPos dest) {
|
public ActionAscend(BlockPos dest) {
|
||||||
super(dest);
|
super(dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionState calcState() {
|
public ActionState calcState() {
|
||||||
return null;
|
ActionState latestState = currentState.setInput(InputOverrideHandler.Input.JUMP,true).setInput(InputOverrideHandler.Input.MOVE_FORWARD, true);
|
||||||
|
if(player.getPosition().equals(latestState.getGoal().position))
|
||||||
|
latestState.setStatus(ActionState.ActionStatus.SUCCESS);
|
||||||
|
return latestState;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user