Fix last commit lol

This commit is contained in:
Brady 2018-11-05 13:53:26 -06:00
parent ffb044ffc6
commit c0e0f8dc2a
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 15 additions and 15 deletions

View File

@ -44,6 +44,15 @@ public final class RotationMoveEvent extends ManagedPlayerEvent {
this.yaw = yaw; this.yaw = yaw;
} }
/**
* Set the yaw movement rotation
*
* @param yaw Yaw rotation
*/
public final void setYaw(float yaw) {
this.yaw = yaw;
}
/** /**
* @return The yaw rotation * @return The yaw rotation
*/ */

View File

@ -97,22 +97,13 @@ public final class LookBehavior extends Behavior implements ILookBehavior, Helpe
@Override @Override
public void onPlayerRotationMove(RotationMoveEvent event) { public void onPlayerRotationMove(RotationMoveEvent event) {
if (this.target != null && !this.force) { if (this.target != null && !this.force) {
switch (event.getState()) {
case PRE:
this.lastYaw = player().rotationYaw;
player().rotationYaw = this.target.getYaw();
break;
case POST:
player().rotationYaw = this.lastYaw;
// If we have antiCheatCompatibility on, we're going to use the target value later in onPlayerUpdate() event.setYaw(this.target.getYaw());
// Also the type has to be MOTION_UPDATE because that is called after JUMP
if (!Baritone.settings().antiCheatCompatibility.get() && event.getType() == RotationMoveEvent.Type.MOTION_UPDATE) { // If we have antiCheatCompatibility on, we're going to use the target value later in onPlayerUpdate()
this.target = null; // Also the type has to be MOTION_UPDATE because that is called after JUMP
} if (!Baritone.settings().antiCheatCompatibility.get() && event.getType() == RotationMoveEvent.Type.MOTION_UPDATE) {
break; this.target = null;
default:
break;
} }
} }
} }