implement getSrc and getDest

This commit is contained in:
Leijurv 2018-08-02 14:12:56 -04:00
parent e051ac12b5
commit 471c170884
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 16 additions and 18 deletions

View File

@ -12,20 +12,17 @@ import net.minecraft.util.math.Vec3d;
public abstract class Action implements AbstractGameEventListener, Helper, ActionWorldHelper { public abstract class Action implements AbstractGameEventListener, Helper, ActionWorldHelper {
protected ActionState currentState; protected ActionState currentState;
protected final BlockPos src;
protected final BlockPos dest;
public Action(BlockPos dest) { protected Action(BlockPos src, BlockPos dest) {
this(Utils.calcCenterFromCoords(dest, mc.world)); this(src, dest, Utils.calcCenterFromCoords(dest, mc.world));
} }
public Action(Vec3d dest) {
this(dest, dest);
}
public Action(BlockPos dest, Vec3d rotationTarget) { protected Action(BlockPos src, BlockPos dest, Vec3d rotationTarget) {
this(Utils.calcCenterFromCoords(dest, mc.world), rotationTarget); this.src = src;
} this.dest = dest;
public Action(Vec3d dest, Vec3d rotationTarget) {
currentState = new ActionState() currentState = new ActionState()
.setGoal(new ActionState.ActionGoal(dest, rotationTarget)) .setGoal(new ActionState.ActionGoal(dest, rotationTarget))
.setStatus(ActionStatus.WAITING); .setStatus(ActionStatus.WAITING);
@ -63,11 +60,11 @@ public abstract class Action implements AbstractGameEventListener, Helper, Actio
} }
public BlockPos getSrc() { public BlockPos getSrc() {
return null; // TODO return src;
} }
public BlockPos getDest() { public BlockPos getDest() {
return null; // TODO return dest;
} }
/** /**

View File

@ -1,6 +1,7 @@
package baritone.bot.pathing.action; package baritone.bot.pathing.action;
import baritone.bot.InputOverrideHandler.Input; import baritone.bot.InputOverrideHandler.Input;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import java.util.HashMap; import java.util.HashMap;
@ -27,7 +28,7 @@ public class ActionState {
* <p> * <p>
* TODO: Decide desiredMovement type * TODO: Decide desiredMovement type
*/ */
public Vec3d position; public BlockPos position;
/** /**
* Yaw and pitch angles that must be matched * Yaw and pitch angles that must be matched
* <p> * <p>
@ -36,7 +37,7 @@ public class ActionState {
*/ */
public Vec3d rotation; public Vec3d rotation;
public ActionGoal(Vec3d position, Vec3d rotation) { public ActionGoal(BlockPos position, Vec3d rotation) {
this.position = position; this.position = position;
this.rotation = rotation; this.rotation = rotation;
} }

View File

@ -7,8 +7,8 @@ import net.minecraft.util.math.BlockPos;
public class ActionAscend extends Action { public class ActionAscend extends Action {
public ActionAscend(BlockPos dest) { public ActionAscend(BlockPos src, BlockPos dest) {
super(dest); super(src, dest);
} }
@Override @Override