Allow freeLook when using elytra
This commit is contained in:
@@ -264,17 +264,19 @@ public class Elytra extends Behavior implements Helper {
|
||||
}
|
||||
if (requireClear ? isClear(start, dest) : clearView(start, dest)) {
|
||||
Rotation rot = RotationUtils.calcRotationFromVec3d(start, dest, ctx.playerRotations());
|
||||
ctx.player().rotationYaw = rot.getYaw();
|
||||
// ctx.player().rotationYaw = rot.getYaw();
|
||||
long a = System.currentTimeMillis();
|
||||
Float pitch = solvePitch(dest.subtract(start), steps, relaxation == 2);
|
||||
if (pitch == null) {
|
||||
baritone.getLookBehavior().updateTarget(new Rotation(rot.getYaw(), ctx.playerRotations().getPitch()), false);
|
||||
continue;
|
||||
}
|
||||
long b = System.currentTimeMillis();
|
||||
ctx.player().rotationPitch = pitch;
|
||||
// ctx.player().rotationPitch = pitch;
|
||||
System.out.println("Solved pitch in " + (b - a) + " total time " + (b - t));
|
||||
goingTo = i;
|
||||
goal = path.get(i).add(0, dy, 0);
|
||||
baritone.getLookBehavior().updateTarget(new Rotation(rot.getYaw(), pitch), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
|
||||
public void onPlayerRotationMove(RotationMoveEvent event) {
|
||||
if (this.target != null) {
|
||||
event.setYaw(this.target.rotation.getYaw());
|
||||
event.setPitch(this.target.rotation.getPitch());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user