Make default for freeLook false because it has issues, meddle around with litematica and waypoints commands

This commit is contained in:
0xf8 2023-06-08 21:46:12 -04:00
parent 511b07fec5
commit 574cb74397
Signed by: 0xf8
GPG Key ID: 446580D758689584
4 changed files with 14 additions and 5 deletions

View File

@ -707,7 +707,7 @@ public final class Settings {
/**
* Move without having to force the client-sided rotations
*/
public final Setting<Boolean> freeLook = new Setting<>(true);
public final Setting<Boolean> freeLook = new Setting<>(false);
/**
* Will cause some minor behavioral differences to ensure that Baritone works on anticheats.

View File

@ -57,6 +57,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
this.force = force || !Baritone.settings().freeLook.value;
}
// TODO: for some reason with freecam on this breaks
@Override
public void onPlayerUpdate(PlayerUpdateEvent event) {
if (this.target == null) {
@ -78,10 +79,13 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
this.target = null;
}
if (silent) {
this.lastYaw = ctx.player().rotationYaw;
ctx.player().rotationPitch = this.target.getPitch();
ctx.player().rotationYaw = this.target.getYaw();
}
break;
}
case POST: {
@ -116,6 +120,11 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
}
}
/**
* Smoothly pans to desired rotation
* @param desiredYaw
* @param desiredPitch
*/
private void lookTo(float desiredYaw, float desiredPitch) {
if (desiredPitch == ctx.player().rotationPitch) {
desiredPitch = 0;

View File

@ -44,7 +44,7 @@ public class LitematicaCommand extends Command {
try {
baritone.getBuilderProcess().buildOpenLitematic(schematic);
} catch (IndexOutOfBoundsException e) {
logDirect("Pleas provide a valid index.");
logDirect("Please provide a valid index.");
}
}

View File

@ -26,9 +26,7 @@ import baritone.api.command.Command;
import baritone.api.command.argument.IArgConsumer;
import baritone.api.command.datatypes.ForWaypoints;
import baritone.api.command.datatypes.RelativeBlockPos;
import baritone.api.command.exception.CommandException;
import baritone.api.command.exception.CommandInvalidStateException;
import baritone.api.command.exception.CommandInvalidTypeException;
import baritone.api.command.exception.*;
import baritone.api.command.helpers.Paginator;
import baritone.api.command.helpers.TabCompleteHelper;
import baritone.api.pathing.goals.Goal;
@ -151,9 +149,11 @@ public class WaypointsCommand extends Command {
args.requireMax(1);
IWaypoint.Tag tag = IWaypoint.Tag.getByName(args.getString());
IWaypoint[] waypoints = ForWaypoints.getWaypointsByTag(this.baritone, tag);
for (IWaypoint waypoint : waypoints) {
ForWaypoints.waypoints(this.baritone).removeWaypoint(waypoint);
}
deletedWaypoints.computeIfAbsent(baritone.getWorldProvider().getCurrentWorld(), k -> new ArrayList<>()).addAll(Arrays.<IWaypoint>asList(waypoints));
ITextComponent textComponent = new TextComponentString(String.format("Cleared %d waypoints, click to restore them", waypoints.length));
textComponent.getStyle().setClickEvent(new ClickEvent(