Un-scuff and add setting
This commit is contained in:
@@ -48,7 +48,7 @@ public class Elytra extends Behavior implements Helper {
|
||||
static {
|
||||
|
||||
try {
|
||||
DataInputStream in = new DataInputStream(new FileInputStream(new File("/Users/leijurv/Dropbox/nether-pathfinder/build/test")));
|
||||
DataInputStream in = new DataInputStream(new FileInputStream(new File("E:/Brady/Documents/Java/baritone/test")));
|
||||
int count = in.readInt();
|
||||
System.out.println("Count: " + count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -264,7 +264,6 @@ 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();
|
||||
long a = System.currentTimeMillis();
|
||||
Float pitch = solvePitch(dest.subtract(start), steps, relaxation == 2);
|
||||
if (pitch == null) {
|
||||
@@ -272,7 +271,6 @@ public class Elytra extends Behavior implements Helper {
|
||||
continue;
|
||||
}
|
||||
long b = System.currentTimeMillis();
|
||||
// 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);
|
||||
|
||||
@@ -56,7 +56,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
|
||||
|
||||
@Override
|
||||
public void updateTarget(Rotation rotation, boolean blockInteract) {
|
||||
this.target = new Target(rotation, blockInteract);
|
||||
this.target = new Target(rotation, Target.Mode.resolve(ctx, blockInteract));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,9 +186,9 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
|
||||
public final Rotation rotation;
|
||||
public final Mode mode;
|
||||
|
||||
public Target(Rotation rotation, boolean blockInteract) {
|
||||
public Target(Rotation rotation, Mode mode) {
|
||||
this.rotation = rotation;
|
||||
this.mode = Mode.resolve(blockInteract);
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
enum Mode {
|
||||
@@ -207,12 +207,16 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
|
||||
*/
|
||||
NONE;
|
||||
|
||||
static Mode resolve(boolean blockInteract) {
|
||||
static Mode resolve(IPlayerContext ctx, boolean blockInteract) {
|
||||
final Settings settings = Baritone.settings();
|
||||
final boolean antiCheat = settings.antiCheatCompatibility.value;
|
||||
final boolean blockFreeLook = settings.blockFreeLook.value;
|
||||
final boolean freeLook = settings.freeLook.value;
|
||||
|
||||
if (ctx.player().isElytraFlying()) {
|
||||
return settings.elytraFreeLook.value ? SERVER : CLIENT;
|
||||
}
|
||||
|
||||
if (!freeLook && !blockFreeLook) return CLIENT;
|
||||
if (!blockFreeLook && blockInteract) return CLIENT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user